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; }