From 43a2344ad08ddfd5d12411f5a6c09d117c44dcf9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 19 Sep 2024 16:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DNOTIFY=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E9=80=9A=E9=81=93=E7=9A=84=E7=8A=B6=E6=80=81=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/dao/DeviceChannelMapper.java | 10 +++++----- .../iot/vmp/gb28181/service/IDeviceChannelService.java | 4 ++-- .../gb28181/service/impl/DeviceChannelServiceImpl.java | 8 ++++---- .../request/impl/NotifyRequestForCatalogProcessor.java | 10 +++------- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceChannelMapper.java index f74f81fb..2f70ee8d 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceChannelMapper.java @@ -624,21 +624,21 @@ public interface DeviceChannelMapper { "DELETE FROM wvp_device_channel WHERE id=#{item.id}" + "" + ""}) - int batchDel(@Param("deleteChannelList") List deleteChannelList); + int batchDel(List deleteChannelList); @Update({""}) - int batchOnline(@Param("channels") List channels); + int batchOnlineForNotify(List channels); @Update({""}) - int batchOffline(List channels); + int batchOfflineForNotify(List channels); @Select("select count(1) from wvp_device_channel where status = 'ON'") diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IDeviceChannelService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IDeviceChannelService.java index 22828e39..80bd7e55 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IDeviceChannelService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IDeviceChannelService.java @@ -50,12 +50,12 @@ public interface IDeviceChannelService { /** * 批量上线 */ - int channelsOnline(List channels); + int channelsOnlineForNotify(List channels); /** * 批量下线 */ - int channelsOffline(List channels); + int channelsOfflineForNotify(List channels); /** * 获取一个通道 diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java index ae5332be..dc372f9f 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java @@ -198,8 +198,8 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService { } @Override - public int channelsOnline(List channels) { - return channelMapper.batchOnline(channels); + public int channelsOnlineForNotify(List channels) { + return channelMapper.batchOnlineForNotify(channels); } @Override @@ -208,8 +208,8 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService { } @Override - public int channelsOffline(List channels) { - return channelMapper.batchOffline(channels); + public int channelsOfflineForNotify(List channels) { + return channelMapper.batchOfflineForNotify(channels); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java index 3ac05be1..adb4af8b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java @@ -112,6 +112,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent log.info("[解析CatalogChannelEvent]成功:但是解析通道信息失败, 原文如下: \n{}", new String(evt.getRequest().getRawContent())); continue; } + catalogChannelEvent.getChannel().setDeviceDbId(device.getId()); } catch (InvocationTargetException | NoSuchMethodException | InstantiationException | IllegalAccessException e) { log.error("[解析CatalogChannelEvent]失败,", e); @@ -305,20 +306,15 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent private void executeSaveForOnline(){ if (!updateChannelOnlineList.isEmpty()) { - deviceChannelService.channelsOnline(updateChannelOnlineList); + deviceChannelService.channelsOnlineForNotify(updateChannelOnlineList); updateChannelOnlineList.clear(); } } private void executeSaveForOffline(){ if (!updateChannelOfflineList.isEmpty()) { - deviceChannelService.channelsOffline(updateChannelOfflineList); + deviceChannelService.channelsOfflineForNotify(updateChannelOfflineList); updateChannelOfflineList.clear(); } } - -// @Scheduled(fixedRate = 10000) //每1秒执行一次 -// public void execute(){ -// logger.info("[待处理Notify-目录订阅消息数量]: {}", taskQueue.size()); -// } }