报表人员维度增加部门和工号
This commit is contained in:
parent
b08d3bdd2c
commit
16f46ae2da
|
|
@ -827,10 +827,17 @@ public class SalaryStatisticsReportBO {
|
|||
* @param salaryStatisticsItemList
|
||||
* @return
|
||||
*/
|
||||
public static List<WeaTableColumnGroup> buildReportColumns(String dimensionName, List<SalaryStatisticsItemPO> salaryStatisticsItemList) {
|
||||
public static List<WeaTableColumnGroup> buildReportColumns(SalaryStatisticsDimensionPO dimensionName, List<SalaryStatisticsItemPO> salaryStatisticsItemList) {
|
||||
List<WeaTableColumnGroup> result = new ArrayList<>();
|
||||
|
||||
result.add(new WeaTableColumnGroup("150", dimensionName, "dimension"));
|
||||
result.add(new WeaTableColumnGroup("150", dimensionName.getDimName(), "dimension"));
|
||||
|
||||
//人员维度新增部门和工号
|
||||
if (SalaryStatisticsDimensionConstant.DM_EMPLOYEE.equals(dimensionName.getDimCode())) {
|
||||
result.add(new WeaTableColumnGroup("150", "部门", "departmentName"));
|
||||
result.add(new WeaTableColumnGroup("150", "工号", "workcode"));
|
||||
}
|
||||
|
||||
Map<Long, SalaryStatisticsItemPO> itemMap = salaryStatisticsItemList.stream().collect(Collectors.toMap(SalaryStatisticsItemPO::getId, Function.identity()));
|
||||
Map<Long, String> itemIdNameMap = salaryStatisticsItemList.stream().collect(LinkedHashMap::new, (map, item) -> map.put(item.getId(), item.getItemName()), LinkedHashMap::putAll);
|
||||
itemIdNameMap.forEach((k, v) -> {
|
||||
|
|
|
|||
|
|
@ -1014,7 +1014,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
Map<Long, List<SalaryAcctEmployeePO>> employeeListMap = accountDetailPOList.stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> lastEmployeeListMap = data.getLastList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> sameEmployeeListMap = data.getSameList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
|
||||
Map<Long, String> employeeByIdMap = getSalaryEmployeeService(user).getEmployeeByIds(accountDetailPOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList())).stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> Util.null2String(o.getUsername())));
|
||||
Map<Long, DataCollectionEmployee> employeeByIdMap = getSalaryEmployeeService(user).getEmployeeByIdsAll(accountDetailPOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList())).stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> o));
|
||||
|
||||
// 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);
|
||||
|
|
@ -1024,10 +1024,12 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
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.put(DM, employeeByIdMap.get(k).getUsername());
|
||||
temp.put("departmentName", employeeByIdMap.get(k).getDepartmentName());
|
||||
temp.put("workcode", employeeByIdMap.get(k).getWorkcode());
|
||||
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))) {
|
||||
} else if (StringUtils.equals(dimensionValue, employeeByIdMap.get(k).getUsername())) {
|
||||
data.setListByDimensionValue(v);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
Map<String, Object> countResultMap = SalaryStatisticsReportBO.buildTotal(page, salaryStatisticsItemList, (long) user.getUID());
|
||||
|
||||
// 列表columns
|
||||
List<WeaTableColumnGroup> weaTableColumns = SalaryStatisticsReportBO.buildReportColumns(dimension.getDimName(), salaryStatisticsItemList);
|
||||
List<WeaTableColumnGroup> weaTableColumns = SalaryStatisticsReportBO.buildReportColumns(dimension, salaryStatisticsItemList);
|
||||
|
||||
Map<String, Object> resultMap = Maps.newHashMap();
|
||||
resultMap.putAll(JsonUtil.parseMap(weaTable, Object.class));
|
||||
|
|
@ -377,7 +377,7 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
List<Map<String, String>> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue() + StringUtils.EMPTY))).collect(Collectors.toList());
|
||||
|
||||
// 获取列头
|
||||
List<WeaTableColumnGroup> weaTableColumns = SalaryStatisticsReportBO.buildReportColumns(dimension.getDimName(), salaryStatisticsItemList);
|
||||
List<WeaTableColumnGroup> weaTableColumns = SalaryStatisticsReportBO.buildReportColumns(dimension, salaryStatisticsItemList);
|
||||
|
||||
// 组装导出参数
|
||||
// ExportCommonParam exportParam = SalaryStatisticsReportBO.buildExportParam(dimension.getDimName(), weaTableColumns, records);
|
||||
|
|
|
|||
Loading…
Reference in New Issue