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 f8a7a76..d044fbf 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 @@ -81,6 +81,12 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { if(CollectionUtil.isNotEmpty(delays) && delays.contains(alarm.getAlarmContext())){ return; } + // 告警站点名称截取 + 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]); + } // 近5分钟内告警重复 if(CollectionUtil.isNotEmpty(keys)){ for (String key : keys) { @@ -90,12 +96,6 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { } } } - // 告警站点名称截取 - 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]); - } // 步骤3.站点参数设置 alarm.setCreateDept(optional.get().getCreateDept()); alarm.setStationName(optional.get().getName()); 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 c78f300..f2aba66 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 @@ -247,6 +247,8 @@ public class AlarmServiceImpl implements AlarmService { if(InterruptionConstants.ABNORMAL_STATUS.equals(soe.getSoeAlarmType())){ entity.setStatus(1); } + + return entity; }).collect(Collectors.toList()); if(CollectionUtil.isEmpty(entities)){