From e3c6b08e6f1950e9b1105ee585253d36ff975b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 23 Oct 2024 17:41:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8A=A5=E8=A1=A8=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/SalaryStatisticsReportWrapper.java | 14 +++++--------- .../service/impl/SalaryEmployeeServiceImpl.java | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java index 22fb6261f..c516bb229 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java @@ -34,7 +34,6 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -437,14 +436,11 @@ public class SalaryStatisticsReportWrapper extends Service { // 获取列头 List weaTableColumns = (List) result.get("columns"); PageInfo> page = (PageInfo>) result.get("pageInfo"); - // 组装合计 - Map countResultMap = SalaryStatisticsReportBO.buildTotal(page, salaryStatisticsItemList, (long) user.getUID()); + Map countResultMap = (Map) result.get("countResult"); List> list = page.getList(); - if (CollectionUtils.isNotEmpty(list) && MapUtils.isNotEmpty(countResultMap)) { - list.add(countResultMap); - } // 获取数据 - List> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue() + StringUtils.EMPTY))).collect(Collectors.toList()); + List> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()))).collect(Collectors.toList()); + records.add(countResultMap); List rows = new ArrayList<>(); rows.add(weaTableColumns); @@ -466,7 +462,7 @@ public class SalaryStatisticsReportWrapper extends Service { List numberItemIds = salaryItemPOList.stream().filter(item -> item.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())).map(salaryItemPO -> salaryItemPO.getId().toString()).collect(Collectors.toList()); Map salaryStatisticsItemMap = SalaryEntityUtil.convert2Map(salaryStatisticsItemList, statisticsItemPO -> statisticsItemPO.getId().toString()); - for (Map map : records) { + for (Map map : records) { List row = Lists.newArrayListWithExpectedSize(records.size()); head.forEach(k -> { // 获取是数值还是文本 @@ -476,7 +472,7 @@ public class SalaryStatisticsReportWrapper extends Service { SalaryStatisticsItemPO salaryStatisticsItemPO = salaryStatisticsItemMap.get(salaryItemId); if (salaryStatisticsItemPO != null) { Optional textItemOptional = Arrays.stream(salaryStatisticsItemPO.getItemValue().split(",")).filter(itemId -> !numberItemIds.contains(itemId)).findFirst(); - row.add((!textItemOptional.isPresent() && NumberUtils.isCreatable(map.getOrDefault(k, StringUtils.EMPTY).replace(",", ""))) ? new BigDecimal(map.get(k).replace(",", "")) : map.getOrDefault(k, StringUtils.EMPTY)); + row.add((!textItemOptional.isPresent() && NumberUtils.isCreatable(Utils.null2String(map.get(k)))) ? new BigDecimal(Utils.null2String(map.get(k))) : map.getOrDefault(k, StringUtils.EMPTY)); } else { row.add(map.getOrDefault(k, StringUtils.EMPTY)); } diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index d47671229..de9d908ac 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -38,6 +38,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.conn.RecordSet; +import weaver.general.Util; import weaver.hrm.User; import java.util.*; @@ -452,7 +453,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee String field = setting.getField(); String value = rs.getString(field); setting.setValue(value); - extendData.put(field, value); + extendData.put(field, Util.formatMultiLang(value)); }); String id = rs.getString(primaryKey);