| | |
| | | |
| | | private final IRoleMenuService roleMenuService; |
| | | private final IRoleScopeService roleScopeService; |
| | | private final MenuMapper menuMapper; |
| | | private final ITopMenuSettingService topMenuSettingService; |
| | | private final static String PARENT_ID = "parentId"; |
| | | private final static Integer MENU_CATEGORY = 1; |
| | |
| | | return baseMapper.lazyMenuPage(parentId, param, Condition.getPage(query)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<MenuVO> routes(String roleId, Long topMenuId) { |
| | | if (StringUtil.isBlank(roleId)) { |
| | |
| | | roleMenus = allMenus; |
| | | } |
| | | // 非超级管理员并且不是顶部菜单请求则返回对应角色权限菜单 |
| | | else if (!AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) { |
| | | else if (!VciBaseUtil.checkAdminTenant() && Func.isEmpty(topMenuId)) { |
| | | roleMenus = tenantPackageMenu(baseMapper.roleMenuByRoleId(Func.toLongList(roleId))); |
| | | } |
| | | // 顶部菜单请求返回对应角色权限菜单 |
| | |
| | | LambdaQueryWrapper<Menu> wrapper = Wrappers.<Menu>query() |
| | | .lambda() |
| | | .in(Menu::getCode, codes) |
| | | .eq(Menu::getIsDeleted,0) /*未被删除*/ |
| | | .eq(Menu::getIsDeleted,BladeConstant.DB_NOT_DELETED) /*未被删除*/ |
| | | .eq(Menu::getCategory,1) /*菜单类型不能为按钮*/ |
| | | .orderByAsc(Menu::getCode); /*根据code排序与classify的btmtypeid对应*/ |
| | | // 超管不用根据角色来查询 |
| | |
| | | } |
| | | } |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 根据父级菜单的code查询按钮信息 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Menu> getButtonByParentCode(String code) { |
| | | List<Menu> buttonList = menuMapper.getButtonByParentCode(code); |
| | | return buttonList; |
| | | } |
| | | |
| | | /** |
| | |
| | | return this.saveBatch(newButtons) ? R.success("按钮克隆成功!"):R.fail("按钮克隆失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 根据主键获取菜单信息 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Menu> getMenuListById(List<String> ids,String parentId) { |
| | | LambdaQueryWrapper<Menu> wrapper = Wrappers.<Menu>query() |
| | | .lambda().eq(Menu::getCategory, "2") |
| | | .eq(Menu::getIsDeleted,BladeConstant.DB_NOT_DELETED); |
| | | if(VciBaseUtil.checkAdminTenant()){ |
| | | wrapper.eq(Menu::getParentId,parentId); |
| | | }else { |
| | | wrapper.in(Menu::getId, ids); |
| | | } |
| | | List<Menu> menuList = this.list(wrapper); |
| | | return menuList; |
| | | } |
| | | |
| | | } |