|
|
|
@ -599,13 +599,16 @@ public class BatchDeviceMessageProcessor { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 推送报警消息(值变化时)
|
|
|
|
if (handVo.getLastPushValue() == null |
|
|
|
|| !handVo.getLastPushValue().equals(handVo.getValue())) { |
|
|
|
Integer lastPushLevel = handVo.getLastPushLevel(); |
|
|
|
|
|
|
|
// 判定条件:首次推送(为null) 或 等级发生变化
|
|
|
|
if (lastPushLevel == null || !lastPushLevel.equals(newLevel)) { |
|
|
|
sendAlarmMessage(handVo, alarmRule.getGasTypeName(), handVo.getValue(), true, context); |
|
|
|
|
|
|
|
// 更新最后推送的状态
|
|
|
|
handVo.setLastPushValue(handVo.getValue()); |
|
|
|
handVo.setLastPushLevel(newLevel); |
|
|
|
} |
|
|
|
|
|
|
|
handVo.setGasStatus(HandAlarmType.ALARM.getType()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -864,7 +867,6 @@ public class BatchDeviceMessageProcessor { |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// 异步发送 Kafka,耗时极短 (<1ms)
|
|
|
|
// 使用 sourceSn 作为 Key,保证同一个部门/设备的报警排队有序处理
|
|
|
|
String key = handVo.getSn(); |
|
|
|
String json = JsonUtils.toJsonString(event); |
|
|
|
|