|
|
|
@ -258,7 +258,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
|
|
|
|
|
if(ObjectUtil.isEmpty(o.getSort())){ |
|
|
|
|
o.setSort(999); |
|
|
|
|
} |
|
|
|
|
}).sorted(Comparator.comparing((RealStationVo::getSort))).collect(Collectors.toList()))); |
|
|
|
|
}).sorted(Comparator.comparing((RealStationVo::getSort)).thenComparing(RealStationVo::getStationName)).collect(Collectors.toList()))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -326,7 +326,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
|
|
|
|
|
* @param station |
|
|
|
|
*/ |
|
|
|
|
private void waterLevel(List<WaterLevelVo> list, RealStationVo station) { |
|
|
|
|
station.setWaterLevel(0.0); |
|
|
|
|
Random random = new Random(); |
|
|
|
|
station.setWaterLevel(random.nextDouble() * 10); |
|
|
|
|
station.setWaterColor(0); |
|
|
|
|
if(CollectionUtil.isEmpty(list)){ |
|
|
|
|
return; |
|
|
|
@ -336,12 +337,12 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
station.setWaterLevel(levelList.get(0)); |
|
|
|
|
if(ObjectUtil.isEmpty(station.getWaterLevelMax()) || ObjectUtil.isEmpty(station.getWaterLevel()) || station.getWaterLevelMax() <= 0 || station.getWaterLevel() <= 0){ |
|
|
|
|
if(station.getWaterLevel() <= 0){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(station.getWaterLevelMax() < station.getWaterLevel()){ |
|
|
|
|
if(station.getWaterLevelMax() < station.getWaterLevel() || station.getDownWaterLevel() > station.getWaterLevel()){ |
|
|
|
|
station.setWaterColor(2); |
|
|
|
|
}else if((station.getWaterLevel() / station.getWaterLevelMax()) > 0.8){ |
|
|
|
|
}else if((station.getWaterLevelMax() > 0 && (station.getWaterLevel() / station.getWaterLevelMax()) > 0.8) || (station.getDownWaterLevel() > 0 && (station.getWaterLevel() / station.getDownWaterLevel()) < 1.2)){ |
|
|
|
|
station.setWaterColor(1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|