删除无用字段

This commit is contained in:
zhangchenbiao
2023-08-01 15:08:54 +08:00
parent 4d23b83490
commit ab3ccf47bf
9 changed files with 18 additions and 35 deletions

View File

@@ -35,8 +35,8 @@ public class MenuServiceImpl implements MenuService {
@Override
public List<MenuTreeVO> getUserMenus(String userId, String roleId) {
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
List<SysRoleMenuDO> roleMenuList = sysRoleMenuDAO.getRoleMenuByRoleId(roleId, PlatFormTypeEnum.PC.getCode());
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null);
List<SysRoleMenuDO> roleMenuList = sysRoleMenuDAO.getRoleMenuByRoleId(roleId);
List<Long> anthMenuIdList = menuList.stream().filter(o -> MenuTypeEnum.AUTH.getCode().equals(o.getMenuType())).map(SysMenuDO::getId).collect(Collectors.toList());
List<Long> roleMenuIdList = roleMenuList.stream().map(SysRoleMenuDO::getMenuId).filter(anthMenuIdList::contains).collect(Collectors.toList());
Set<Long> authMenuSet = new HashSet<>();
@@ -56,7 +56,7 @@ public class MenuServiceImpl implements MenuService {
@Override
public List<MenuAuthTreeVO> getAllMenus() {
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null);
return MenuAuthTreeVO.dealMenuTree(CommonConstants.ZERO_LONG, menuList);
}
@@ -67,7 +67,7 @@ public class MenuServiceImpl implements MenuService {
@Override
public Long deleteMenuAuth(Long id) {
List<SysMenuDO> menuList = sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
List<SysMenuDO> menuList = sysMenuDAO.selectMenuAll(null);
List<Long> idList = menuList.stream().map(SysMenuDO::getId).collect(Collectors.toList());
Map<Long, List<Long>> parentGroupMap = menuList.stream().collect(Collectors.groupingBy(SysMenuDO::getParentId, Collectors.mapping(SysMenuDO::getId, Collectors.toList())));
List<Long> allChildList = CommonNodeUtils.getAllChildListContainSelf(0L,id, idList, parentGroupMap);

View File

@@ -49,7 +49,7 @@ public class RoleServiceImpl implements RoleService {
if(Objects.isNull(roleDetail)){
return null;
}
List<SysRoleMenuDO> roleMenuAuths = sysRoleMenuDAO.getRoleMenuByRoleId(roleId, PlatFormTypeEnum.PC.getCode());
List<SysRoleMenuDO> roleMenuAuths = sysRoleMenuDAO.getRoleMenuByRoleId(roleId);
return RoleAuthInfoVO.convertVO(roleDetail, roleMenuAuths);
}