From ce80905ad0f8b8a14b3c30e7a015381ab1631385 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 11 Nov 2024 09:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalaryStatisticsEmployeeWrapper.java | 41 ++++++++----------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java index de4c32dd1..0b7a3f87a 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java @@ -180,31 +180,8 @@ public class SalaryStatisticsEmployeeWrapper extends Service { SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList()); List> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null); - Map countResultMap = Maps.newHashMap(); - if (CollectionUtils.isNotEmpty(records)) { - List salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList(); - for (SalaryItemPO item : salaryItems) { - BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO); - String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX; - for (Map record : records) { - if (record.containsKey(itemKey)) { - if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) { - sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString())); - record.put(itemKey, record.get(itemKey).toString()); - } - } - } - // 薪资项目合计 - if (queryParam.isExport()) { - countResultMap.put(itemKey, sumBigDecimal.toString()); - } - } - } PageInfo> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); pageInfo.setList(records); - if (queryParam.isExport()) { - pageInfo.setList(records); - } pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal()); List weaTableColumns; @@ -219,6 +196,20 @@ public class SalaryStatisticsEmployeeWrapper extends Service { // 结果 resultMap.put("columns", weaTableColumns); if (queryParam.isExport()) { + Map countResultMap = Maps.newHashMap(); + List salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList(); + if (CollectionUtils.isNotEmpty(records)) { + for (SalaryItemPO item : salaryItems) { + BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO); + String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX; + for (Map record : records) { + if (Objects.nonNull(record.get(itemKey)) && NumberUtils.isCreatable(record.get(itemKey).toString())) { + sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString())); + } + } + countResultMap.put(itemKey, sumBigDecimal.toString()); + } + } resultMap.put("salaryItems", salaryStatisticsEmployeeDetailResult.getSalaryItemList()); resultMap.put("countResult", countResultMap); } else { @@ -275,7 +266,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX; for (Map record : records) { if (record.containsKey(itemKey)) { - if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) { + if (Objects.nonNull(record.get(itemKey)) && NumberUtils.isCreatable(record.get(itemKey).toString())) { sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString())); } } @@ -313,7 +304,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { SalaryItemPO salaryItemPO = salaryItemMap.get(column.getColumn()); Integer pattern = salaryItemPO == null ? 0 : salaryItemPO.getPattern(); String dataType = salaryItemPO == null ? SalaryDataTypeEnum.STRING.getValue() : salaryItemPO.getDataType(); - finalColumns.add(new WeaTableColumnGroup("100px", column.getText(), column.getColumn(), "false", pattern, dataType)); + finalColumns.add(new WeaTableColumnGroup("100px", Util.formatMultiLang(column.getText()), column.getColumn(), "false", pattern, dataType)); } }); List> rowList = new ArrayList<>();