diff --git a/src/com/engine/salary/report/entity/bo/SalaryStatisticsReportBO.java b/src/com/engine/salary/report/entity/bo/SalaryStatisticsReportBO.java index 59abb699b..9ad7fb2fc 100644 --- a/src/com/engine/salary/report/entity/bo/SalaryStatisticsReportBO.java +++ b/src/com/engine/salary/report/entity/bo/SalaryStatisticsReportBO.java @@ -129,7 +129,9 @@ public class SalaryStatisticsReportBO { param.setDepart(((List) JSON.parseArray(po.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); } // param.setGrade(((List) JSON.parseArray(po.getGradeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); -// param.setPosition(((List) JSON.parseArray(po.getPositionSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + if (po.getPositionSetting() != null) { + param.setPosition(((List) JSON.parseArray(po.getPositionSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } if (po.getStatusSetting() != null) { param.setStatus(((List) JSON.parseArray(po.getStatusSetting(), Map.class)).stream().map(m -> m.get(key).toString()).collect(Collectors.toList())); } diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java index b75c5c413..962e3b135 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java @@ -445,8 +445,18 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary // 获取报表统计薪资项目 List salaryItemIds = salaryStatisticsItemPOS.stream().filter(item -> StringUtils.isNotBlank(item.getItemValue())).map(p -> p.getItemValue().split(",")).flatMap(Arrays::stream).map(Long::valueOf).collect(Collectors.toList()); // 参数转换 - param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryStartMonth())); - param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryEndMonth())); + String salaryStartMonth = param.getSalaryStartMonth(); + if (salaryStartMonth == null) { + param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryStartMonth())); + } else { + param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(SalaryDateUtil.dateStrToLocalDate(salaryStartMonth))); + } + String salaryEndMonth = param.getSalaryEndMonth(); + if (salaryEndMonth == null) { + param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryEndMonth())); + } else { + param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(SalaryDateUtil.dateStrToLocalDate(salaryEndMonth))); + } String key = "id"; if (reportPO.getTaxAgentSetting() != null) { param.setTaxAgent(((List) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 621b2b068..7ca1a1f4d 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -712,19 +712,20 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct // } // list = list.stream().filter(po -> employeeIdsByGradeFilter.contains(po.getEmployeeId())).collect(Collectors.toList()); // } -// // 岗位过滤 -// if (CollectionUtils.isNotEmpty(param.getPosition())) { -// Set employeeIdsByPostionFilter = new HashSet<>(); -// simpleEmployeeList.forEach(simpleEmployee -> { -// if (simpleEmployee.getPosition() != null && param.getPosition().contains(simpleEmployee.getPosition().getId())) { -// employeeIdsByPostionFilter.add(simpleEmployee.getEmployeeId()); -// } -// }); -// if (CollectionUtils.isEmpty(employeeIdsByPostionFilter)) { -// return Lists.newArrayList(); -// } -// list = list.stream().filter(po -> employeeIdsByPostionFilter.contains(po.getEmployeeId())).collect(Collectors.toList()); -// } + // 岗位过滤 + List position = param.getPosition(); + if (CollectionUtils.isNotEmpty(position)) { + // Set employeeIdsByPostionFilter = new HashSet<>(); + // simpleEmployeeList.forEach(simpleEmployee -> { + // if (simpleEmployee.getPosition() != null && param.getPosition().contains(simpleEmployee.getPosition().getId())) { + // employeeIdsByPostionFilter.add(simpleEmployee.getEmployeeId()); + // } + // }); + // if (CollectionUtils.isEmpty(employeeIdsByPostionFilter)) { + // return Lists.newArrayList(); + // } + employeeList = employeeList.stream().filter(emp -> position.contains(emp.getJobtitleId())).collect(Collectors.toList()); + } // 人事状态过滤 if (CollectionUtils.isNotEmpty(param.getStatus())) { Set employeeIdsByStatus = new HashSet<>();