组织人员树

This commit is contained in:
sxu 2024-11-01 16:02:30 +08:00
parent d7dc110807
commit e76258defb
3 changed files with 10 additions and 9 deletions

View File

@ -450,13 +450,13 @@ public class SysUserController extends BaseController {
}
/**
* 根据角色列表获取部门人员树列表
* 查询部门人员树列表
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:user:list"))
@PostMapping("/deptUserTree")
public AjaxResult deptUserTree(@RequestBody SysUser sysUser) {
try {
return success(deptService.selectDeptUserTree(sysUser.getRoleIds()));
return success(deptService.selectDeptUserTree(sysUser));
} catch (Exception e) {
logger.error(e.toString(), e);
}

View File

@ -2,6 +2,7 @@ package com.bonus.system.service;
import java.util.List;
import com.bonus.system.api.domain.SysDept;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.domain.vo.TreeSelect;
/**
@ -28,12 +29,12 @@ public interface ISysDeptService
public List<TreeSelect> selectDeptTreeList(SysDept dept);
/**
* 根据角色列表查询部门人员树结构信息
* 查询部门人员树列表
*
* @param roleIds 角色列表
* @param sysUser 用户对象
* @return 部门树信息集合
*/
public List<TreeSelect> selectDeptUserTree(Long[] roleIds);
public List<TreeSelect> selectDeptUserTree(SysUser sysUser);
/**
* 构建前端所需要树结构

View File

@ -76,16 +76,16 @@ public class SysDeptServiceImpl implements ISysDeptService
}
/**
* 根据角色列表查询部门人员树结构信息
* 查询部门人员树列表
*
* @param roleIds 角色列表
* @param sysUser 用户对象
* @return 部门树信息集合
*/
@Override
@DataScope(deptAlias = "d")
public List<TreeSelect> selectDeptUserTree(Long[] roleIds)
public List<TreeSelect> selectDeptUserTree(SysUser sysUser)
{
List<SysDept> depts = deptMapper.selectDeptUserList(roleIds);
List<SysDept> depts = deptMapper.selectDeptUserList(sysUser.getRoleIds());
return buildDeptTreeSelect(depts);
}