|
@@ -2459,23 +2459,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptRelatedProjectIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
deptRelatedProjectIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
- if(functionDpartList.size()>0){
|
|
|
|
- if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
|
- deptIds.addAll(allMyManagedDeptIds);
|
|
|
|
- }
|
|
|
|
- if (containDeptMembInchargeProjects && deptIds.size() > 1) {
|
|
|
|
- inchargeUserIds = userMapper.selectList(new QueryWrapper<User>().select("id").in("department_id", deptIds)).stream().map(User::getId).collect(Collectors.toList());
|
|
|
|
- }
|
|
|
|
|
|
+ //有限匹配项目经理的数据视角
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("incharger_id", targetUser.getId()));
|
|
|
|
+ if (projectList.size() > 0) {
|
|
|
|
+ projectIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
|
+ deptIds = null;
|
|
} else {
|
|
} else {
|
|
- //担任项目经理的项目
|
|
|
|
- List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("incharger_id", targetUser.getId()));
|
|
|
|
- if (projectList.size() > 0) {
|
|
|
|
- projectIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
|
- } else {
|
|
|
|
- projectIds = new ArrayList<>();
|
|
|
|
- projectIds.add(-1);
|
|
|
|
|
|
+ if(functionDpartList.size()>0){
|
|
|
|
+ if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
|
+ deptIds.addAll(allMyManagedDeptIds);
|
|
|
|
+ }
|
|
|
|
+ if (containDeptMembInchargeProjects && deptIds.size() > 1) {
|
|
|
|
+ inchargeUserIds = userMapper.selectList(new QueryWrapper<User>().select("id").in("department_id", deptIds)).stream().map(User::getId).collect(Collectors.toList());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- deptIds = null;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<String> userIdList=new ArrayList<>();
|
|
List<String> userIdList=new ArrayList<>();
|
|
@@ -8936,29 +8933,25 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if(functionAllList.size()==0){
|
|
if(functionAllList.size()==0){
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
- if(functionDpartList.size()>0){
|
|
|
|
- if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
|
- List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
- collect.addAll(otherCollect);
|
|
|
|
- for (Integer integer : collect) {
|
|
|
|
- List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
|
- deptIds.addAll(branchDepartment);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //担任项目经理的项目
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("incharger_id", targetUser.getId()));
|
|
|
|
+ if (projectList.size() > 0) {
|
|
|
|
+ projectIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
|
+ deptIds = null;
|
|
} else {
|
|
} else {
|
|
- //担任项目经理的项目
|
|
|
|
- List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("incharger_id", targetUser.getId()));
|
|
|
|
- if (projectList.size() > 0) {
|
|
|
|
- projectIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
|
- } else {
|
|
|
|
- projectIds = new ArrayList<>();
|
|
|
|
- projectIds.add(-1);
|
|
|
|
|
|
+ if(functionDpartList.size()>0){
|
|
|
|
+ if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ collect.addAll(otherCollect);
|
|
|
|
+ for (Integer integer : collect) {
|
|
|
|
+ List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
|
+ deptIds.addAll(branchDepartment);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- deptIds = null;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
|
List<String> userIdList=new ArrayList<>();
|
|
List<String> userIdList=new ArrayList<>();
|
|
if(userIds!=null&&userIds.length()>0){
|
|
if(userIds!=null&&userIds.length()>0){
|
|
String[] split = userIds.split(",");
|
|
String[] split = userIds.split(",");
|