From d3027b066831437e18ce42ce7d8f0b3d428c4893 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 17 Mar 2023 15:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/notify/cmd/AlarmNotifyMessageHandler.java | 9 ++++++--- .../iot/vmp/storager/impl/RedisCatchStorageImpl.java | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java index ddbad1da..9268e9b5 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java @@ -269,12 +269,15 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme if (channelId.equals(parentPlatform.getDeviceGBId())) { // 发送给平台的报警信息。 发送redis通知 AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage(); - alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); + if (deviceAlarm.getAlarmMethod() != null) { + alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); + } alarmChannelMessage.setAlarmDescription(deviceAlarm.getAlarmDescription()); alarmChannelMessage.setGbId(channelId); - alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); + if (deviceAlarm.getAlarmType() != null) { + alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); + } redisCatchStorage.sendAlarmMsg(alarmChannelMessage); - return; } } } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java index 0997fe11..f9e0c068 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java @@ -857,7 +857,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { @Override public void sendAlarmMsg(AlarmChannelMessage msg) { - String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM_RECEIVE; + String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM; logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg)); RedisUtil.convertAndSend(key, (JSONObject)JSON.toJSON(msg)); }