Explorar o código

添加停水公告 停止时间可以为空的相关处理

王苗苗 hai 1 semana
pai
achega
66b13fb05c

+ 6 - 3
slibra-system/src/main/java/com/slibra/business/service/impl/TCutOffWaterServiceImpl.java

@@ -83,15 +83,18 @@ public class TCutOffWaterServiceImpl implements ITCutOffWaterService
     private void addExtra(TCutOffWater tCutOffWater) {
         Long id = tCutOffWater.getId();
         // 停水状态
+        //前提条件是一定有开始时间,这里就不判断了
         Date nowDate = DateUtils.getNowDate();
         Date timeBegin = tCutOffWater.getTimeBegin();
         Date timeEnd = tCutOffWater.getTimeEnd();
-        if(nowDate.after(timeEnd))
+        if(!Objects.isNull(timeEnd) && nowDate.after(timeEnd))
             tCutOffWater.setStatus(3);
         if(nowDate.before(timeBegin))
             tCutOffWater.setStatus(1);
-        if(nowDate.after(timeBegin) && nowDate.before(timeEnd))
-            tCutOffWater.setStatus(2);
+        if(nowDate.after(timeBegin)){
+            if(Objects.isNull(timeEnd) || nowDate.before(timeEnd))
+                tCutOffWater.setStatus(2);
+        }
         //停水的所有的小区的名字
         tCutOffWater.setNeighbourhoodName(this.tCutOffWaterMapper.getDistinctNamesUnionById(id));
         //泵站-小区列表

+ 1 - 0
slibra-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -31,6 +31,7 @@
 /Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/system/service/impl/SysDictTypeServiceImpl.java
 /Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/business/service/ITWhitelistService.java
 /Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/system/service/ISysDictTypeService.java
+/Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/business/res/PumpingNeighbourNumber.java
 /Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/system/service/ISysConfigService.java
 /Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/business/res/Ele.java
 /Users/wangmiaomiao/IdeaProjects/intelligent-voice-customer-service-java/slibra-system/src/main/java/com/slibra/system/service/ISysRoleService.java