From e5ab118068cbd9209ccb7f1a3a762aa479058298 Mon Sep 17 00:00:00 2001 From: rays <1615175118@qq.com> Date: Thu, 24 Jun 2021 15:23:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=BB=84=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ApiGroupServiceImpl.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/ApiGroupServiceImpl.java b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/ApiGroupServiceImpl.java index 502c282c9..45354b660 100644 --- a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/ApiGroupServiceImpl.java +++ b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/ApiGroupServiceImpl.java @@ -230,16 +230,18 @@ public class ApiGroupServiceImpl extends ServiceImpl i } } - // 删除空分组 - Iterator 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 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(); + } } } }