diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPSender.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPSender.java index e8066b75..ce1074bd 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPSender.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPSender.java @@ -66,17 +66,17 @@ public class SIPSender { // 添加错误订阅 if (errorEvent != null) { sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (eventResult -> { - errorEvent.response(eventResult); sipSubscribe.removeErrorSubscribe(eventResult.callId); sipSubscribe.removeOkSubscribe(eventResult.callId); + errorEvent.response(eventResult); })); } // 添加订阅 if (okEvent != null) { sipSubscribe.addOkSubscribe(callIdHeader.getCallId(), eventResult -> { - okEvent.response(eventResult); sipSubscribe.removeOkSubscribe(eventResult.callId); sipSubscribe.removeErrorSubscribe(eventResult.callId); + okEvent.response(eventResult); }); } if ("TCP".equals(transport)) { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index f6a151a4..5e7314e0 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -695,6 +695,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { }else { subChannels = channelList.subList(index, channelList.size()); } + logger.info("[发送NOTIFY通知]类型: {},发送数量: {}", type, channels.size()); Integer finalIndex = index; String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, subChannels, type); sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index 8623e1f4..98ea89f0 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -285,7 +285,7 @@ public class DeviceServiceImpl implements IDeviceService { // 设置最小值为30 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30); // 刷新订阅 - dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, (subscribeCycleForCatalog) * 1000); + dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog * 1000); return true; } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java index 1c938523..01d40200 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java @@ -154,6 +154,26 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { return platformChannelMapper.queryChannelByPlatformIdAndChannelDeviceId(platformId, channelId); } + @Override + public int delAllChannelForGB(String platformId, String catalogId) { + + int result; + if (platformId == null) { + return 0; + } + ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); + if (platform == null) { + return 0; + } + if (ObjectUtils.isEmpty(catalogId)) { + catalogId = null; + } + + List deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId); + eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL); + + return platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId); + } @Override public List queryCommonGbChannellList(Integer platformId) { return platformChannelMapper.queryCommonGbChannellList(platformId); diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue index d833b132..5fb506ec 100755 --- a/web_src/src/components/dialog/deviceEdit.vue +++ b/web_src/src/components/dialog/deviceEdit.vue @@ -20,7 +20,7 @@ - +