Browse Source

Merge branch 'hpf' of http://47.101.143.145:8090/77975466/pco into hpf

# Conflicts:
#	sp-admin/sa-view/tb-deduction-record/tb-deduction-record-list.html
qzyReal 2 years ago
parent
commit
d1de2ec882

+ 1 - 1
sp-admin/sa-view/tb-deduction-bind/tb-deduction-bind-list.html

@@ -69,7 +69,7 @@
             <sa-td name="扣款失败提示" prop="feeFailRecord" width="200" height="20"></sa-td>
             <el-table-column label="操作" fixed="right" width="240px">
                 <template slot-scope="s">
-                    <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="sa.isAuth('tb-deduction-bind-list-unbind')"
+                    <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="!s.row.unbindTime&&sa.isAuth('tb-deduction-bind-list-unbind')"
                                @click="unbind(s.row)">手动解绑</el-button>
                 </template>
             </el-table-column>

+ 2 - 5
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -73,10 +73,8 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     @Lazy
     private RelationBusinessCarService relationBusinessCarService;
     @Resource
-    AutomaticPay automaticPay;
-    @Resource
     @Lazy
-    private TbDeductionBindService tbDeductionBindService;
+    AutomaticPay automaticPay;
 
 
     /**
@@ -190,14 +188,13 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         t.setCarNo(carNo).setPay(0).setIsLock(0).setBasePartMoney(new BigDecimal("0")).setTimeUpdate(new Date())
                 .setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
         this.save(t);
-       // automaticPay.unbindRun(carNo);
+        // automaticPay.unbindRun(carNo);
     }
 
     public void updateCarRecord(TbBusinessCar t) throws Exception {
         TbBusinessCar db = this.getById(t.getId());
         if (db.getRealOutTime() == null && t.getRealOutTime() != null) {
             //补录放行记录,解绑扣费绑定
-            tbDeductionBindService.unbindByBusinessCarId(t.getId());
             automaticPay.unbindRun(db.getCarNo());
         }
         String oldCarNo = db.getCarNo();

+ 1 - 4
sp-server/src/main/java/com/pj/project/tb_deduction_bind/TbDeductionBind.java

@@ -99,8 +99,5 @@ public class TbDeductionBind extends Model<TbDeductionBind> implements Serializa
      */
     public String feeFailRecord;
 
-    /**
-     * 放行记录ID
-     */
-    private String businessCarId=null;
+
 }

+ 3 - 35
sp-server/src/main/java/com/pj/project/tb_deduction_bind/TbDeductionBindService.java

@@ -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);
-    }
+
 }