From 163e563e265bca17af68cf568c589d993b9edf4f Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 27 Mar 2023 15:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8C=89=E9=92=AE=E7=9A=84to?= =?UTF-8?q?pMenu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0bd168c..01eb535 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 @@ -129,6 +129,7 @@ public final class TreeUtil { Map menuMap, Long parentId, ListIterator parentIter) { + MenuRoleVO parentMenu = menuMap.get(parentId); List currMenus = menuGroup.get(parentId); if (currMenus == null) { return Collections.emptyList(); @@ -137,6 +138,7 @@ public final class TreeUtil { 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()); @@ -150,7 +152,7 @@ public final class TreeUtil { curr.setPid(null); curr.setTopMenu(curr.getName()); } else { - curr.setTopMenu(menuMap.get(curr.getPid()).getTopMenu()); + curr.setTopMenu(parentMenu.getTopMenu()); } curr.setChildren(buildUserMenuTree(menuGroup, menuMap, curr.getId(), currIter)); }