|
@@ -669,6 +669,35 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|
|
return resultUsers.get();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<AdminUserDO> selectedDeptsEmployee(UserPageReqVO reqVO) {
|
|
|
+ AtomicReference<List<AdminUserDO>> resultUsers = new AtomicReference<>(new ArrayList<>());
|
|
|
+ if (CollUtil.isNotEmpty(reqVO.getUserIds())) {
|
|
|
+ // 如果传参中有 userIds 则不需要根据部门查询用户 直接查询指定 userIds 对应的用户即可
|
|
|
+ DataPermissionUtils.executeIgnore(() -> {
|
|
|
+ List<AdminUserDO> users = userMapper.selectList(reqVO);
|
|
|
+ resultUsers.set(users);
|
|
|
+ });
|
|
|
+ return resultUsers.get();
|
|
|
+ }
|
|
|
+ if (CollUtil.isEmpty(reqVO.getDeptIds())) {
|
|
|
+ throw exception(DEPT_NOT_FOUND);
|
|
|
+ }
|
|
|
+ DeptListReqVO deptListReqVO = new DeptListReqVO();
|
|
|
+ deptListReqVO.setDeptIds(reqVO.getDeptIds());
|
|
|
+ List<Long> deptIds = deptService.selectedDepts(deptListReqVO);
|
|
|
+ if (CollUtil.isNotEmpty(deptIds)) {
|
|
|
+ // 查询部门下所有人员
|
|
|
+ DataPermissionUtils.executeIgnore(() -> {
|
|
|
+ List<AdminUserDO> users = userMapper.selectSimpleList(deptIds);
|
|
|
+ if (CollUtil.isNotEmpty(users)) {
|
|
|
+ resultUsers.set(users);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return resultUsers.get();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 对密码进行加密
|
|
|
*
|