临时提交

pull/1642/head
648540858 2024-08-21 17:59:58 +08:00
parent a18fba8495
commit 6fcf05e04b
1 changed files with 11 additions and 5 deletions

View File

@ -99,7 +99,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
private Set<Group> deleteEmptyGroup(Set<Group> groupSet, Integer platformId) { private Set<Group> deleteEmptyGroup(Set<Group> groupSet, Integer platformId) {
for (Group group : groupSet) { for (Group group : groupSet) {
// 获取分组子节点 // 获取分组子节点
List<Group> children = platformChannelMapper.getShareChildrenGroup(group.getDeviceId(), platformId); Set<Group> children = platformChannelMapper.queryShareChildrenGroup(group.getDeviceId(), platformId);
if (!children.isEmpty()) { if (!children.isEmpty()) {
groupSet.remove(group); groupSet.remove(group);
continue; continue;
@ -112,11 +112,17 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
} }
platformChannelMapper.removePlatformGroupById(group.getId(), platformId); platformChannelMapper.removePlatformGroupById(group.getId(), platformId);
} }
if (!groupSet.isEmpty()) { if (groupSet.isEmpty()) {
return new HashSet<>();
}
Set<Group> parent = platformChannelMapper.queryShareParentGroupByGroupSet(groupSet, platformId);
if (parent.isEmpty()) {
return groupSet;
}else {
Set<Group> parentGroupSet = deleteEmptyGroup(parent, platformId);
groupSet.addAll(parentGroupSet);
return groupSet;
} }
} }
private Set<Group> getAllGroup(Set<Group> groupList ) { private Set<Group> getAllGroup(Set<Group> groupList ) {