From 6ccdade06b2b87927c49fae6e40f80dfa7a3fcf0 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Sun, 7 Apr 2024 17:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=8A=E8=AD=A6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));