Explorar o código

已审核业务修改时需要驳回才能修改,录入

qzyReal %!s(int64=2) %!d(string=hai) anos
pai
achega
160b4b8153

+ 9 - 1
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -796,6 +796,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             //最新一条记录
             TbBusinessCar db = tbBusinessCarService.findTheLastRecord(carNo);
+            if (db!=null&&db.getConfirmJudge()==TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
+                throw new BusinessException("车辆【"+carNo+"】已审核,请驳回再录入业务");
+            }
             if (!tbGoods.getName().contains("整车")){
                 //记录不存在或者已离场
                 if (db==null||db.getRealOutTime()!=null){
@@ -914,6 +917,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             if (StrUtil.isNotEmpty(businessCarId)) {
                 //原来已存在的
                 TbBusinessCar dbBusinessCar = tbBusinessCarService.getById(businessCarId);
+                if (dbBusinessCar.getConfirmJudge()==TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
+                    throw new BusinessException("车辆【"+carNo+"】已审核,请驳回再录入业务");
+                }
                 //如果修改了车牌号
                 String dbCarNo = dbBusinessCar.getCarNo();
                 if (!dbCarNo.equals(carNo)) {
@@ -950,7 +956,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 if (checkCar == null ||
                         (checkCar.getRealInTime() != null && checkCar.getRealOutTime() != null)) {
                     checkCar = new TbBusinessCar();
-                    checkCar.setCreateTime(now).setPay(0).setNo(carBuseinssNo + RandomUtil.randomNumbers(4));
+                    checkCar.setCreateTime(now).setPay(0).setBusinessType(1)
+                            .setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.NO_JUDGE.getCode())
+                            .setNo(carBuseinssNo + RandomUtil.randomNumbers(4));
                 }
                 checkCar.setCarNo(carNo).setCarType(tbBusinessCar.getCarType()).setCarSize(tbBusinessCar.getCarSize())
                         .setNetWeight(tbBusinessCar.getNetWeight()).setCustomerId(dbBusiness.getCustomerId())

+ 4 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -24,6 +24,7 @@ import com.pj.project.tb_deduction_bind.TbDeductionBindService;
 import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
 import com.pj.project.tb_item.TbItem;
+import com.pj.project4sp.global.BusinessException;
 import com.pj.project4sp.uploadfile.UploadConfig;
 import com.pj.utils.sg.AjaxError;
 import com.pj.utils.sg.AjaxJson;
@@ -207,6 +208,9 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     public void updateCarRecord(TbBusinessCar t) throws Exception {
         String outRemark = t.getOutRemark();
         TbBusinessCar db = this.getById(t.getId());
+        if (db.getConfirmJudge()==TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
+            throw new BusinessException("车辆【"+db.getCarNo()+"】已审核,请驳回再录入业务");
+        }
         if (StrUtil.isEmpty(outRemark) && !Objects.equals(t.getRealOutTime(), db.getRealOutTime())) {
             throw new Exception("补录离场时间,出场确认说明必填");
         }