فهرست منبع

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

wucizhong 5 سال پیش
والد
کامیت
58ff8062b5

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

@@ -140,7 +140,7 @@ public class AnnualInspectionController {
         Verify.nogt0(count, "年检计划已存在");
 
         AnnualInspection current = annualInspectionService.findCurrentConfirm(entity.getLiftId(), entity.getMtCompanyId());
-        if(null != current){
+        if(null != current && null != current.getPlanDate()){
             LocalDate deadline = current.getPlanDate().plusDays(inspection_interval);
             Verify.notTrue(deadline.isBefore(entity.getPlanDate()), "上次年检" + current.getPlanDate() + ",计划年检设置" + deadline + "之前有效");
         }
@@ -264,9 +264,10 @@ public class AnnualInspectionController {
         Verify.isTrue(oldStepName == 2 || oldStepName == 3, "请先完成第二阶段再进行第三阶段");
         Verify.isTrue(oldStepStatus >= 3 && oldStepStatus <= 7, "请进行第三阶段操作");
         Verify.isTrue(stepStatus >= 4 && stepStatus <= 7, "请进行第三阶段操作");
-
-        LocalDate deadline = old.getPlanDate().plusDays(inspection_interval);
-        Verify.notTrue(deadline.isBefore(entity.getNextInspectionTime()), "上次年检" + old.getPlanDate() + ",下次年检设置" + deadline + "之前有效");
+        if(null != old.getPlanDate()){
+            LocalDate deadline = old.getPlanDate().plusDays(inspection_interval);
+            Verify.notTrue(deadline.isBefore(entity.getNextInspectionTime()), "上次年检" + old.getPlanDate() + ",下次年检设置" + deadline + "之前有效");
+        }
 
         old.setStepStatus(entity.getStepStatus());
         old.setCheckResultImg(entity.getCheckResultImg());