소스 검색

Merge branch 'fu-dev' of uskycloud/usky-modules into server-165

fuyuchuan 1 년 전
부모
커밋
b23fda404c
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java

+ 7 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java

@@ -239,11 +239,16 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
         if (planSonList.size() <= 0) {
             throw new BusinessException("计划不存在,可能已被删除,请联系管理人员");
         }
-
+        /*
+        * 巡检时间判断
+        * */
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime inspectionDateTime = LocalDateTime.parse(planSonList.get(0).getInspectionDate() +" "+ planSonList.get(0).getStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+        LocalDateTime inspectionDateTime1 = LocalDateTime.parse(planSonList.get(0).getInspectionDate() +" "+ planSonList.get(0).getEndTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
         if (inspectionDateTime.isAfter(now)) {
-            throw new BusinessException("不能操作未来的计划");
+            throw new BusinessException("计划未开始,不可巡检");
+        } else if (now.isAfter(inspectionDateTime1)){
+            throw new BusinessException("巡检时间已过,请联系管理员");
         }