diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java index 34f414fa..6d863d35 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java @@ -37,7 +37,7 @@ public class TreeUtil { * @param treeNodes 传入的树节点列表 * @return */ - public List bulid(List treeNodes, Object root) { + public List buildByLoop(List treeNodes, Object root) { List trees = new ArrayList<>(); @@ -100,7 +100,7 @@ public class TreeUtil { * @param root * @return */ - public List bulidTree(List menus, int root) { + public List buildTree(List menus, int root) { List trees = new ArrayList<>(); MenuTree node; for (SysMenu menu : menus) { @@ -116,6 +116,6 @@ public class TreeUtil { node.setKeepAlive(menu.getKeepAlive()); trees.add(node); } - return TreeUtil.bulid(trees, root); + return TreeUtil.buildByLoop(trees, root); } } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java index e45b0585..f1bc65c4 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java @@ -63,7 +63,7 @@ public class MenuController { .map(MenuTree::new) .sorted(Comparator.comparingInt(MenuTree::getSort)) .collect(Collectors.toList()); - return new R<>(TreeUtil.bulid(menuTreeList, -1)); + return new R<>(TreeUtil.buildByLoop(menuTreeList, -1)); } /** @@ -73,7 +73,7 @@ public class MenuController { */ @GetMapping(value = "/tree") public R getTree() { - return new R<>(TreeUtil.bulidTree(sysMenuService.list(Wrappers.emptyWrapper()), -1)); + return new R<>(TreeUtil.buildTree(sysMenuService.list(Wrappers.emptyWrapper()), -1)); } /** diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java index b5c1e988..645491a0 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java @@ -154,6 +154,6 @@ public class SysDeptServiceImpl extends ServiceImpl impl node.setName(dept.getName()); return node; }).collect(Collectors.toList()); - return TreeUtil.bulid(treeList, 0); + return TreeUtil.buildByLoop(treeList, 0); } }