diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java index d769b52..c7a7f05 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java @@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.framework.shiro.util.AuthorizationUtils; +import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; @@ -99,8 +100,8 @@ public class SysUserExamineController extends BaseController { { List roles = roleService.selectRolesByUserId(userId); mmap.put("user",userService.selectUserById(userId)); - mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); - mmap.put("posts", postService.selectPostsByUserId(userId)); + mmap.put("roles", roleService.selectRolesByUserIds(userId)); + mmap.put("posts", postService.selectPostsByUserIds(userId)); return prefix + "/examineprint"; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java index 7f2a189..8c4f8dd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -33,6 +33,8 @@ public interface ISysPostService */ public List selectPostsByUserId(Long userId); + List selectPostsByUserIds(Long userId); + /** * 通过岗位ID查询岗位信息 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java index 76d1bb5..a97ed35 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -36,6 +36,8 @@ public interface ISysRoleService */ public List selectRolesByUserId(Long userId); + List selectRolesByUserIds(Long userId); + /** * 查询所有角色 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index 41a5e71..0bf8966 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -74,6 +74,20 @@ public class SysPostServiceImpl implements ISysPostService return posts; } + /** + * 根据用户ID查询岗位 + * + * @param userId 用户ID + * @return 岗位列表 + */ + @Override + public List selectPostsByUserIds(Long userId) + { + List userPosts = postMapper.selectPostsByUserId(userId); + return userPosts; + } + + /** * 通过岗位ID查询岗位信息 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index bf7335e..ef5fc15 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -105,6 +105,19 @@ public class SysRoleServiceImpl implements ISysRoleService return roles; } + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + @Override + public List selectRolesByUserIds(Long userId) + { + List userRoles = roleMapper.selectRolesByUserId(userId); + return userRoles; + } + /** * 查询所有角色 *