| | |
| | | public class MenuService extends BaseServiceImpl<MenuMapper, Menu> { |
| | | |
| | | private final RoleMenuRelationService roleMenuRelationService; |
| | | |
| | | /** |
| | | * 获取角色下的菜单 |
| | | */ |
| | |
| | | .map(menu -> covertMenuNode(menu, list)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | private MenuMapper menuMapper; |
| | | |
| | | public boolean delMenu(Long menuId) { |
| | | Menu one = getById(menuId); |
| | | if (one == null) { |
| | |
| | | if(!RoleLevelStatus.SUPER.getCode().equals(roleLevel)){ |
| | | throw new BusinessException("超级管理员才可以删除菜单"); |
| | | } |
| | | List<Long> list = menuMapper.listMenuIfBinding(menuId); |
| | | if (list.size() == 0) { |
| | | return removeById(menuId); |
| | | }else{ |
| | | throw new BusinessException("菜单正在使用,请勿删除"); |
| | | } |
| | | |
| | | } |
| | | } |