From 49f20f7d9ff22087706223acae957a45819d0f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 18:02:11 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=20=E5=8F=AA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9C=AA=E7=A6=81=E7=94=A8=E7=9A=84=E9=83=A8=E9=97=A8=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=B2=97=E4=BD=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/system/SysUserController.java | 11 +++++++++-- .../system/service/impl/SysDeptServiceImpl.java | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) 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);