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 fef9ffc..7c66f3a 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 @@ -63,7 +63,7 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { //根据最近5分钟的数据,做去重 for (String key : keys) { String value = stringRedisTemplate.opsForValue().get(key); - if (value.equals(alarm.getAlarmContext())){ + if (value.equals(stations.get(0).getName()+alarm.getAlarmContext())){ return; } } @@ -94,7 +94,7 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { return; } String key="hzims:queue:filter:alarm"+alarm.getAlarmId(); - stringRedisTemplate.opsForValue().set(key,alarm.getAlarmContext()); + stringRedisTemplate.opsForValue().set(key,stations.get(0).getName()+alarm.getAlarmContext()); stringRedisTemplate.expire(key,5, TimeUnit.MINUTES); // 步骤7.发生数据至redis告警队列 stringRedisTemplate.opsForList().rightPush("hzims:queue:alarm", JSON.toJSONString(alarm));