Commit d3027b066831437e18ce42ce7d8f0b3d428c4893
1 parent
22a205e8
优化消息通道
Showing
2 changed files
with
7 additions
and
4 deletions
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 | @@ -269,12 +269,15 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme | ||
| 269 | if (channelId.equals(parentPlatform.getDeviceGBId())) { | 269 | if (channelId.equals(parentPlatform.getDeviceGBId())) { |
| 270 | // 发送给平台的报警信息。 发送redis通知 | 270 | // 发送给平台的报警信息。 发送redis通知 |
| 271 | AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage(); | 271 | AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage(); |
| 272 | - alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); | 272 | + if (deviceAlarm.getAlarmMethod() != null) { |
| 273 | + alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); | ||
| 274 | + } | ||
| 273 | alarmChannelMessage.setAlarmDescription(deviceAlarm.getAlarmDescription()); | 275 | alarmChannelMessage.setAlarmDescription(deviceAlarm.getAlarmDescription()); |
| 274 | alarmChannelMessage.setGbId(channelId); | 276 | alarmChannelMessage.setGbId(channelId); |
| 275 | - alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); | 277 | + if (deviceAlarm.getAlarmType() != null) { |
| 278 | + alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); | ||
| 279 | + } | ||
| 276 | redisCatchStorage.sendAlarmMsg(alarmChannelMessage); | 280 | redisCatchStorage.sendAlarmMsg(alarmChannelMessage); |
| 277 | - return; | ||
| 278 | } | 281 | } |
| 279 | } | 282 | } |
| 280 | } | 283 | } |
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
| @@ -857,7 +857,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { | @@ -857,7 +857,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { | ||
| 857 | 857 | ||
| 858 | @Override | 858 | @Override |
| 859 | public void sendAlarmMsg(AlarmChannelMessage msg) { | 859 | public void sendAlarmMsg(AlarmChannelMessage msg) { |
| 860 | - String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM_RECEIVE; | 860 | + String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM; |
| 861 | logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg)); | 861 | logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg)); |
| 862 | RedisUtil.convertAndSend(key, (JSONObject)JSON.toJSON(msg)); | 862 | RedisUtil.convertAndSend(key, (JSONObject)JSON.toJSON(msg)); |
| 863 | } | 863 | } |