|
@@ -157,6 +157,9 @@ public class IotProjectInfoServiceImpl implements IotProjectInfoService {
|
|
|
departmentIds.add(dept.getId());
|
|
departmentIds.add(dept.getId());
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ // 查询当前登录人所属的项目部 根据项目部查询 对应的 合同信息 暂时只对瑞恒
|
|
|
|
|
+ Set<Long> rhProjectDeptIds = projectLevelDepts();
|
|
|
|
|
+ pageReqVO.setProjectDeptIds(rhProjectDeptIds);
|
|
|
return iotProjectInfoMapper.selectPage1(pageReqVO, departmentIds);
|
|
return iotProjectInfoMapper.selectPage1(pageReqVO, departmentIds);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -259,9 +262,62 @@ public class IotProjectInfoServiceImpl implements IotProjectInfoService {
|
|
|
DeptDO dept = deptMapper.selectById(deptId);
|
|
DeptDO dept = deptMapper.selectById(deptId);
|
|
|
|
|
|
|
|
// 找到当前登录人所属部门及子部门
|
|
// 找到当前登录人所属部门及子部门
|
|
|
- Set<Long> allRhChildDeptIds = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
- allRhChildDeptIds.add(deptId);
|
|
|
|
|
- return allRhChildDeptIds;
|
|
|
|
|
|
|
+ Set<Long> allChildDeptIds = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
+ allChildDeptIds.add(deptId);
|
|
|
|
|
+ return allChildDeptIds;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Set<Long> projectLevelDepts() {
|
|
|
|
|
+ Set<Long> projectDeptIds = new HashSet<>();
|
|
|
|
|
+ // 查询当前登录人信息
|
|
|
|
|
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
|
|
+ AdminUserDO user = userMapper.selectById(userId);
|
|
|
|
|
+ Long deptId = user.getDeptId();
|
|
|
|
|
+ DeptDO dept = deptMapper.selectById(deptId);
|
|
|
|
|
+ // 查询瑞恒下所有部门 只有当前登录人所属部门属于瑞恒 才使用 数据权限过滤
|
|
|
|
|
+ Set<Long> allRhChildDeptIds = deptService.getChildDeptIdListFromCache(157l);
|
|
|
|
|
+ allRhChildDeptIds.add(157l);
|
|
|
|
|
+ // 只有瑞恒才需要此数据权限校验
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(dept) && allRhChildDeptIds.contains(deptId)) {
|
|
|
|
|
+ if ("2".equals(dept.getType())) {
|
|
|
|
|
+ // 当前登录人所属部门是 项目部
|
|
|
|
|
+ projectDeptIds.add(dept.getId());
|
|
|
|
|
+ } else if ("3".equals(dept.getType())) {
|
|
|
|
|
+ // 查询上级部门可能存在数据权限
|
|
|
|
|
+ DataPermissionUtils.executeIgnore(() -> {
|
|
|
|
|
+ // 当前登录人所属部门是 施工队伍 查询上级部门
|
|
|
|
|
+ DeptDO parentDept = deptMapper.selectById(dept.getParentId());
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(parentDept) && "2".equals(parentDept.getType())) {
|
|
|
|
|
+ projectDeptIds.add(parentDept.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if ("1".equals(dept.getType())) {
|
|
|
|
|
+ // 当前登录人所属部门是 专业公司 查询公司下所有 项目部类型的部门
|
|
|
|
|
+ List<DeptDO> allRhDepts =deptService.getDeptList(allRhChildDeptIds);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(allRhDepts)) {
|
|
|
|
|
+ allRhDepts.forEach(tempDept -> {
|
|
|
|
|
+ if ("2".equals(tempDept.getType())) {
|
|
|
|
|
+ projectDeptIds.add(tempDept.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 部门没有类型 则查询 下级部门是否存在 项目部类型 的部门 新疆分公司
|
|
|
|
|
+ Set<Long> allChildDeptIds = deptService.getChildDeptIdListFromCache(dept.getId());
|
|
|
|
|
+ if (CollUtil.isNotEmpty(allChildDeptIds)) {
|
|
|
|
|
+ List<DeptDO> allRhDepts = deptService.getDeptList(allChildDeptIds);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(allRhDepts)) {
|
|
|
|
|
+ allRhDepts.forEach(tempDept -> {
|
|
|
|
|
+ if ("2".equals(tempDept.getType())) {
|
|
|
|
|
+ projectDeptIds.add(tempDept.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return projectDeptIds;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|