mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
新增查询部门所有用户
This commit is contained in:
parent
743ebc77d6
commit
ce64d5a5c1
@ -6,6 +6,7 @@ import cn.hutool.core.lang.tree.Tree;
|
|||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.UserConstants;
|
import org.dromara.common.core.constant.UserConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
@ -265,4 +266,12 @@ public class SysUserController extends BaseController {
|
|||||||
return R.ok(deptService.selectDeptTreeList(dept));
|
return R.ok(deptService.selectDeptTreeList(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门下的所有用户信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:user:list")
|
||||||
|
@GetMapping("/list/dept/{deptId}")
|
||||||
|
public R<List<SysUserVo>> listByDept(@PathVariable @NotNull Long deptId) {
|
||||||
|
return R.ok(userService.selectUserListByDept(deptId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,4 +202,11 @@ public interface ISysUserService {
|
|||||||
*/
|
*/
|
||||||
int deleteUserByIds(Long[] userIds);
|
int deleteUserByIds(Long[] userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过部门id查询当前部门所有用户
|
||||||
|
*
|
||||||
|
* @param deptId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysUserVo> selectUserListByDept(Long deptId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -513,6 +513,19 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过部门id查询当前部门所有用户
|
||||||
|
*
|
||||||
|
* @param deptId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysUserVo> selectUserListByDept(Long deptId) {
|
||||||
|
SysUserBo sysUserBo = new SysUserBo();
|
||||||
|
sysUserBo.setDeptId(deptId);
|
||||||
|
return baseMapper.selectUserList(this.buildQueryWrapper(sysUserBo));
|
||||||
|
}
|
||||||
|
|
||||||
@Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId")
|
@Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId")
|
||||||
@Override
|
@Override
|
||||||
public String selectUserNameById(Long userId) {
|
public String selectUserNameById(Long userId) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user