|
@@ -11270,17 +11270,22 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
int dayCount = WorkDayCalculateUtils.getWorkDaysCountInRange(startDate, endDate, 0);//应报工时天数
|
|
int dayCount = WorkDayCalculateUtils.getWorkDaysCountInRange(startDate, endDate, 0);//应报工时天数
|
|
|
|
|
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", 936));
|
|
|
|
+
|
|
for (Department department : departments) {
|
|
for (Department department : departments) {
|
|
LaborHourRateVo laborHourRateVo = new LaborHourRateVo();
|
|
LaborHourRateVo laborHourRateVo = new LaborHourRateVo();
|
|
laborHourRateVo.setRoot_id(department.getDepartmentId());
|
|
laborHourRateVo.setRoot_id(department.getDepartmentId());
|
|
laborHourRateVo.setDepartment_name(department.getDepartmentName());
|
|
laborHourRateVo.setDepartment_name(department.getDepartmentName());
|
|
|
|
|
|
ArrayList<Integer> deptIds = new ArrayList<>();
|
|
ArrayList<Integer> deptIds = new ArrayList<>();
|
|
- setDeptIdList(department.getDepartmentId(),deptIds);
|
|
|
|
|
|
+
|
|
|
|
+// setDeptIdList(department.getDepartmentId(),deptIds);
|
|
|
|
+ setSubDepts(department,departmentList,deptIds);
|
|
deptIds.add(department.getDepartmentId());
|
|
deptIds.add(department.getDepartmentId());
|
|
laborHourRateVo.setChild_ids(deptIds);
|
|
laborHourRateVo.setChild_ids(deptIds);
|
|
//查询该公司下某头部部门及子部门在四种项目下的工时之和,某个时间段内
|
|
//查询该公司下某头部部门及子部门在四种项目下的工时之和,某个时间段内
|
|
List<Report> reportList= reportMapper.getSumWorkingTime(deptIds,startDate,endDate);
|
|
List<Report> reportList= reportMapper.getSumWorkingTime(deptIds,startDate,endDate);
|
|
|
|
+
|
|
ArrayList<Report> reports = new ArrayList<>();//按时填报的report
|
|
ArrayList<Report> reports = new ArrayList<>();//按时填报的report
|
|
for (Report report : reportList) {
|
|
for (Report report : reportList) {
|
|
LocalDate createDate = report.getCreateDate();
|
|
LocalDate createDate = report.getCreateDate();
|
|
@@ -11322,8 +11327,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
laborHourRateVo.setDate_count(dayCount);
|
|
laborHourRateVo.setDate_count(dayCount);
|
|
laborHourRateVo.setCount(isActiveCount);
|
|
laborHourRateVo.setCount(isActiveCount);
|
|
laborHourRateVo.setTotal_time((long) (8*inActiveDays+isActiveCount*8*dayCount));//应报工时还少了在职的加上可能辞职的
|
|
laborHourRateVo.setTotal_time((long) (8*inActiveDays+isActiveCount*8*dayCount));//应报工时还少了在职的加上可能辞职的
|
|
- System.out.println("============="+inActiveDays);
|
|
|
|
- System.out.println("============="+isActiveCount);
|
|
|
|
|
|
+// System.out.println("============="+inActiveDays);
|
|
|
|
+// System.out.println("============="+isActiveCount);
|
|
laborHourRateVo.setDay_time(8);
|
|
laborHourRateVo.setDay_time(8);
|
|
|
|
|
|
BigDecimal bd = new BigDecimal(timeSum/(8*inActiveDays+isActiveCount*8*dayCount)*100);
|
|
BigDecimal bd = new BigDecimal(timeSum/(8*inActiveDays+isActiveCount*8*dayCount)*100);
|
|
@@ -11355,16 +11360,27 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public void setDeptIdList(Integer departmentId,List<Integer> deptIds){
|
|
|
|
- LambdaQueryWrapper<Department> lqw = new LambdaQueryWrapper<>();
|
|
|
|
- lqw.eq(Department::getSuperiorId,departmentId);
|
|
|
|
- List<Department> departmentList = departmentMapper.selectList(lqw);
|
|
|
|
|
|
+// public void setDeptIdList(Integer departmentId,List<Integer> deptIds){
|
|
|
|
+// LambdaQueryWrapper<Department> lqw = new LambdaQueryWrapper<>();
|
|
|
|
+// lqw.eq(Department::getSuperiorId,departmentId);
|
|
|
|
+// List<Department> departmentList = departmentMapper.selectList(lqw);
|
|
|
|
+//
|
|
|
|
+// if (departmentList!=null&&departmentList.size()>0){
|
|
|
|
+// List<Integer> collect = departmentList.stream().map(Department::getDepartmentId).collect(Collectors.toList());
|
|
|
|
+// deptIds.addAll(collect);
|
|
|
|
+// for (Integer id : collect) {
|
|
|
|
+// setDeptIdList(id,deptIds);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
- if (departmentList!=null&&departmentList.size()>0){
|
|
|
|
|
|
+ public void setSubDepts(Department dp, List<Department> list,List<Integer> deptIds) {
|
|
|
|
+ List<Department> departmentList = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());;
|
|
|
|
+ if (departmentList.size() > 0) {
|
|
List<Integer> collect = departmentList.stream().map(Department::getDepartmentId).collect(Collectors.toList());
|
|
List<Integer> collect = departmentList.stream().map(Department::getDepartmentId).collect(Collectors.toList());
|
|
deptIds.addAll(collect);
|
|
deptIds.addAll(collect);
|
|
- for (Integer id : collect) {
|
|
|
|
- setDeptIdList(id,deptIds);
|
|
|
|
|
|
+ for (Department department : departmentList) {
|
|
|
|
+ setSubDepts(department,list,deptIds);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|