diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java index eef0a1af..d68c66f0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; +import org.dromara.common.core.constant.UserConstants; import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.utils.MapstructUtils; @@ -22,6 +23,8 @@ import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.common.web.core.BaseController; import org.dromara.system.domain.bo.SysDeptBo; +import org.dromara.system.domain.bo.SysPostBo; +import org.dromara.system.domain.bo.SysRoleBo; import org.dromara.system.domain.bo.SysUserBo; import org.dromara.system.domain.vo.*; import org.dromara.system.listener.SysUserImportListener; @@ -124,9 +127,13 @@ public class SysUserController extends BaseController { public R getInfo(@PathVariable(value = "userId", required = false) Long userId) { userService.checkUserDataScope(userId); SysUserInfoVo userInfoVo = new SysUserInfoVo(); - List roles = roleService.selectRoleAll(); + SysRoleBo roleBo = new SysRoleBo(); + roleBo.setStatus(UserConstants.ROLE_NORMAL); + SysPostBo postBo = new SysPostBo(); + postBo.setStatus(UserConstants.POST_NORMAL); + List roles = roleService.selectRoleList(roleBo); userInfoVo.setRoles(LoginHelper.isSuperAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isSuperAdmin())); - userInfoVo.setPosts(postService.selectPostAll()); + userInfoVo.setPosts(postService.selectPostList(postBo)); if (ObjectUtil.isNotNull(userId)) { SysUserVo sysUser = userService.selectUserById(userId); userInfoVo.setUser(sysUser); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java index 874f634b..208fe4e0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java @@ -69,6 +69,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { */ @Override public List> selectDeptTreeList(SysDeptBo bo) { + // 只查询未禁用部门 + bo.setStatus(UserConstants.DEPT_NORMAL); LambdaQueryWrapper lqw = buildQueryWrapper(bo); List depts = baseMapper.selectDeptList(lqw); return buildDeptTreeSelect(depts);