|
|
@@ -129,6 +129,7 @@ public final class TreeUtil { |
|
|
|
Map<Long, MenuRoleVO> menuMap, |
|
|
|
Long parentId, |
|
|
|
ListIterator<MenuRoleVO> parentIter) { |
|
|
|
MenuRoleVO parentMenu = menuMap.get(parentId); |
|
|
|
List<MenuRoleVO> 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<MenuTypeEnum, List<MenuRoleVO>> 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)); |
|
|
|
} |
|
|
|