|
@@ -443,11 +443,19 @@ public class AutomaticPay {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据车牌号判断,解绑
|
|
|
+ * 补录进场解绑逻辑
|
|
|
* @return
|
|
|
*/
|
|
|
private void autoUnbindCarByPlate(String plate){
|
|
|
if(NbUtil.isNull(plate)) return;
|
|
|
+ TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(plate);
|
|
|
+ //离场逻辑
|
|
|
+ if (tbBusinessCar!=null){
|
|
|
+ if(doUnbindCarByPlate(tbBusinessCar)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //进场逻辑
|
|
|
TbDeductionBind bind = deductionBindService.getOne(new LambdaQueryWrapper<TbDeductionBind>().eq(
|
|
|
TbDeductionBind::getBindCar,plate).isNull(TbDeductionBind::getUnbindTime));
|
|
|
if(bind != null){
|
|
@@ -474,6 +482,28 @@ public class AutomaticPay {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 补录出场解绑逻辑
|
|
|
+ * @param tbBusinessCar
|
|
|
+ */
|
|
|
+ private boolean doUnbindCarByPlate(TbBusinessCar tbBusinessCar){
|
|
|
+ if (tbBusinessCar==null || tbBusinessCar.getRealOutTime()==null){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ TbDeductionBind bind = deductionBindService.getOne(new LambdaQueryWrapper<TbDeductionBind>().eq(
|
|
|
+ TbDeductionBind::getBindCar,tbBusinessCar.getCarNo())
|
|
|
+ .lt(TbDeductionBind::getBindTime,tbBusinessCar.getRealOutTime())
|
|
|
+ .isNull(TbDeductionBind::getUnbindTime));
|
|
|
+ if(bind==null){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ bind.setUpdateBy("预充值自动缴费解绑");
|
|
|
+ bind.setUpdateTime(new Date());
|
|
|
+ bind.setUnbindTime(new Date());
|
|
|
+ bind.updateById();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 缓存任务,如果存在任务不继续往下执行
|
|
|
* @param businessId
|
|
|
* @param plate
|