|
@@ -725,15 +725,21 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|
|
if (CollUtil.isEmpty(reqDeptIds)) {
|
|
if (CollUtil.isEmpty(reqDeptIds)) {
|
|
|
throw exception(DEPT_NOT_FOUND);
|
|
throw exception(DEPT_NOT_FOUND);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 需要查询的公司id 任务所属公司id
|
|
|
|
|
+ Long deptId = reqVO.getDeptId();
|
|
|
Long randomDeptId = reqDeptIds.get(0);
|
|
Long randomDeptId = reqDeptIds.get(0);
|
|
|
DeptListReqVO deptListReqVO = new DeptListReqVO();
|
|
DeptListReqVO deptListReqVO = new DeptListReqVO();
|
|
|
deptListReqVO.setDeptIds(reqVO.getDeptIds());
|
|
deptListReqVO.setDeptIds(reqVO.getDeptIds());
|
|
|
List<Long> deptIds = new ArrayList<>();
|
|
List<Long> deptIds = new ArrayList<>();
|
|
|
// 瑞都施工队伍
|
|
// 瑞都施工队伍
|
|
|
List<Long> rdDeptIds = new ArrayList<>();
|
|
List<Long> rdDeptIds = new ArrayList<>();
|
|
|
- // 查询 瑞都下的所有 部门
|
|
|
|
|
- Set<Long> childDeptIds = deptService.getChildDeptIdListFromCache(163l);
|
|
|
|
|
- childDeptIds.add(163l);
|
|
|
|
|
|
|
+ // 查询 瑞都 or 5#公司 下的所有 部门
|
|
|
|
|
+ Set<Long> childDeptIds = new HashSet<>();
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(deptId) && (deptId == 163l || deptId == 388l)) {
|
|
|
|
|
+ Set<Long> tempChildDeptIds = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
+ childDeptIds.addAll(tempChildDeptIds);
|
|
|
|
|
+ childDeptIds.add(deptId);
|
|
|
|
|
+ }
|
|
|
if (childDeptIds.contains(randomDeptId)) {
|
|
if (childDeptIds.contains(randomDeptId)) {
|
|
|
// 瑞都下的部门 队伍 施工队伍包含的用户显示到设备列表前面
|
|
// 瑞都下的部门 队伍 施工队伍包含的用户显示到设备列表前面
|
|
|
deptIds = new ArrayList<>(childDeptIds);
|
|
deptIds = new ArrayList<>(childDeptIds);
|
|
@@ -751,10 +757,10 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|
|
resultUsers.set(users);
|
|
resultUsers.set(users);
|
|
|
}
|
|
}
|
|
|
if (childDeptIds.contains(randomDeptId)) {
|
|
if (childDeptIds.contains(randomDeptId)) {
|
|
|
- // 如果是瑞都任务 施工队伍包含的用户显示到设备列表前面
|
|
|
|
|
|
|
+ // 如果是 瑞都 or 5#公司 任务 施工队伍包含的用户显示到设备列表前面
|
|
|
List<AdminUserDO> rdUsers = userMapper.selectSimpleList(finalRdDeptIds);
|
|
List<AdminUserDO> rdUsers = userMapper.selectSimpleList(finalRdDeptIds);
|
|
|
if (CollUtil.isNotEmpty(users) && CollUtil.isNotEmpty(rdUsers)) {
|
|
if (CollUtil.isNotEmpty(users) && CollUtil.isNotEmpty(rdUsers)) {
|
|
|
- // 提取rdUsers的id集合(快速判断)
|
|
|
|
|
|
|
+ // 提取 rdUsers 的 id 集合(快速判断)
|
|
|
Set<Long> rdUserIds = rdUsers.stream()
|
|
Set<Long> rdUserIds = rdUsers.stream()
|
|
|
.map(AdminUserDO::getId)
|
|
.map(AdminUserDO::getId)
|
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|