|
@@ -4043,10 +4043,27 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
IPage<User> userIPage = userMapper.selectPage(new Page<>(pageIndex, pageSize), queryWrapper);
|
|
IPage<User> userIPage = userMapper.selectPage(new Page<>(pageIndex, pageSize), queryWrapper);
|
|
List<User> userList = userIPage.getRecords();
|
|
List<User> userList = userIPage.getRecords();
|
|
|
|
+ User totalUser=new User();
|
|
|
|
+ totalUser.setId("0");
|
|
|
|
+ userList.add(totalUser);
|
|
|
|
+ List<Map<String,Object>> totalList=new ArrayList<>();
|
|
|
|
+ for (String date : dataStringList) {
|
|
|
|
+ Map<String,Object> map=new HashMap<>();
|
|
|
|
+ List<Map<String, Object>> targetList = personWorkHoursWagesList.stream().filter(p -> String.valueOf(p.get("crateDate")).equals(date)).collect(Collectors.toList());
|
|
|
|
+ BigDecimal cost = targetList.stream().map(m -> new BigDecimal(String.valueOf(m.get("cost")))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ BigDecimal workTime = targetList.stream().map(m -> new BigDecimal(String.valueOf(m.get("workTime")))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ map.put("userId","0");
|
|
|
|
+ map.put("crateDate",date);
|
|
|
|
+ map.put("cost",cost.doubleValue());
|
|
|
|
+ map.put("workTime",workTime.doubleValue());
|
|
|
|
+ totalList.add(map);
|
|
|
|
+ }
|
|
|
|
+// totalUser.setPersonWorkHoursWages(totalList);
|
|
|
|
+ personWorkHoursWagesList.addAll(totalList);
|
|
userList.forEach(u->{
|
|
userList.forEach(u->{
|
|
- List<Map<String, Object>> mapList = personWorkHoursWagesList.stream().filter(pl -> pl.get("userId").equals(u.getId())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Map<String, Object>> mapList = personWorkHoursWagesList.stream().filter(pl -> String.valueOf(pl.get("userId")).equals(u.getId())).collect(Collectors.toList());
|
|
u.setPersonWorkHoursWages(mapList);
|
|
u.setPersonWorkHoursWages(mapList);
|
|
- u.setDepartmentCascade(convertDepartmentIdToCascade(u.getDepartmentId(),departmentList));
|
|
|
|
|
|
+ u.setDepartmentCascade(u.getId().equals("0")?"小计":convertDepartmentIdToCascade(u.getDepartmentId(),departmentList));
|
|
double workTime = mapList.stream().mapToDouble(mt -> Double.valueOf(String.valueOf(mt.get("workTime")))).sum();
|
|
double workTime = mapList.stream().mapToDouble(mt -> Double.valueOf(String.valueOf(mt.get("workTime")))).sum();
|
|
BigDecimal bigDecimal=new BigDecimal(workTime);
|
|
BigDecimal bigDecimal=new BigDecimal(workTime);
|
|
// bigDecimal=bigDecimal.multiply(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
// bigDecimal=bigDecimal.multiply(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_UP);
|