From adba838128558829f5cde6c29cfa62f048dfa997 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 7 Jun 2024 09:01:53 +0800 Subject: [PATCH] =?UTF-8?q?#=E9=80=9A=E8=AE=AF=E4=B8=AD=E6=96=AD=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E5=86=85=E5=AE=B9=E6=88=AA=E5=8F=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java | 3 ++- .../hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java | 2 +- .../service/operation/home/impl/RealTargetServiceImpl.java | 7 +++++++ .../operational/station/service/impl/RealMonitorServiceImpl.java | 4 ++-- hzims-service/operational/src/main/resources/db/2.0.6.sql | 1 + 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 hzims-service/operational/src/main/resources/db/2.0.6.sql diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java index 649e154..f8a7a76 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java @@ -91,7 +91,8 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { } } // 告警站点名称截取 - if(StringUtil.isNotBlank(alarm.getAlarmContext()) && !AlarmConstants.CONDITION_ALARM.equals(alarm.getAlarmSource())){ + if(StringUtil.isNotBlank(alarm.getAlarmContext()) && !AlarmConstants.CONDITION_ALARM.equals(alarm.getAlarmSource()) && !AlarmConstants.INTERRUPT.equals(alarm.getAlarmType()) + && !AlarmConstants.ABNORMAL.equals(alarm.getAlarmType())){ String[] countext = alarm.getAlarmContext().split("\\."); alarm.setAlarmContext(countext[countext.length - 1]); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java index 69c643c..c78f300 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java @@ -274,7 +274,7 @@ public class AlarmServiceImpl implements AlarmService { alarm.setType(Integer.parseInt(entity.getType())); alarm.setStation(entity.getStationId()); alarm.setRealId(entity.getRealId()); - alarm.setContext(entity.getStationName() + "." + entity.getSoeExplain()); + alarm.setContext(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)); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 847fd19..106e0aa 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -1270,6 +1270,13 @@ public class RealTargetServiceImpl implements RealTargetService { log.error("pool_item_execute_complete_error : {}" ,e.getMessage()); } } + // 等待所有线程执行完成 + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + Thread.currentThread().interrupt(); + } redisTemplate.opsForValue().set(recent_year_power_data, powerMap); } 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 1d7b99e..b83ad0c 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 @@ -339,9 +339,9 @@ public class RealMonitorServiceImpl implements IRealMonitorService { if(station.getWaterLevel() <= 0){ return; } - if(station.getWaterLevelMax() < station.getWaterLevel() || station.getDownWaterLevel() > station.getWaterLevel()){ + if(station.getWaterLevelMax() > 0 && station.getWaterLevel() > station.getWaterLevelMax()){ station.setWaterColor(2); - }else if((station.getWaterLevelMax() > 0 && (station.getWaterLevel() / station.getWaterLevelMax()) > 0.8) || (station.getDownWaterLevel() > 0 && (station.getWaterLevel() / station.getDownWaterLevel()) < 1.2)){ + }else if(station.getDownWaterLevel() > 0 && station.getWaterLevel() < station.getDownWaterLevel()){ station.setWaterColor(1); } } diff --git a/hzims-service/operational/src/main/resources/db/2.0.6.sql b/hzims-service/operational/src/main/resources/db/2.0.6.sql new file mode 100644 index 0000000..bd1a21f --- /dev/null +++ b/hzims-service/operational/src/main/resources/db/2.0.6.sql @@ -0,0 +1 @@ +ALTER TABLE `hzims_station` ADD COLUMN `DOWN_WATER_LEVEL` decimal(6, 2) NULL DEFAULT NULL COMMENT '下限水位' AFTER `LIMIT_WATER_LEVEL`; \ No newline at end of file