use of com.github.liuweijw.business.admin.domain.Module in project fw-cloud-framework by liuweijw.
the class MenuServiceImpl method findAllMenuTree.
// 目前只支持二级菜单,若有三级,则改递归即可
@Override
public List<MenuTree> findAllMenuTree() {
List<Menu> rList = this.findMenuList();
List<Module> moduleList = this.moduleService.getAllList();
List<MenuTree> menuTreeList = new ArrayList<MenuTree>();
rList.forEach(menu -> {
if (menu.getPid() != 0 && null != moduleList && moduleList.size() > 0) {
moduleList.forEach(m -> {
String id = menu.getPath() + "_" + m.getCode();
menuTreeList.add(new MenuTree(id, menu.getMenuId() + "", m.getName()));
});
}
menuTreeList.add(new MenuTree(menu.getMenuId() + "", menu.getPid() + "", menu.getMenuName()));
});
return TreeUtil.build(menuTreeList, "0");
}
Aggregations