Browse Source

#站点管理、集中监控增加下限水位

zhongwei
yang_shj 8 months ago
parent
commit
98330e808a
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java
  2. 5
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  3. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  4. 11
      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

@ -34,6 +34,9 @@ public class RealStationVo implements Serializable {
@ApiModelProperty("最大前池水位")
private Double waterLevelMax;
@ApiModelProperty("下限前池水位")
private Double downWaterLevel;
@ApiModelProperty("前池水位")
private Double waterLevel;

5
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -27,7 +27,6 @@ import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.mqtt.producer.IMqttSender;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -55,7 +54,7 @@ public class AlarmServiceImpl implements AlarmService {
private final RedisTemplate redisTemplate;
private final IMqttSender mqttSender;
//private final IMqttSender mqttSender;
private final static String start_stop_cache_final = "hzims:operation:start:stop:key";
private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real:key";
@ -277,7 +276,7 @@ public class AlarmServiceImpl implements AlarmService {
alarm.setContext(entity.getStationName() + "." + entity.getSoeExplain());
alarm.setState(entity.getStatus());
log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm));
mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm));
//mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm));
});
}

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -500,6 +500,7 @@ public class MonitorServiceImpl implements MonitorService {
}
realStation.setStationCode(optional.get().getCode());
realStation.setStationName(optional.get().getName());
realStation.setDownWaterLevel(Optional.ofNullable(optional.get().getDownWaterLevel()).orElse(0.0));
realStation.setWaterLevelMax(Optional.ofNullable(optional.get().getLimitWaterLevel()).orElse(0.0));
realStation.setServerType(optional.get().getServeType());
realStation.setStationDeptId(optional.get().getRefDept());

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

@ -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);
}
}

Loading…
Cancel
Save