|
@@ -129,6 +129,7 @@ public final class TreeUtil { |
|
|
Map<Long, MenuRoleVO> menuMap, |
|
|
Map<Long, MenuRoleVO> menuMap, |
|
|
Long parentId, |
|
|
Long parentId, |
|
|
ListIterator<MenuRoleVO> parentIter) { |
|
|
ListIterator<MenuRoleVO> parentIter) { |
|
|
|
|
|
MenuRoleVO parentMenu = menuMap.get(parentId); |
|
|
List<MenuRoleVO> currMenus = menuGroup.get(parentId); |
|
|
List<MenuRoleVO> currMenus = menuGroup.get(parentId); |
|
|
if (currMenus == null) { |
|
|
if (currMenus == null) { |
|
|
return Collections.emptyList(); |
|
|
return Collections.emptyList(); |
|
@@ -137,6 +138,7 @@ public final class TreeUtil { |
|
|
if (!parentId.equals(StrPool.DEF_PARENT_ID)) { |
|
|
if (!parentId.equals(StrPool.DEF_PARENT_ID)) { |
|
|
Map<MenuTypeEnum, List<MenuRoleVO>> group = CollUtils.group(currMenus, MenuRoleVO::getMenuType); |
|
|
Map<MenuTypeEnum, List<MenuRoleVO>> group = CollUtils.group(currMenus, MenuRoleVO::getMenuType); |
|
|
for (MenuRoleVO vo : group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList())) { |
|
|
for (MenuRoleVO vo : group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList())) { |
|
|
|
|
|
vo.setTopMenu(parentMenu.getTopMenu()); |
|
|
parentIter.add(vo); |
|
|
parentIter.add(vo); |
|
|
} |
|
|
} |
|
|
menus = group.getOrDefault(MenuTypeEnum.MENU, Collections.emptyList()); |
|
|
menus = group.getOrDefault(MenuTypeEnum.MENU, Collections.emptyList()); |
|
@@ -150,7 +152,7 @@ public final class TreeUtil { |
|
|
curr.setPid(null); |
|
|
curr.setPid(null); |
|
|
curr.setTopMenu(curr.getName()); |
|
|
curr.setTopMenu(curr.getName()); |
|
|
} else { |
|
|
} else { |
|
|
curr.setTopMenu(menuMap.get(curr.getPid()).getTopMenu()); |
|
|
|
|
|
|
|
|
curr.setTopMenu(parentMenu.getTopMenu()); |
|
|
} |
|
|
} |
|
|
curr.setChildren(buildUserMenuTree(menuGroup, menuMap, curr.getId(), currIter)); |
|
|
curr.setChildren(buildUserMenuTree(menuGroup, menuMap, curr.getId(), currIter)); |
|
|
} |
|
|
} |
|
|