648540858
2023-04-04 b4048fbe80dba8e7756ae557a15ab60b4f80a44b
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
@@ -99,31 +99,35 @@
      taskQueue.offer(new HandlerCatchData(evt, null, null));
      if (!runed) {
         taskExecutor.execute(()-> {
            while (!taskQueue.isEmpty()) {
               try {
                  HandlerCatchData take = taskQueue.poll();
                  Element rootElement = getRootElement(take.getEvt());
                  if (rootElement == null) {
                     logger.error("处理NOTIFY消息时未获取到消息体,{}", take.getEvt().getRequest());
                     continue;
                  }
                  String cmd = XmlUtil.getText(rootElement, "CmdType");
            try {
               while (!taskQueue.isEmpty()) {
                  try {
                     HandlerCatchData take = taskQueue.poll();
                     Element rootElement = getRootElement(take.getEvt());
                     if (rootElement == null) {
                        logger.error("处理NOTIFY消息时未获取到消息体,{}", take.getEvt().getRequest());
                        continue;
                     }
                     String cmd = XmlUtil.getText(rootElement, "CmdType");
                  if (CmdType.CATALOG.equals(cmd)) {
                     logger.info("接收到Catalog通知");
                     processNotifyCatalogList(take.getEvt());
                  } else if (CmdType.ALARM.equals(cmd)) {
                     logger.info("接收到Alarm通知");
                     processNotifyAlarm(take.getEvt());
                  } else if (CmdType.MOBILE_POSITION.equals(cmd)) {
                     logger.info("接收到MobilePosition通知");
                     processNotifyMobilePosition(take.getEvt());
                  } else {
                     logger.info("接收到消息:" + cmd);
                     if (CmdType.CATALOG.equals(cmd)) {
                        logger.info("接收到Catalog通知");
                        processNotifyCatalogList(take.getEvt());
                     } else if (CmdType.ALARM.equals(cmd)) {
                        logger.info("接收到Alarm通知");
                        processNotifyAlarm(take.getEvt());
                     } else if (CmdType.MOBILE_POSITION.equals(cmd)) {
                        logger.info("接收到MobilePosition通知");
                        processNotifyMobilePosition(take.getEvt());
                     } else {
                        logger.info("接收到消息:" + cmd);
                     }
                  } catch (DocumentException e) {
                     logger.error("处理NOTIFY消息时错误", e);
                  }
               } catch (DocumentException e) {
                  logger.error("处理NOTIFY消息时错误", e);
               }
            }catch (Exception e) {
               logger.error("处理NOTIFY消息时错误", e);
            }
         });
      }
@@ -393,12 +397,20 @@
                  case CatalogEvent.OFF :
                     // 离线
                     logger.info("[收到通道离线通知] 来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
                     storager.deviceChannelOffline(deviceId, channel.getChannelId());
                     if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
                        storager.deviceChannelOffline(deviceId, channel.getChannelId());
                     }else {
                        logger.info("[收到通道离线通知] 但是平台已配置拒绝此消息,来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
                     }
                     break;
                  case CatalogEvent.VLOST:
                     // 视频丢失
                     logger.info("[收到通道视频丢失通知] 来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
                     storager.deviceChannelOffline(deviceId, channel.getChannelId());
                     if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
                        storager.deviceChannelOffline(deviceId, channel.getChannelId());
                     }else {
                        logger.info("[收到通道视频丢失通知] 但是平台已配置拒绝此消息,来自设备: {}, 通道 {}", device.getDeviceId(), channel.getChannelId());
                     }
                     break;
                  case CatalogEvent.DEFECT:
                     // 故障