|
@@ -96,14 +96,7 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
|
|
|
if (NbUtil.isNullStr(bind.getBindCar())) {
|
|
|
throw new AjaxError("车牌号不能为空!");
|
|
|
}
|
|
|
- TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
|
|
|
- if (tbBusinessCar != null&&tbBusinessCar.getRealOutTime()==null) {//先录入业务未离场记录,但是没有绑定
|
|
|
- TbDeductionBind bindRecord = this.findByBusinessCarId(tbBusinessCar.getId());
|
|
|
- if (bindRecord == null) {
|
|
|
- //绑定放行记录
|
|
|
- bind.setBusinessCarId(tbBusinessCar.getId());
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
String customerId = bind.getCustomerId();
|
|
|
TbCostomer tbCostomer = tbCostomerService.getById(customerId);
|
|
|
bind.setCustomerName(tbCostomer.getName());
|
|
@@ -113,20 +106,7 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
|
|
|
save(bind);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据放行记录ID查找
|
|
|
- *
|
|
|
- * @param businessCarId
|
|
|
- * @return
|
|
|
- */
|
|
|
- private TbDeductionBind findByBusinessCarId(String businessCarId) {
|
|
|
- QueryWrapper<TbDeductionBind> ew = new QueryWrapper<>();
|
|
|
- ew.lambda().eq(TbDeductionBind::getBusinessCarId, businessCarId)
|
|
|
- .isNull(TbDeductionBind::getUnbindTime)
|
|
|
- .orderByDesc(TbDeductionBind::getId);
|
|
|
- List<TbDeductionBind> list = list(ew);
|
|
|
- return list.isEmpty() ? null : list.get(0);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查找最后一条未解绑绑定记录
|
|
@@ -312,17 +292,5 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
|
|
|
return bind;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据放行记录ID解绑
|
|
|
- * @param businessCarId
|
|
|
- */
|
|
|
- public void unbindByBusinessCarId(String businessCarId){
|
|
|
- QueryWrapper<TbDeductionBind> ew = new QueryWrapper<>();
|
|
|
- ew.lambda().eq(TbDeductionBind::getBusinessCarId, businessCarId)
|
|
|
- .isNull(TbDeductionBind::getUnbindTime)
|
|
|
- .orderByDesc(TbDeductionBind::getId);
|
|
|
- List<TbDeductionBind> list = list(ew);
|
|
|
- list.forEach(tbDeductionBind -> tbDeductionBind.setUnbindTime(new Date()));
|
|
|
- this.updateBatchById(list);
|
|
|
- }
|
|
|
+
|
|
|
}
|