|
@@ -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));
|
|
|
//泵站-小区列表
|