修复分组不显示问题

pull/22/head
rays 2021-06-24 15:23:53 +08:00
parent 25c393f0fd
commit e5ab118068
1 changed files with 12 additions and 10 deletions

View File

@ -230,16 +230,18 @@ public class ApiGroupServiceImpl extends ServiceImpl<ApiGroupMapper, ApiGroup> i
}
}
// 删除空分组
Iterator<ApiGroupTreeWrapper> iterator = allApiGroupTreeWrapperList.iterator();
while (iterator.hasNext()) {
ApiGroupTreeWrapper item = iterator.next();
if (RuleConstants.TREE_ROOT_ID.toString().equals(item.getNodeParentId()) || NodeTypeEnums.DATA_NODE.getType().equals(item.getType())) {
continue;
} else {
Integer integer = notNullGroup.get(item.getId());
if (ObjectUtil.isEmpty(integer) || integer == 0) {
iterator.remove();
// 如果是搜索,则删除空分组
if (ObjectUtil.isNotEmpty(apiGroupRequest.getGroupName())) {
Iterator<ApiGroupTreeWrapper> iterator = allApiGroupTreeWrapperList.iterator();
while (iterator.hasNext()) {
ApiGroupTreeWrapper item = iterator.next();
if (RuleConstants.TREE_ROOT_ID.toString().equals(item.getNodeParentId()) || NodeTypeEnums.DATA_NODE.getType().equals(item.getType())) {
continue;
} else {
Integer integer = notNullGroup.get(item.getId());
if (ObjectUtil.isEmpty(integer) || integer == 0) {
iterator.remove();
}
}
}
}