From a6b436af2925fbd86e70758e40213546aee72393 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 18 Sep 2024 17:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java | 2 +- .../vmp/gb28181/service/impl/PlatformChannelServiceImpl.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java index 4b58aee5..28eb01a8 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java @@ -231,7 +231,7 @@ public class DeviceChannel extends CommonGBChannel { // 此处对于不在wvp缓存中的行政区划,默认直接存储.保证即使出现wvp的行政区划缓存过老,也可以通过用户自主创建的方式正常使用系统 } GbCode gbCode = GbCode.decode(deviceChannel.getDeviceId()); - if ("138".equals(gbCode.getTypeCode())) { + if (gbCode != null && "138".equals(gbCode.getTypeCode())) { deviceChannel.setHasAudio(true); } return deviceChannel; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java index 6d7a6145..169ab31e 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java @@ -334,7 +334,9 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { @Transactional public int removeChannels(Integer platformId, List channelIds) { List channelList = platformChannelMapper.queryShare(platformId, channelIds); - Assert.notEmpty(channelList, "所选通道未共享"); + if (channelList.isEmpty()) { + return 0; + } return removeChannelList(platformId, channelList); }