648540858
2024-04-22 8cba63642fcff122907bd7d7a8d7d822555d34ca
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
@@ -96,10 +96,6 @@
            // 遍历DeviceList
            while (deviceListIterator.hasNext()) {
               Element itemDevice = deviceListIterator.next();
               Element channelDeviceElement = itemDevice.element("DeviceID");
               if (channelDeviceElement == null) {
                  continue;
               }
               Element eventElement = itemDevice.element("Event");
               String event;
               if (eventElement == null) {
@@ -264,21 +260,12 @@
      }
   }
   // TODO 同一个通道如果先发送更新再发送离线可能无法正常离线
   private void executeSave(){
      try {
         executeSaveForAdd();
      } catch (Exception e) {
         logger.error("[存储收到的增加通道] 异常: ", e );
      }
      try {
         executeSaveForUpdate();
      } catch (Exception e) {
         logger.error("[存储收到的更新通道] 异常: ", e );
      }
      try {
         executeSaveForDelete();
      } catch (Exception e) {
         logger.error("[存储收到的删除通道] 异常: ", e );
      }
      try {
         executeSaveForOnline();
@@ -290,14 +277,26 @@
      } catch (Exception e) {
         logger.error("[存储收到的通道离线] 异常: ", e );
      }
      try {
         executeSaveForUpdate();
      } catch (Exception e) {
         logger.error("[存储收到的更新通道] 异常: ", e );
      }
      try {
         executeSaveForDelete();
      } catch (Exception e) {
         logger.error("[存储收到的删除通道] 异常: ", e );
      }
      dynamicTask.stop(talkKey);
   }
   private void executeSaveForUpdate(){
      if (!updateChannelMap.values().isEmpty()) {
         logger.info("[存储收到的更新通道], 数量: {}", updateChannelMap.size());
         ArrayList<DeviceChannel> deviceChannels = new ArrayList<>(updateChannelMap.values());
         updateChannelMap.clear();
         deviceChannelService.batchUpdateChannel(deviceChannels);
         updateChannelMap.clear();
      }
   }