| | |
| | | package com.qianwen.smartman.modules.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.enums.MenuCategoryEnum; |
| | | |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.secure.BladeUser; |
| | | import com.qianwen.core.secure.utils.AuthUtil; |
| | |
| | | import com.qianwen.core.tool.support.Kv; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.core.tool.utils.StringUtil; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.enums.MenuCategoryEnum; |
| | | import com.qianwen.smartman.modules.system.dto.MenuDTO; |
| | | import com.qianwen.smartman.modules.system.entity.Menu; |
| | | import com.qianwen.smartman.modules.system.entity.RoleMenu; |
| | |
| | | import com.qianwen.smartman.modules.system.service.ITopMenuSettingService; |
| | | import com.qianwen.smartman.modules.system.vo.MenuVO; |
| | | import com.qianwen.smartman.modules.system.wrapper.MenuWrapper; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/service/impl/MenuServiceImpl.class */ |
| | | public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService { |
| | | private static final String PARENT_ID = "parentId"; |
| | | private static final Integer MENU_CATEGORY = 1; |
| | |
| | | private final IRoleScopeService roleScopeService; |
| | | private final ITopMenuSettingService topMenuSettingService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1041904421: |
| | | if (implMethodName.equals("getParentId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -787052612: |
| | | if (implMethodName.equals("getScopeCategory")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -420196903: |
| | | if (implMethodName.equals("getTopMenuId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 770598695: |
| | | if (implMethodName.equals("getRoleId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1599557083: |
| | | if (implMethodName.equals("getBelongApplication")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 2128411252: |
| | | if (implMethodName.equals("getCategory")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getCategory(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getCategory(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/RoleMenu") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRoleId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/RoleScope") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRoleId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/RoleScope") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRoleId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/RoleScope") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getScopeCategory(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/RoleScope") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getScopeCategory(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getBelongApplication(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getBelongApplication(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/TopMenuSetting") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTopMenuId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Menu") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getParentId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public MenuServiceImpl(final IRoleMenuService roleMenuService, final IRoleScopeService roleScopeService, final ITopMenuSettingService topMenuSettingService) { |
| | | this.roleMenuService = roleMenuService; |
| | |
| | | recursion(allMenus, routes, roleMenu); |
| | | }); |
| | | List<Menu> topIdMenus = ((MenuMapper) this.baseMapper).roleMenuByTopMenuId(topMenuId); |
| | | roleMenus = (List) topIdMenus.stream().filter(x -> { |
| | | roleMenus = topIdMenus.stream().filter(x -> { |
| | | return routes.stream().anyMatch(route -> { |
| | | return route.getId().longValue() == x.getId().longValue(); |
| | | }); |
| | |
| | | return v0.getSort(); |
| | | })); |
| | | MenuWrapper menuWrapper = new MenuWrapper(); |
| | | List<Menu> collect = (List) routes.stream().filter(x -> { |
| | | List<Menu> collect = routes.stream().filter(x -> { |
| | | return Func.equals(x.getCategory(), Integer.valueOf(MenuCategoryEnum.APP.getStatus())) || Func.equals(x.getCategory(), Integer.valueOf(MenuCategoryEnum.MENU.getStatus())); |
| | | }).collect(Collectors.toList()); |
| | | return menuWrapper.listNodeVO(collect); |
| | |
| | | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public List<String> roleTreeKeys(String roleIds) { |
| | | List<RoleMenu> roleMenus = this.roleMenuService.list(Wrappers.<RoleMenu>query().lambda().in(RoleMenu::getRoleId, Func.toLongList(roleIds))); |
| | | /* |
| | | List<RoleMenu> roleMenus = this.roleMenuService.list((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getRoleId(); |
| | | }, Func.toLongList(roleIds))); |
| | | return (List) roleMenus.stream().map(roleMenu -> { |
| | | }, Func.toLongList(roleIds)));*/ |
| | | return roleMenus.stream().map(roleMenu -> { |
| | | return Func.toStr(roleMenu.getMenuId()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public List<String> topTreeKeys(String topMenuIds) { |
| | | List<TopMenuSetting> settings = this.topMenuSettingService.list(Wrappers.<TopMenuSetting>query().lambda().in(TopMenuSetting::getTopMenuId, Func.toLongList(topMenuIds))); |
| | | /* |
| | | List<TopMenuSetting> settings = this.topMenuSettingService.list((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getTopMenuId(); |
| | | }, Func.toLongList(topMenuIds))); |
| | | return (List) settings.stream().map(setting -> { |
| | | }, Func.toLongList(topMenuIds)));*/ |
| | | return settings.stream().map(setting -> { |
| | | return Func.toStr(setting.getMenuId()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public List<String> dataScopeTreeKeys(String roleIds) { |
| | | List<RoleScope> roleScopes = this.roleScopeService.list(Wrappers.<RoleScope>query().lambda().eq(RoleScope::getScopeCategory, CommonConstant.DATA_SCOPE_CATEGORY).in(RoleScope::getRoleId, Func.toLongList(roleIds))); |
| | | /* |
| | | List<RoleScope> roleScopes = this.roleScopeService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getScopeCategory(); |
| | | }, CommonConstant.DATA_SCOPE_CATEGORY)).in((v0) -> { |
| | | return v0.getRoleId(); |
| | | }, Func.toLongList(roleIds))); |
| | | return (List) roleScopes.stream().map(roleScope -> { |
| | | }, Func.toLongList(roleIds)));*/ |
| | | return roleScopes.stream().map(roleScope -> { |
| | | return Func.toStr(roleScope.getScopeId()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public List<String> apiScopeTreeKeys(String roleIds) { |
| | | List<RoleScope> roleScopes = this.roleScopeService.list(Wrappers.<RoleScope>query().lambda().eq(RoleScope::getScopeCategory, CommonConstant.API_SCOPE_CATEGORY).in(RoleScope::getRoleId, Func.toLongList(roleIds))); |
| | | /* |
| | | List<RoleScope> roleScopes = this.roleScopeService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getScopeCategory(); |
| | | }, CommonConstant.API_SCOPE_CATEGORY)).in((v0) -> { |
| | | return v0.getRoleId(); |
| | | }, Func.toLongList(roleIds))); |
| | | return (List) roleScopes.stream().map(roleScope -> { |
| | | }, Func.toLongList(roleIds)));*/ |
| | | return roleScopes.stream().map(roleScope -> { |
| | | return Func.toStr(roleScope.getScopeId()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | |
| | | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public boolean removeMenu(String ids) { |
| | | Long cnt = this.baseMapper.selectCount(Wrappers.<Menu>query().lambda().in(Menu::getParentId, Func.toLongList(ids))); |
| | | /* |
| | | Long cnt = ((MenuMapper) this.baseMapper).selectCount((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getParentId(); |
| | | }, Func.toLongList(ids))); |
| | | }, Func.toLongList(ids)));*/ |
| | | if (cnt.longValue() > 0) { |
| | | throw new ServiceException("请先删除子节点!"); |
| | | } |
| | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public boolean submit(Menu menu) { |
| | | Menu parentMenu; |
| | | Wrapper lambdaQuery = Wrappers.lambdaQuery(); |
| | | |
| | | LambdaQueryWrapper<Menu> menuQueryWrapper = Wrappers.lambdaQuery(); |
| | | |
| | | if (menu.getId() == null) { |
| | | menuQueryWrapper.eq(Menu::getCode, menu.getCode()) |
| | | .or(wrapper -> wrapper.eq(Menu::getName, menu.getName()).eq(Menu::getCategory, MENU_CATEGORY).eq(Menu::getBelongApplication, menu.getBelongApplication())); |
| | | /* |
| | | ((LambdaQueryWrapper) lambdaQuery.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, menu.getCode())).or(wrapper -> { |
| | |
| | | }, MENU_CATEGORY)).eq((v0) -> { |
| | | return v0.getBelongApplication(); |
| | | }, menu.getBelongApplication()); |
| | | }); |
| | | });*/ |
| | | } else { |
| | | ((LambdaQueryWrapper) lambdaQuery.ne((v0) -> { |
| | | return v0.getId(); |
| | | }, menu.getId())).and(wrapper2 -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) ((LambdaQueryWrapper) wrapper2.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, menu.getCode())).or(o -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper2 = (LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) o.eq((v0) -> { |
| | | return v0.getName(); |
| | | }, menu.getName())).eq((v0) -> { |
| | | return v0.getCategory(); |
| | | }, MENU_CATEGORY)).eq((v0) -> { |
| | | return v0.getBelongApplication(); |
| | | }, menu.getBelongApplication()); |
| | | /*Menu::getBelongApplication |
| | | menuQueryWrapper.ne(Menu::getId, menu.getId()) |
| | | .and(wrapper -> wrapper.eq(Menu::getCode, menu.getCode()).or(());*/ |
| | | |
| | | menuQueryWrapper.ne(Menu::getId, menu.getId()) |
| | | .and(wrapper2 -> { |
| | | wrapper2.eq(Menu::getCode, menu.getCode()).or(o -> { |
| | | o.eq(Menu::getName, menu.getName()) |
| | | .eq(Menu::getCategory, MENU_CATEGORY).eq(Menu::getBelongApplication, menu.getBelongApplication()); |
| | | }); |
| | | }); |
| | | } |
| | | Long cnt = ((MenuMapper) this.baseMapper).selectCount(lambdaQuery); |
| | | Long cnt = this.baseMapper.selectCount(menuQueryWrapper); |
| | | if (cnt.longValue() > 0) { |
| | | throw new ServiceException("菜单不能保存。限制条件:菜单编号不可重复;同一个应用下不可以出现同名菜单!"); |
| | | } |
| | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public List<String> getRoleMenuByCondition(String roleIds, List<Integer> categoryList) { |
| | | List<String> list = new ArrayList<>(); |
| | | List<MenuVO> menuVOList = ((MenuMapper) this.baseMapper).getRoleMenuByCondition((List) Arrays.stream(roleIds.split(",")).collect(Collectors.toList()), categoryList); |
| | | List<MenuVO> menuVOList = this.baseMapper.getRoleMenuByCondition(Arrays.stream(roleIds.split(",")).collect(Collectors.toList()), categoryList); |
| | | if (Func.isNotEmpty(menuVOList)) { |
| | | list = (List) menuVOList.stream().map(menuVO -> { |
| | | list = menuVOList.stream().map(menuVO -> { |
| | | return Func.toStr(menuVO.getId()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | |
| | | |
| | | @Override // org.springblade.modules.system.service.IMenuService |
| | | public List<MenuVO> grantTreeCard(BladeUser user, List<Integer> categoryList) { |
| | | List<MenuVO> roleMenus; |
| | | new ArrayList(); |
| | | List<MenuVO> roleMenus = new ArrayList<>(); |
| | | |
| | | if (AuthUtil.isAdministrator()) { |
| | | roleMenus = ForestNodeMerger.merge(((MenuMapper) this.baseMapper).grantTreeByCategory(categoryList)); |
| | | roleMenus = ForestNodeMerger.merge(this.baseMapper.grantTreeByCategory(categoryList)); |
| | | } else { |
| | | roleMenus = ForestNodeMerger.merge(((MenuMapper) this.baseMapper).getRoleMenuCardByCondition(Func.toStrList(user.getRoleId()), categoryList)); |
| | | roleMenus = ForestNodeMerger.merge(this.baseMapper.getRoleMenuCardByCondition(Func.toStrList(user.getRoleId()), categoryList)); |
| | | } |
| | | return roleMenus; |
| | | } |