Jelajahi Sumber

Merge branch 'feature-wcz' of lift-manager/lift-server into develop

wucizhong 5 tahun lalu
induk
melakukan
c6e0501744

+ 29 - 11
lift-business-service/src/main/java/cn/com/ty/lift/business/annualinspection/controller/AnnualInspectionController.java

@@ -179,7 +179,11 @@ public class AnnualInspectionController {
         old.setStepStatus(entity.getStepStatus());
 
         old.setStatus(0);
-        old.setStepName(1);
+        if(stepStatus == 1){
+            old.setStepName(1);
+        }else if(stepStatus == 2){
+            old.setStepName(2);//流转到阶段2
+        }
         boolean ai = annualInspectionService.saveOrUpdate(old);
         return RestResponse.success(ai);
     }
@@ -195,8 +199,10 @@ public class AnnualInspectionController {
         Verify.notNull(old, Verify.Inspection.confirm);
         Integer oldStepName = old.getStepName();
         Integer oldStepStatus = old.getStepStatus();
+        Integer stepStatus = entity.getStepStatus();
         Verify.isTrue(oldStepName == 1, "请进行第二阶段操作");
         Verify.isTrue(oldStepStatus == 2 || oldStepStatus == 3, "请进行第二阶段操作");
+        Verify.isTrue(stepStatus == 2 || stepStatus == 3, "请进行第二阶段操作");
 
         old.setCheckDate(entity.getCheckDate());
         old.setInspector(entity.getInspector());
@@ -205,7 +211,11 @@ public class AnnualInspectionController {
 
         old.setStatus(0);
         old.setStepStatus(3);
-        old.setStepName(2);
+        if(stepStatus == 2){
+            old.setStepName(2);
+        }else if(stepStatus == 3){
+            old.setStepName(3);//流转到阶段3
+        }
 
         boolean ai = annualInspectionService.saveOrUpdate(old);
         return RestResponse.success(ai);
@@ -234,20 +244,21 @@ public class AnnualInspectionController {
         old.setStepStatus(entity.getStepStatus());
 
         old.setStatus(0);
-        old.setStepName(3);
         //企业文员确认检验结果-整改 --> 回到第二阶段
-        if(stepStatus == 6){
+        if(stepStatus == 4) {
+            old.setStepName(3);
+        }else if(stepStatus == 5 || stepStatus == 7){
+            old.setStepName(4);//流转到阶段4
+        } else if(stepStatus == 6){
             old.setStepStatus(3);
-            old.setStepName(2);
-        }else if(stepStatus == 7){
-            old.setStatus(2);
+            old.setStepName(2);//转回阶段2
         }
         boolean ai = annualInspectionService.stepThree(old, entity.getProjectId());
         return RestResponse.success(ai);
     }
 
     /**
-     * 8	维保工上传年检报告和合格证
+     * 5,7 -> 8	维保工上传年检报告和合格证
      * 9	企业文员确认年检报告和合格证-合格
      * 10	企业文员确认年检报告和合格证-不合格 -->停用电梯
      */
@@ -273,7 +284,14 @@ public class AnnualInspectionController {
         old.setCertificateImgUrl(entity.getCertificateImgUrl());
 
         old.setFinishTime(LocalDateTime.now());
-        old.setStatus(1);
+
+        if(stepStatus == 8){
+            old.setStatus(1);
+        } else if(stepStatus == 9){
+            old.setStatus(1);
+        } else if(stepStatus == 10){
+            old.setStatus(2);
+        }
         old.setStepName(4);
 
         boolean ai = annualInspectionService.stepFour(old);
@@ -484,7 +502,7 @@ public class AnnualInspectionController {
         entity.setStepStatus(Verify.Inspection.STATUS_CHECK_UPLOAD);
         entity.setStepName(Verify.Inspection.STEP_THREE);
 
-        boolean result = annualInspectionService.stepThree(entity, request.getProjectId());
+        boolean result = annualInspectionService.updateById(entity);
         return RestResponse.success(result);
     }
 
@@ -505,7 +523,7 @@ public class AnnualInspectionController {
         entity.setStepStatus(Verify.Inspection.STATUS_CERTIFICATE_REPORT_UPLOAD);
         entity.setStepName(Verify.Inspection.STEP_FOUR);
 
-        boolean result = annualInspectionService.stepFour(entity);
+        boolean result = annualInspectionService.updateById(entity);
         return RestResponse.success(result);
     }