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