From 5fd7091cd66f9008b84fdb5f5f9b0fcca6dfa6d3 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 11 Dec 2023 15:30:21 +0800 Subject: [PATCH] =?UTF-8?q?#=E6=B0=B4=E4=BD=8D=E6=9F=B1=E7=8A=B6=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/operational/main/vo/RealStationVo.java | 3 +++ .../operational/station/service/impl/RealMonitorServiceImpl.java | 9 +++++++++ 2 files changed, 12 insertions(+) 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); + } } /**