diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java index 81ed1b8..326fb58 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java +++ b/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-展示") private Integer bell; + @ApiModelProperty("水位颜色: 0-蓝色 1-黄色 2-红色") + private Integer waterColor; + @ApiModelProperty("排序") private Integer sort; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java index 411588c..a5a4e97 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java +++ b/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 list, RealStationVo station) { station.setWaterLevel(0.0); + station.setWaterColor(0); if(CollectionUtil.isEmpty(list)){ return; } @@ -964,6 +965,14 @@ public class RealMonitorServiceImpl implements IRealMonitorService { return; } 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); + } } /**