|
|
|
|
@ -6,17 +6,17 @@ import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
|
|
|
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
|
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
|
|
|
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|
|
|
|
import com.engine.salary.exception.SalaryRunTimeException;
|
|
|
|
|
import com.engine.salary.mapper.report.SalaryStatisticsReportMapper;
|
|
|
|
|
import com.engine.salary.report.common.constant.SalaryConstant;
|
|
|
|
|
import com.engine.salary.report.common.constant.SalaryStatisticsDimensionConstant;
|
|
|
|
|
import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO;
|
|
|
|
|
import com.engine.salary.report.entity.dto.SalaryStatisticsReportDataDTO;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsDimensionSaveParam;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryParam;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsReportSaveParam;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsSearchConditionSaveParam;
|
|
|
|
|
import com.engine.salary.report.entity.param.*;
|
|
|
|
|
import com.engine.salary.report.entity.po.SalaryStatisticsDimensionPO;
|
|
|
|
|
import com.engine.salary.report.entity.po.SalaryStatisticsItemPO;
|
|
|
|
|
import com.engine.salary.report.entity.po.SalaryStatisticsReportPO;
|
|
|
|
|
@ -24,14 +24,8 @@ import com.engine.salary.report.enums.SalaryStatisticsDimensionTypeEnum;
|
|
|
|
|
import com.engine.salary.report.service.SalaryStatisticsItemService;
|
|
|
|
|
import com.engine.salary.report.service.SalaryStatisticsReportService;
|
|
|
|
|
import com.engine.salary.report.util.ReportTimeUtil;
|
|
|
|
|
import com.engine.salary.service.SalaryAcctEmployeeService;
|
|
|
|
|
import com.engine.salary.service.SalaryAcctResultService;
|
|
|
|
|
import com.engine.salary.service.SalaryEmployeeService;
|
|
|
|
|
import com.engine.salary.service.TaxAgentService;
|
|
|
|
|
import com.engine.salary.service.impl.SalaryAcctEmployeeServiceImpl;
|
|
|
|
|
import com.engine.salary.service.impl.SalaryAcctResultServiceImpl;
|
|
|
|
|
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
|
|
|
|
|
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
|
|
|
|
import com.engine.salary.service.*;
|
|
|
|
|
import com.engine.salary.service.impl.*;
|
|
|
|
|
import com.engine.salary.util.*;
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.salary.util.page.PageInfo;
|
|
|
|
|
@ -92,6 +86,14 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SalarySobService getSalarySobService(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// private ExtEmployeeService extEmployeeService;
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private HrmCommonEmployeeService hrmCommonEmployeeService;
|
|
|
|
|
@ -368,6 +370,86 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
return calculateReportRecordsByDimension(dimension, param, salaryStatisticsReportData, map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> buildDataPerspectiveRecords(SalaryStatisticsDataPerspectiveQueryParam param, SalaryStatisticsReportPO reportPO, SalaryStatisticsDimensionPO dimension, List<SalaryStatisticsItemPO> salaryStatisticsItemPOS) {
|
|
|
|
|
// 获取报表统计薪资项目
|
|
|
|
|
List<Long> 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 key = "id";
|
|
|
|
|
param.setTaxAgent(((List<Map>) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
|
|
|
|
param.setSubCompany(((List<Map>) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
|
|
|
|
param.setDepart(((List<Map>) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
|
|
|
|
param.setEmployee(((List<Map>) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
|
|
|
|
param.setHiredate(JSON.parseArray(reportPO.getHiredateSetting(), Date.class));
|
|
|
|
|
SalaryStatisticsReportDataQueryParam queryParam = new SalaryStatisticsReportDataQueryParam();
|
|
|
|
|
com.mzlion.core.utils.BeanUtils.copyProperties(param,queryParam);
|
|
|
|
|
// 获取本期报表分权后的核算人员
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listBySalaryStatisticsReportParam(queryParam);
|
|
|
|
|
|
|
|
|
|
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
|
|
|
|
// 获取核算结果
|
|
|
|
|
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIds, salaryItemIds);
|
|
|
|
|
|
|
|
|
|
// 设置dimensionValue为维度值
|
|
|
|
|
SalaryStatisticsReportDataDTO salaryStatisticsReportData = SalaryStatisticsReportDataDTO.builder()
|
|
|
|
|
.list(salaryAcctEmployeeList)
|
|
|
|
|
.lastList(Collections.emptyList())
|
|
|
|
|
.sameList(Collections.emptyList())
|
|
|
|
|
.salaryStatisticsItemList(salaryStatisticsItemPOS)
|
|
|
|
|
.employeeId((long) user.getUID())
|
|
|
|
|
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
|
|
|
|
.dimensionValue(param.getDimensionValue())
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
Map<Long, List<SalaryAcctResultPO>> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId);
|
|
|
|
|
Map<Long, Map<String, String>> map = new HashMap<>();
|
|
|
|
|
salaryAcctEmpResultMap.forEach((k, v) -> {
|
|
|
|
|
Map<String, String> collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2o(p.getResultValue()), (key1, key2) -> key2));
|
|
|
|
|
map.put(k, collect);
|
|
|
|
|
});
|
|
|
|
|
// 获取根据维度值过滤出的本次核算人员信息
|
|
|
|
|
calculateReportRecordsByDimension(dimension, SalaryStatisticsReportDataQueryParam.builder().build(), salaryStatisticsReportData, map);
|
|
|
|
|
List<SalaryAcctEmployeePO> listByDimensionValue = salaryStatisticsReportData.getListByDimensionValue();
|
|
|
|
|
// 构建核算结果数据
|
|
|
|
|
return buildResultRecords(listByDimensionValue, map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取根据维度值过滤出的本次核算人员信息
|
|
|
|
|
* @param listByDimensionValue 根据维度筛选后的薪资核算人员
|
|
|
|
|
* @param map 薪资核算结果
|
|
|
|
|
*/
|
|
|
|
|
private List<Map<String, Object>> buildResultRecords(List<SalaryAcctEmployeePO> listByDimensionValue, Map<Long, Map<String, String>> map) {
|
|
|
|
|
List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll();
|
|
|
|
|
Map<Long, String> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentList, TaxAgentPO::getId, TaxAgentPO::getName);
|
|
|
|
|
|
|
|
|
|
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listAll();
|
|
|
|
|
Map<Long, String> SalarySobMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getId, SalarySobPO::getName);
|
|
|
|
|
|
|
|
|
|
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
|
|
|
|
|
Map<Long, Integer> salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes);
|
|
|
|
|
List<Map<String, Object>> resultList = Lists.newArrayList();
|
|
|
|
|
Map<String, Object> resultMap;
|
|
|
|
|
for (SalaryAcctEmployeePO se : listByDimensionValue) {
|
|
|
|
|
resultMap = Maps.newHashMap();
|
|
|
|
|
Map<String, String> resultValueMap = Optional.ofNullable(map.get(se.getId())).orElse(Maps.newHashMap());
|
|
|
|
|
Map<String, Object> finalMap = resultMap;
|
|
|
|
|
resultValueMap.forEach((k, v) -> {
|
|
|
|
|
finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v);
|
|
|
|
|
});
|
|
|
|
|
resultMap.put("id", se.getId().toString());
|
|
|
|
|
resultMap.put("salaryMonth", SalaryDateUtil.getFormatYearMonth(se.getSalaryMonth()));
|
|
|
|
|
resultMap.put("taxAgent", taxAgentMap.get(se.getTaxAgentId()));
|
|
|
|
|
resultMap.put("salarySob",SalarySobMap.get(se.getSalarySobId()));
|
|
|
|
|
resultMap.put("acctTimes", salaryAcctRecordMap.get(se.getSalaryAcctRecordId()));
|
|
|
|
|
resultList.add(resultMap);
|
|
|
|
|
}
|
|
|
|
|
return resultList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PageInfo<Map<String, Object>> calculateReportRecordsByDimension(SalaryStatisticsDimensionPO dimension, SalaryStatisticsReportDataQueryParam param, SalaryStatisticsReportDataDTO data, Map<Long, Map<String, String>> salaryAcctResultValueMap) {
|
|
|
|
|
// 定性
|
|
|
|
|
if (SalaryStatisticsDimensionTypeEnum.QUALITATIVE.getValue().equals(dimension.getDimType())) {
|
|
|
|
|
@ -442,11 +524,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
Map<Date, List<SalaryAcctEmployeePO>> lastListMap = data.getLastList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getSalaryMonth));
|
|
|
|
|
Map<Date, List<SalaryAcctEmployeePO>> sameListMap = data.getSameList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getSalaryMonth));
|
|
|
|
|
List<Date> salaryMonthList = listMap.keySet().stream().sorted().collect(Collectors.toList());
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
salaryMonthList.forEach(k -> {
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, SalaryDateUtil.getFormatYearMonth(k));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listMap.get(k), lastListMap.get(ReportTimeUtil.getLastYearMonth(k)), sameListMap.get(ReportTimeUtil.getSameYearMonth(k)), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, SalaryDateUtil.getFormatYearMonth(k));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listMap.get(k), lastListMap.get(ReportTimeUtil.getLastYearMonth(k)), sameListMap.get(ReportTimeUtil.getSameYearMonth(k)), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue,SalaryDateUtil.getFormatYearMonth(k)) ){
|
|
|
|
|
data.setListByDimensionValue(listMap.get(k));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
result.setList(records);
|
|
|
|
|
return result;
|
|
|
|
|
@ -462,12 +549,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
|
|
|
|
|
List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll();
|
|
|
|
|
Map<Long, String> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentList, TaxAgentPO::getId, TaxAgentPO::getName);
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
listMap.forEach((k, v) -> {
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, taxAgentMap.get(k));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastListMap.get(k), sameListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, taxAgentMap.get(k));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastListMap.get(k), sameListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if(StringUtils.equals(dimensionValue, taxAgentMap.get(k))){
|
|
|
|
|
data.setListByDimensionValue(v);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -530,24 +621,35 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
sameEmpIdSubComMap.put(k, v.getSubcompanyid());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
subComIds.forEach(subComId -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSubComEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSubComEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, subComIdNameMap.get(subComId));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(subComEmployeePOS, lastSubComEmployeePOS, sameSubComEmployeePOS, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSubComEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSubComEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, subComIdNameMap.get(subComId));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(subComEmployeePOS, lastSubComEmployeePOS, sameSubComEmployeePOS, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, subComIdNameMap.get(subComId)) ){
|
|
|
|
|
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(subComEmployeePOS);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> sameEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
if(dimensionValue == null){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> sameEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
}
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, "无分组") ){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(noGroupingList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -588,24 +690,35 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
departIds.forEach(departId -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastDepartEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameDepartEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, departIdNameMap.get(departId));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(departEmployeePOS, lastDepartEmployeePOS, sameDepartEmployeePOS, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastDepartEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameDepartEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, departIdNameMap.get(departId));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(departEmployeePOS, lastDepartEmployeePOS, sameDepartEmployeePOS, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, departIdNameMap.get(departId)) ){
|
|
|
|
|
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(departEmployeePOS);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
}
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, "无分组") ){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(noGroupingList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -819,12 +932,17 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
// List<ExtEmployeePO> extEmployees = extEmployeeService.listByIdsWithDeleted(accountDetailPOList.stream().filter(e -> EmployeeTypeEnum.EXT_EMPLOYEE.getValue().equals(e.getEmployeeType())).map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()), data.getTenantKey());
|
|
|
|
|
// Map<Long, String> employeeExtByIdMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId, ExtEmployeePO::getUsername);
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
employeeListMap.forEach((k, v) -> {
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
// temp.put(DM, Objects.nonNull(employeeByIdMap.get(k)) ? employeeByIdMap.get(k) : employeeExtByIdMap.get(k));
|
|
|
|
|
temp.put(DM, employeeByIdMap.get(k));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastEmployeeListMap.get(k), sameEmployeeListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
temp.put(DM, employeeByIdMap.get(k));
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastEmployeeListMap.get(k), sameEmployeeListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, employeeByIdMap.get(k)) ){
|
|
|
|
|
data.setListByDimensionValue(v);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
PageInfo<Map<String, Object>> result = new PageInfo<>();
|
|
|
|
|
@ -841,14 +959,20 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
List<String> quarters = quarterSet.stream().sorted().collect(Collectors.toList());
|
|
|
|
|
Collections.reverse(quarters);
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
quarters.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> listYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastListYear = data.getLastList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 3)))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameListYear = data.getSameList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 12)))).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listYear, lastListYear, sameListYear, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> listYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastListYear = data.getLastList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 3)))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameListYear = data.getSameList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 12)))).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listYear, lastListYear, sameListYear, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if(StringUtils.equals(dimensionValue, k)){
|
|
|
|
|
List<SalaryAcctEmployeePO> listYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getQuarter(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(listYear);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -864,14 +988,20 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
List<String> halfYears = halfYearSet.stream().sorted().collect(Collectors.toList());
|
|
|
|
|
Collections.reverse(halfYears);
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
halfYears.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> listHalfYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastListHalfYear = data.getLastList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 6)))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameListHalfYear = data.getSameList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 12)))).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listHalfYear, lastListHalfYear, sameListHalfYear, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null){
|
|
|
|
|
List<SalaryAcctEmployeePO> listHalfYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastListHalfYear = data.getLastList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 6)))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameListHalfYear = data.getSameList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(ReportTimeUtil.getPlusYearMonth(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth()), 12)))).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listHalfYear, lastListHalfYear, sameListHalfYear, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if(StringUtils.equals(dimensionValue, k)){
|
|
|
|
|
List<SalaryAcctEmployeePO> listHalfYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getHalfYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(listHalfYear);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -887,14 +1017,20 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
List<String> years = yearSet.stream().sorted().collect(Collectors.toList());
|
|
|
|
|
Collections.reverse(years);
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
years.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> listYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastListYear = data.getLastList().stream().filter(sa -> Objects.equals(ReportTimeUtil.getLastYear(k), ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameListYear = data.getSameList().stream().filter(sa -> Objects.equals(ReportTimeUtil.getLastYear(k), ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listYear, lastListYear, sameListYear, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> listYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastListYear = data.getLastList().stream().filter(sa -> Objects.equals(ReportTimeUtil.getLastYear(k), ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameListYear = data.getSameList().stream().filter(sa -> Objects.equals(ReportTimeUtil.getLastYear(k), ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(listYear, lastListYear, sameListYear, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, k) ){
|
|
|
|
|
List<SalaryAcctEmployeePO> listYear = data.getList().stream().filter(sa -> Objects.equals(k, ReportTimeUtil.getYear(SalaryDateUtil.getFormatYearMonth(sa.getSalaryMonth())))).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(listYear);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -1537,24 +1673,35 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
List<Double> workYears = Lists.newArrayList(workYearSet);
|
|
|
|
|
workYears = workYears.stream().sorted().collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
workYears.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = data.getList().stream().filter(po -> Objects.equals(empIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = data.getList().stream().filter(po -> Objects.equals(empIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( Double.compare(Double.valueOf(dimensionValue), k) == 0 ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = data.getList().stream().filter(po -> Objects.equals(empIdWorkYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(salaryAcctEmployees);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> lastEmpIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> lastEmpIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
}
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, "无分组") ){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdWorkYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(noGroupingList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -1594,24 +1741,35 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
List<String> companyYears = Lists.newArrayList(companyYearSet);
|
|
|
|
|
companyYears = companyYears.stream().sorted().collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
companyYears.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = data.getList().stream().filter(po -> Objects.equals(empIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = data.getList().stream().filter(po -> Objects.equals(empIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k);
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, k) ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = data.getList().stream().filter(po -> Objects.equals(empIdCompanyYearMap.get(po.getEmployeeId()), k)).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(salaryAcctEmployees);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> sameEmpIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> sameEmpIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
|
|
|
|
Map<String, Object> noGrouping = new HashMap<>();
|
|
|
|
|
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
|
|
|
|
noGrouping.putAll(SalaryStatisticsReportBO.calculateItem(noGroupingList, lastNoGroupingList, sameNoGroupingList, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(noGrouping);
|
|
|
|
|
}
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, "无分组")){
|
|
|
|
|
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdCompanyYearMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
|
|
|
|
data.setListByDimensionValue(noGroupingList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -1651,14 +1809,20 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
} else {
|
|
|
|
|
groupBelong = SalaryStatisticsReportBO.G_ITEM;
|
|
|
|
|
}
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
groups.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getLastList(), lastEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getSameList(), sameEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k.getStartValue() + "-" + k.getEndValue());
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getLastList(), lastEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getSameList(), sameEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k.getStartValue() + "-" + k.getEndValue());
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, k.getStartValue() + "-" + k.getEndValue()) ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupSpacing(k, groupBelong, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
data.setListByDimensionValue(salaryAcctEmployees);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
@ -1726,14 +1890,20 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|
|
|
|
groupBelong = SalaryStatisticsReportBO.G_ITEM;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String dimensionValue = data.getDimensionValue();
|
|
|
|
|
groups.forEach(k -> {
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getLastList(), lastEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getSameList(), sameEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k.getValue());
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
if(dimensionValue == null ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> lastSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getLastList(), lastEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
List<SalaryAcctEmployeePO> sameSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getSameList(), sameEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
|
|
temp.put(DM, k.getValue());
|
|
|
|
|
temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
|
|
|
|
records.add(temp);
|
|
|
|
|
}else if( StringUtils.equals(dimensionValue, k.getValue()) ){
|
|
|
|
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, groupBelong, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList());
|
|
|
|
|
data.setListByDimensionValue(salaryAcctEmployees);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result.setList(records);
|
|
|
|
|
|