From 6fcf05e04b6f26762f67d2281893cd260d526d3a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 21 Aug 2024 17:59:58 +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 --- .../service/impl/PlatformChannelServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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 0fc89a20..1fe66e9c 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 @@ -99,7 +99,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { private Set deleteEmptyGroup(Set groupSet, Integer platformId) { for (Group group : groupSet) { // 获取分组子节点 - List children = platformChannelMapper.getShareChildrenGroup(group.getDeviceId(), platformId); + Set children = platformChannelMapper.queryShareChildrenGroup(group.getDeviceId(), platformId); if (!children.isEmpty()) { groupSet.remove(group); continue; @@ -112,11 +112,17 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { } platformChannelMapper.removePlatformGroupById(group.getId(), platformId); } - if (!groupSet.isEmpty()) { - + if (groupSet.isEmpty()) { + return new HashSet<>(); + } + Set parent = platformChannelMapper.queryShareParentGroupByGroupSet(groupSet, platformId); + if (parent.isEmpty()) { + return groupSet; + }else { + Set parentGroupSet = deleteEmptyGroup(parent, platformId); + groupSet.addAll(parentGroupSet); + return groupSet; } - - } private Set getAllGroup(Set groupList ) {