Browse Source

#通讯中断告警内容截取修改

zhongwei
yang_shj 6 months ago
parent
commit
d243dd49f9
  1. 12
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java
  2. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

12
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())){ if(CollectionUtil.isNotEmpty(delays) && delays.contains(alarm.getAlarmContext())){
return; 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分钟内告警重复 // 近5分钟内告警重复
if(CollectionUtil.isNotEmpty(keys)){ if(CollectionUtil.isNotEmpty(keys)){
for (String key : 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.站点参数设置 // 步骤3.站点参数设置
alarm.setCreateDept(optional.get().getCreateDept()); alarm.setCreateDept(optional.get().getCreateDept());
alarm.setStationName(optional.get().getName()); alarm.setStationName(optional.get().getName());

2
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())){ if(InterruptionConstants.ABNORMAL_STATUS.equals(soe.getSoeAlarmType())){
entity.setStatus(1); entity.setStatus(1);
} }
return entity; return entity;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
if(CollectionUtil.isEmpty(entities)){ if(CollectionUtil.isEmpty(entities)){

Loading…
Cancel
Save