From 596092dd269ed9b423656fd337d2c9b737e390ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Wed, 10 May 2023 11:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ningdatech/pmapi/common/util/TreeUtil.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java index a15a8c2..a3e2caf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java @@ -137,15 +137,11 @@ public final class TreeUtil { List menus; if (!parentId.equals(StrPool.DEF_PARENT_ID)) { Map> group = CollUtils.group(currMenus, MenuRoleVO::getMenuType); -// for (MenuRoleVO vo : group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList())) { -// vo.setTopMenu(parentMenu.getTopMenu()); -// parentIter.add(vo); -// } - menus = group.getOrDefault(MenuTypeEnum.MENU, Collections.emptyList()); - List buttons = group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList()); - if (CollUtil.isNotEmpty(buttons)) { - menus.addAll(buttons); + for (MenuRoleVO vo : group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList())) { + vo.setTopMenu(parentMenu.getTopMenu()); + parentIter.add(vo); } + menus = group.getOrDefault(MenuTypeEnum.MENU, Collections.emptyList()); } else { menus = new ArrayList<>(currMenus); }