mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 用户管理 只查询未禁用的部门角色岗位数据
This commit is contained in:
		@@ -21,6 +21,7 @@ import com.ruoyi.common.helper.LoginHelper;
 | 
			
		||||
import com.ruoyi.common.utils.StreamUtils;
 | 
			
		||||
import com.ruoyi.common.utils.StringUtils;
 | 
			
		||||
import com.ruoyi.common.utils.poi.ExcelUtil;
 | 
			
		||||
import com.ruoyi.system.domain.SysPost;
 | 
			
		||||
import com.ruoyi.system.domain.vo.SysUserExportVo;
 | 
			
		||||
import com.ruoyi.system.domain.vo.SysUserImportVo;
 | 
			
		||||
import com.ruoyi.system.listener.SysUserImportListener;
 | 
			
		||||
@@ -117,9 +118,13 @@ public class SysUserController extends BaseController {
 | 
			
		||||
    public R<Map<String, Object>> getInfo(@PathVariable(value = "userId", required = false) Long userId) {
 | 
			
		||||
        userService.checkUserDataScope(userId);
 | 
			
		||||
        Map<String, Object> ajax = new HashMap<>();
 | 
			
		||||
        List<SysRole> roles = roleService.selectRoleAll();
 | 
			
		||||
        SysRole role = new SysRole();
 | 
			
		||||
        role.setStatus(UserConstants.ROLE_NORMAL);
 | 
			
		||||
        SysPost post = new SysPost();
 | 
			
		||||
        post.setStatus(UserConstants.POST_NORMAL);
 | 
			
		||||
        List<SysRole> roles = roleService.selectRoleList(role);
 | 
			
		||||
        ajax.put("roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin()));
 | 
			
		||||
        ajax.put("posts", postService.selectPostAll());
 | 
			
		||||
        ajax.put("posts", postService.selectPostList(post));
 | 
			
		||||
        if (ObjectUtil.isNotNull(userId)) {
 | 
			
		||||
            SysUser sysUser = userService.selectUserById(userId);
 | 
			
		||||
            ajax.put("user", sysUser);
 | 
			
		||||
 
 | 
			
		||||
@@ -72,6 +72,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<Tree<Long>> selectDeptTreeList(SysDept dept) {
 | 
			
		||||
        // 只查询未禁用部门
 | 
			
		||||
        dept.setStatus(UserConstants.DEPT_NORMAL);
 | 
			
		||||
        List<SysDept> depts = this.selectDeptList(dept);
 | 
			
		||||
        return buildDeptTreeSelect(depts);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user