Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 12 months ago
parent
commit
0f593b5445
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java
  2. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java

@ -46,6 +46,9 @@ public class RealStationVo implements Serializable {
@ApiModelProperty("铃铛展示: 0-不展示 1-展示") @ApiModelProperty("铃铛展示: 0-不展示 1-展示")
private Integer bell; private Integer bell;
@ApiModelProperty("水位颜色: 0-蓝色 1-黄色 2-红色")
private Integer waterColor;
@ApiModelProperty("排序") @ApiModelProperty("排序")
private Integer sort; private Integer sort;
} }

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -956,6 +956,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
*/ */
private void waterLevel(List<WaterLevelVo> list, RealStationVo station) { private void waterLevel(List<WaterLevelVo> list, RealStationVo station) {
station.setWaterLevel(0.0); station.setWaterLevel(0.0);
station.setWaterColor(0);
if(CollectionUtil.isEmpty(list)){ if(CollectionUtil.isEmpty(list)){
return; return;
} }
@ -964,6 +965,14 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
return; return;
} }
station.setWaterLevel(levelList.get(0)); station.setWaterLevel(levelList.get(0));
if(station.getWaterLevelMax() <= 0 || station.getWaterLevel() <= 0){
return;
}
if(station.getWaterLevelMax() < station.getWaterLevel()){
station.setWaterColor(2);
}else if((station.getWaterLevel() / station.getWaterLevelMax()) > 0.9){
station.setWaterColor(1);
}
} }
/** /**

Loading…
Cancel
Save