| | |
| | | import com.doumee.biz.system.SystemMenuBiz; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.dto.UpdateSystemMenuSortDTO; |
| | | import com.doumee.dao.system.model.SystemMenu; |
| | | import com.doumee.dao.system.vo.SystemMenuListVO; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SystemMenuListVO> findTree() { |
| | | List<SystemMenuListVO> menus = systemMenuService.findList(); |
| | | public List<SystemMenu> findTopList() { |
| | | SystemMenu param =new SystemMenu(); |
| | | param.setDeleted(Boolean.FALSE); |
| | | param.setType(Constants.ONE); |
| | | List<SystemMenu> menus = systemMenuService.findList(param); |
| | | return menus; |
| | | } |
| | | @Override |
| | | public List<SystemMenuListVO> findTree(SystemMenu param) { |
| | | List<SystemMenuListVO> menus = systemMenuService.findManageList(param); |
| | | List<SystemMenuListVO> rootMenus = new ArrayList<>(); |
| | | // 添加根菜单 |
| | | for (SystemMenu menu : menus) { |
| | | for (SystemMenuListVO menu : menus) { |
| | | if (menu.getParentId() == null) { |
| | | SystemMenuListVO rootMenu = new SystemMenuListVO(); |
| | | BeanUtils.copyProperties(menu, rootMenu, "children"); |
| | |
| | | nodeVO.setLabel(menu.getName()); |
| | | nodeVO.setUrl(menu.getPath()); |
| | | nodeVO.setParams(menu.getParams()); |
| | | nodeVO.setType(menu.getType()); |
| | | nodeVO.setIcon(menu.getIcon()); |
| | | nodeVO.setChildren(new ArrayList<>()); |
| | | rootNodes.add(nodeVO); |
| | |
| | | } |
| | | List<Integer> handledIds = new ArrayList<>(); |
| | | for (SystemMenu menu : menus) { |
| | | if(!Constants.equalsInteger(menu.getType(),Constants.ZERO)){ |
| | | continue; |
| | | } |
| | | if (parent.getId().equals(menu.getParentId())) { |
| | | SystemMenuListVO child = new SystemMenuListVO(); |
| | | BeanUtils.copyProperties(menu, child, "children"); |
| | |
| | | } |
| | | List<Integer> handledIds = new ArrayList<>(); |
| | | for (SystemMenu menu : menus) { |
| | | if(!Constants.equalsInteger(menu.getType(),Constants.ZERO)){ |
| | | continue; |
| | | } |
| | | if (parent.getId().equals(menu.getParentId())) { |
| | | SystemMenuNodeVO child = new SystemMenuNodeVO(); |
| | | child.setId(menu.getId()); |
| | |
| | | child.setUrl(menu.getPath()); |
| | | child.setParams(menu.getParams()); |
| | | child.setIcon(menu.getIcon()); |
| | | child.setType(menu.getType()); |
| | | child.setIndex("menu_" + menu.getId()); |
| | | child.setChildren(new ArrayList<>()); |
| | | parent.getChildren().add(child); |