|
@@ -131,6 +131,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
private ProductMapper productMapper;
|
|
private ProductMapper productMapper;
|
|
@Resource
|
|
@Resource
|
|
private ProdProcedureMapper prodProcedureMapper;
|
|
private ProdProcedureMapper prodProcedureMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private LeaveSheetService leaveSheetService;
|
|
|
|
|
|
@Value(value = "${upload.path}")
|
|
@Value(value = "${upload.path}")
|
|
private String path;
|
|
private String path;
|
|
@@ -4114,6 +4116,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
personWorkHoursWagesList.addAll(totalList);
|
|
personWorkHoursWagesList.addAll(totalList);
|
|
//日期范围内所有分配数据
|
|
//日期范围内所有分配数据
|
|
List<ProdProcedureTeam> allProcedureTeamList = prodProcedureTeamMapper.selectList(new LambdaQueryWrapper<ProdProcedureTeam>().between(ProdProcedureTeam::getDistributeDate, startDate, endDate));
|
|
List<ProdProcedureTeam> allProcedureTeamList = prodProcedureTeamMapper.selectList(new LambdaQueryWrapper<ProdProcedureTeam>().between(ProdProcedureTeam::getDistributeDate, startDate, endDate));
|
|
|
|
+ //日期范围内所有请假数据
|
|
|
|
+ List<LeaveSheet> leaveSheetList = leaveSheetService.list(new LambdaQueryWrapper<LeaveSheet>().le(LeaveSheet::getStartDate, endDate).ge(LeaveSheet::getEndDate, startDate));
|
|
//日期范围内所有派工数据
|
|
//日期范围内所有派工数据
|
|
List<Integer> ids = allProcedureTeamList.stream().map(ProdProcedureTeam::getPlanProcedureId).distinct().collect(Collectors.toList());
|
|
List<Integer> ids = allProcedureTeamList.stream().map(ProdProcedureTeam::getPlanProcedureId).distinct().collect(Collectors.toList());
|
|
List<PlanProcedureTotal> planProcedureTotalList = planProcedureTotalMapper.selectList(new LambdaQueryWrapper<PlanProcedureTotal>().in(PlanProcedureTotal::getId, ids));
|
|
List<PlanProcedureTotal> planProcedureTotalList = planProcedureTotalMapper.selectList(new LambdaQueryWrapper<PlanProcedureTotal>().in(PlanProcedureTotal::getId, ids));
|
|
@@ -4168,6 +4172,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
|
|
+ //不存在报工数据显示请假详情数据
|
|
|
|
+ boolean match = leaveSheetList.stream().anyMatch(l ->
|
|
|
|
+ (l.getStartDate().isBefore(LocalDate.parse(date, dtf1)) || l.getStartDate().isEqual(LocalDate.parse(date, dtf1)))
|
|
|
|
+ &&
|
|
|
|
+ (l.getEndDate().isAfter(LocalDate.parse(date, dtf1)) || l.getEndDate().isEqual(LocalDate.parse(date, dtf1))) && l.getOwnerId().equals(u.getId()));
|
|
|
|
+ if(match){
|
|
|
|
+ map.put("leave","当天请假");
|
|
|
|
+ }
|
|
map.put("crateDate", date);
|
|
map.put("crateDate", date);
|
|
map.put("cost", 0);
|
|
map.put("cost", 0);
|
|
map.put("workTime", 0);
|
|
map.put("workTime", 0);
|
|
@@ -4285,12 +4297,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
List<Integer> deptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
|
|
List<Integer> deptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
|
|
List<Integer> otherDeptIds = departmentOtherManagers.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
|
|
List<Integer> otherDeptIds = departmentOtherManagers.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
|
|
deptIds.addAll(otherDeptIds);
|
|
deptIds.addAll(otherDeptIds);
|
|
|
|
+ //日期范围内所有请假数据
|
|
|
|
+ List<LeaveSheet> leaveSheetList = leaveSheetService.list(new LambdaQueryWrapper<LeaveSheet>().le(LeaveSheet::getStartDate, endDate).ge(LeaveSheet::getEndDate, startDate).eq(LeaveSheet::getOwnerId,userId));
|
|
List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetail(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetail(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
HashMap map=new HashMap();
|
|
HashMap map=new HashMap();
|
|
map.put("record",mapList);
|
|
map.put("record",mapList);
|
|
- map.put("totalWorkingTime",mapList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
|
|
- map.put("totalCost",mapList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
|
|
|
|
+ map.put("totalWorkingTime",mapList.stream().filter(i->i.get("working_time")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
|
|
+ map.put("totalCost",mapList.stream().filter(i->i.get("cost")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
if(checkStatus!=null && detailStatus==null){
|
|
if(checkStatus!=null && detailStatus==null){
|
|
mapList=reportMapper.getPersonWorkHoursWagesDetail(date,user.getId(),user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
mapList=reportMapper.getPersonWorkHoursWagesDetail(date,user.getId(),user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
@@ -4359,13 +4373,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
item.put("subDataList",theData);
|
|
item.put("subDataList",theData);
|
|
- item.put("working_time",list.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
|
|
- item.put("cost",list.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
|
|
|
|
+ item.put("working_time",list.stream().filter(i->i.get("working_time")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
|
|
+ item.put("cost",list.stream().filter(i->i.get("cost")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
resultList.add(item);
|
|
resultList.add(item);
|
|
}
|
|
}
|
|
map.put("record",resultList);
|
|
map.put("record",resultList);
|
|
- map.put("totalWorkingTime",resultList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
|
|
- map.put("totalCost",resultList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
|
|
|
|
+ map.put("totalWorkingTime",resultList.stream().filter(i->i.get("working_time")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
|
|
+ map.put("totalCost",resultList.stream().filter(i->i.get("cost")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
}
|
|
}
|
|
httpRespMsg.setData(map);
|
|
httpRespMsg.setData(map);
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|