|
|
@@ -24,6 +24,7 @@ import com.sundot.airport.common.core.domain.ResetUserRoleDto;
|
|
24
|
24
|
import com.sundot.airport.common.core.domain.entity.SysDept;
|
|
25
|
25
|
import com.sundot.airport.common.core.domain.entity.SysDictData;
|
|
26
|
26
|
import com.sundot.airport.common.dto.SysUserConditionDto;
|
|
|
27
|
+import com.sundot.airport.common.dto.SysUserLeaderConditionDto;
|
|
27
|
28
|
import com.sundot.airport.common.dto.UserInfo;
|
|
28
|
29
|
import com.sundot.airport.common.enums.AssessmentTeamEnum;
|
|
29
|
30
|
import com.sundot.airport.common.enums.DeptType;
|
|
|
@@ -1249,4 +1250,43 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
1249
|
1250
|
public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByDepartmentId(Long departmentId) {
|
|
1250
|
1251
|
return userMapper.homePageUserInfoByDepartmentId(departmentId);
|
|
1251
|
1252
|
}
|
|
|
1253
|
+
|
|
|
1254
|
+ /**
|
|
|
1255
|
+ * 根据用户ID和角色编码列表查询各级直属领导列表
|
|
|
1256
|
+ *
|
|
|
1257
|
+ * @param dto 查询用户列表参数
|
|
|
1258
|
+ * @return 用户信息集合
|
|
|
1259
|
+ */
|
|
|
1260
|
+ @Override
|
|
|
1261
|
+ public List<SysUser> selectUserLeaderListByCondition(SysUserLeaderConditionDto dto) {
|
|
|
1262
|
+ if (dto.getUserId() == null) {
|
|
|
1263
|
+ return userMapper.selectUserListByRoleKey(dto.getRoleKeyList());
|
|
|
1264
|
+ }
|
|
|
1265
|
+ if (CollUtil.isEmpty(dto.getRoleKeyList())) {
|
|
|
1266
|
+ return Collections.emptyList();
|
|
|
1267
|
+ }
|
|
|
1268
|
+ List<SysUser> result = new ArrayList<>();
|
|
|
1269
|
+ SysUser sysUser = userMapper.selectUserById(dto.getUserId());
|
|
|
1270
|
+ List<SysDept> deptList = deptService.selectAllDept(sysUser.getDeptId());
|
|
|
1271
|
+ if (CollUtil.isEmpty(deptList)) {
|
|
|
1272
|
+ return result;
|
|
|
1273
|
+ }
|
|
|
1274
|
+ Collections.reverse(deptList);
|
|
|
1275
|
+ SysDept teams = deptList.stream().filter(x -> StrUtil.equals(DeptType.TEAMS.getCode(), x.getDeptType())).findFirst().orElse(new SysDept());
|
|
|
1276
|
+ SysDept department = deptList.stream().filter(x -> StrUtil.equals(DeptType.MANAGER.getCode(), x.getDeptType())).findFirst().orElse(new SysDept());
|
|
|
1277
|
+ SysDept brigade = deptList.stream().filter(x -> StrUtil.equals(DeptType.BRIGADE.getCode(), x.getDeptType())).findFirst().orElse(new SysDept());
|
|
|
1278
|
+ SysDept station = deptList.stream().filter(x -> StrUtil.equals(DeptType.STATION.getCode(), x.getDeptType())).findFirst().orElse(new SysDept());
|
|
|
1279
|
+ dto.getRoleKeyList().forEach(roleKey -> {
|
|
|
1280
|
+ if (StrUtil.equals(roleKey, RoleTypeEnum.banzuzhang.getCode())) {
|
|
|
1281
|
+ result.addAll(userMapper.selectUserLeaderByDeptIdAndRoleKeyList(teams.getDeptId(), Collections.singletonList(roleKey)));
|
|
|
1282
|
+ } else if (StrUtil.equals(roleKey, RoleTypeEnum.kezhang.getCode())) {
|
|
|
1283
|
+ result.addAll(userMapper.selectUserLeaderByDeptIdAndRoleKeyList(department.getDeptId(), Collections.singletonList(roleKey)));
|
|
|
1284
|
+ } else if (StrUtil.equals(roleKey, RoleTypeEnum.xingzheng.getCode()) || StrUtil.equals(roleKey, RoleTypeEnum.jingli.getCode())) {
|
|
|
1285
|
+ result.addAll(userMapper.selectUserLeaderByDeptIdAndRoleKeyList(brigade.getDeptId(), Collections.singletonList(roleKey)));
|
|
|
1286
|
+ } else if (StrUtil.equals(roleKey, RoleTypeEnum.test.getCode())) {
|
|
|
1287
|
+ result.addAll(userMapper.selectUserLeaderByDeptIdAndRoleKeyList(station.getDeptId(), Collections.singletonList(roleKey)));
|
|
|
1288
|
+ }
|
|
|
1289
|
+ });
|
|
|
1290
|
+ return result.stream().distinct().collect(Collectors.toList());
|
|
|
1291
|
+ }
|
|
1252
|
1292
|
}
|