|
@@ -7258,17 +7258,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private List<Department> getSubDepts(Department dp, List<Department> list) {
|
|
|
- List<Department> collect = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());
|
|
|
- List<Department> allList = new ArrayList<>();
|
|
|
- allList.addAll(collect);
|
|
|
- if (collect.size() > 0) {
|
|
|
- collect.forEach(c->{
|
|
|
- allList.addAll(getSubDepts(c, list));
|
|
|
- });
|
|
|
- }
|
|
|
- return allList;
|
|
|
- }
|
|
|
private List<LocalDateTime> getDays(LocalDateTime start, LocalDateTime end) {
|
|
|
List<LocalDateTime> result = new ArrayList();
|
|
|
while (start.isBefore(end)) {
|
|
@@ -7502,6 +7491,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ //递归获取所有子部门
|
|
|
+ private List<Department> getSubDepts(Department dp, List<Department> list) {
|
|
|
+ List<Department> collect = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());;
|
|
|
+ List<Department> allList = new ArrayList<>();
|
|
|
+ allList.addAll(collect);
|
|
|
+ if (collect.size() > 0) {
|
|
|
+ collect.forEach(c->{
|
|
|
+ allList.addAll(getSubDepts(c,list));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return allList;
|
|
|
+ }
|
|
|
+
|
|
|
//部门参与项目情况表
|
|
|
@Override
|
|
|
public HttpRespMsg deptPartInProjects(Integer pageIndex, Integer pageSize, String startDate,String endDate, Integer departmentId, HttpServletRequest request){
|
|
@@ -7559,15 +7561,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}else {
|
|
|
stringObjectMap.put("deptName",getSupDepartment(department));
|
|
|
}
|
|
|
- if (stringObjectMap.get("projectCount")==null){
|
|
|
- stringObjectMap.put("projectCount",0);
|
|
|
- }
|
|
|
- if (stringObjectMap.get("tripCount")==null){
|
|
|
- stringObjectMap.put("tripCount",0);
|
|
|
- }
|
|
|
- if (stringObjectMap.get("peopleCount")==null){
|
|
|
- stringObjectMap.put("peopleCount",0);
|
|
|
- }
|
|
|
+ stringObjectMap.put("projectCount",stringObjectMap.get("projectCount")==null?0:stringObjectMap.get("projectCount"));
|
|
|
+ stringObjectMap.put("tripCount",stringObjectMap.get("tripCount")==null?0:stringObjectMap.get("tripCount"));
|
|
|
+ stringObjectMap.put("peopleCount",stringObjectMap.get("peopleCount")==null?0:stringObjectMap.get("peopleCount"));
|
|
|
}
|
|
|
}
|
|
|
HashMap<String, Object> result = new HashMap<>();
|