From 1460d32ae4c8c46849dfabd8f9d0101aded11a6a Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 13 Jun 2023 14:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A4=BE?= =?UTF-8?q?=E4=BF=9D=E7=A6=8F=E5=88=A9=EF=BC=8C=E5=88=97=E8=A1=A8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E3=80=81=E5=AF=BC=E5=87=BA=E7=BB=9F=E4=B8=80=E8=A1=A8?= =?UTF-8?q?=E5=A4=B4=E5=86=85=E5=AE=B9=E5=92=8C=E9=A1=BA=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E6=8B=AC=E8=87=AA=E9=80=89=E8=A1=A8=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 20 +++++- .../service/impl/ColumnBuildServiceImpl.java | 62 ++++++++++++++++--- .../service/impl/SIExportServiceImpl.java | 60 +++++++++++++++--- .../service/impl/SIImportServiceImpl.java | 6 +- .../service/impl/SISchemeServiceImpl.java | 20 +++++- 5 files changed, 142 insertions(+), 26 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index ca60b7460..dac9c3f20 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1195,9 +1195,23 @@ public class SIArchivesBiz { } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMap); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMap); - result.put(WelfareTypeEnum.OTHER.getValue(), otherMap); + // map根据key排序 + LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundMapWithAscKey = fundMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherMapWithAscKey = otherMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); + result.put(WelfareTypeEnum.OTHER.getValue(), otherMapWithAscKey); return result; } finally { sqlSession.close(); diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index 34a3d99f6..37cbfd652 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -52,8 +52,8 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic list.add(employeeIdColumn); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86185, "部门"), "department")); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86186, "手机号"), "mobile")); - list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86187, "员工状态"), "employeeStatus")); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 1933, "工号"), "workcode")); + list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86187, "员工状态"), "employeeStatus")); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100377, "数据来源"), "sourceFrom")); if (paymentStatus.equals(PaymentStatusEnum.REPAIR.getValue())) { list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100379, "补缴月份"), "supplementaryMonth")); @@ -166,9 +166,23 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "otherBase"); } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns); - result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns); + // map根据value排序 + LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundColumnsWithAscValue = fundColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherColumnsWithAscValue = otherColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); + result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); return result; } @@ -225,9 +239,23 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 87159, "个人"), social + "otherPer"); } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns); - result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns); + // map根据value排序 + LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundColumnsWithAscValue = fundColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherColumnsWithAscValue = otherColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); + result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); return result; } @@ -284,9 +312,23 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100289, "单位"), social + "otherCom"); } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns); - result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns); + // map根据value排序 + LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundColumnsWithAscValue = fundColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherColumnsWithAscValue = otherColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); + result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); return result; } diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index 9faa7fd87..ae330912a 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -392,9 +392,23 @@ public class SIExportServiceImpl extends Service implements SIExportService { social + "otherCom"); } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns); - result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns); + // map根据value排序 + LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundColumnsWithAscValue = fundColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherColumnsWithAscValue = otherColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); + result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); return result; } @@ -454,9 +468,23 @@ public class SIExportServiceImpl extends Service implements SIExportService { social + "otherPer"); } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns); - result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns); + // map根据value排序 + LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundColumnsWithAscValue = fundColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherColumnsWithAscValue = otherColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); + result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); return result; } @@ -605,9 +633,23 @@ public class SIExportServiceImpl extends Service implements SIExportService { otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "otherBase"); } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns); - result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns); + // map根据value排序 + LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundColumnsWithAscValue = fundColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherColumnsWithAscValue = otherColumns.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); + result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); return result; } } diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 4a5ffae54..ae235c3fc 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -225,7 +225,11 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public Map welfareNameIdMap(WelfareTypeEnum welfareTypeEnum) { - return getICategoryMapper().listByWelfareType(welfareTypeEnum.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getInsuranceName, ICategoryPO::getId)); +// return getICategoryMapper().listByWelfareType(welfareTypeEnum.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getInsuranceName, ICategoryPO::getId)); + return getICategoryMapper().listByWelfareType(welfareTypeEnum.getValue(),null) + .stream() + .sorted(Comparator.comparing(ICategoryPO::getId)) + .collect(LinkedHashMap::new, (map, item) -> map.put(item.getInsuranceName(), item.getId()), LinkedHashMap::putAll); } public Map welfareMap() { diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index d98a6d746..a3fdc6cc0 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -578,9 +578,23 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } }); - result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMap); - result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMap); - result.put(WelfareTypeEnum.OTHER.getValue(), otherMap); + // map根据key排序 + LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundMapWithAscKey = fundMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherMapWithAscKey = otherMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); + result.put(WelfareTypeEnum.OTHER.getValue(), otherMapWithAscKey); return result; }