From a4adb0da84105f931dbdf1dde5147e7dc0fa4d17 Mon Sep 17 00:00:00 2001 From: liuliang <401809302@qq.com> Date: Wed, 3 Aug 2022 17:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIImportServiceImpl.java | 10 +++- .../service/impl/SISchemeServiceImpl.java | 48 +++++++++---------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index d7b1ca7b4..48af41e32 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -119,12 +119,18 @@ public class SIImportServiceImpl extends Service implements SIImportService { } }); }else { - rowCloumn.add(null); + rowCloumn.add(""); } }); records.forEach(record -> { List row = Lists.newArrayList(); - rowCloumn.forEach(column -> row.add(record.get(column))); + rowCloumn.forEach(column -> { + if (record.get(column) == null){ + row.add(""); + }else { + row.add(record.get(column)); + } + }); excelSheetData.add(row); }); } diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 9eb301f1a..4b8d48c04 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -785,10 +785,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String socialStartMonth = (String) socialStartTimeMap.get(SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")); - if (StringUtils.isNotBlank(socialStartMonth) && socialStartMonth.length() > 7) { - socialStartMonth = socialStartMonth.substring(0, 7); - } - if (StringUtils.isNotBlank(socialStartMonth) && !SalaryDateUtil.checkYearMonth(socialStartMonth)) { +// if (StringUtils.isNotBlank(socialStartMonth) && socialStartMonth.length() > 7) { +// socialStartMonth = socialStartMonth.substring(0, 7); +// } + if (StringUtils.isNotBlank(socialStartMonth) && (!SalaryDateUtil.checkYearMonth(socialStartMonth) || socialStartMonth.length() != 7)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100315, "社保起始缴纳时间格式错误,正确格式为YYYY-MM")); excelComments.add(errorMessageMap); @@ -796,10 +796,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } String socialEndMonth = (String) socialEndTimeMap.get(SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")); - if (StringUtils.isNotBlank(socialEndMonth) && socialEndMonth.length() > 7) { - socialEndMonth = socialEndMonth.substring(0, 7); - } - if (StringUtils.isNotBlank(socialEndMonth) && !SalaryDateUtil.checkYearMonth(socialEndMonth)) { +// if (StringUtils.isNotBlank(socialEndMonth) && socialEndMonth.length() > 7) { +// socialEndMonth = socialEndMonth.substring(0, 7); +// } + if (StringUtils.isNotBlank(socialEndMonth) && (!SalaryDateUtil.checkYearMonth(socialEndMonth) || socialEndMonth.length() != 7)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100316, "社保最后缴纳时间格式错误,正确格式为YYYY-MM")); excelComments.add(errorMessageMap); @@ -807,10 +807,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } String fundStartMonth = (String) fundStartTimeMap.get(SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")); - if (StringUtils.isNotBlank(fundStartMonth) && fundStartMonth.length() > 7) { - fundStartMonth = fundStartMonth.substring(0, 7); - } - if (StringUtils.isNotBlank(fundStartMonth) && !SalaryDateUtil.checkYearMonth(fundStartMonth)) { +// if (StringUtils.isNotBlank(fundStartMonth) && fundStartMonth.length() > 7) { +// fundStartMonth = fundStartMonth.substring(0, 7); +// } + if (StringUtils.isNotBlank(fundStartMonth) && (!SalaryDateUtil.checkYearMonth(fundStartMonth) || fundStartMonth.length() != 7)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100317, "公积金起始缴纳时间格式错误,正确格式为YYYY-MM")); excelComments.add(errorMessageMap); @@ -818,10 +818,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } String fundEndMonth = (String) fundEndTimeMap.get(SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")); - if (StringUtils.isNotBlank(fundEndMonth) && fundEndMonth.length() > 7) { - fundEndMonth = fundEndMonth.substring(0, 7); - } - if (StringUtils.isNotBlank(fundEndMonth) && !SalaryDateUtil.checkYearMonth(fundEndMonth)) { +// if (StringUtils.isNotBlank(fundEndMonth) && fundEndMonth.length() > 7) { +// fundEndMonth = fundEndMonth.substring(0, 7); +// } + if (StringUtils.isNotBlank(fundEndMonth) && (!SalaryDateUtil.checkYearMonth(fundEndMonth) || fundEndMonth.length() != 7)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100319, "公积金最后缴纳时间格式错误,正确格式为YYYY-MM")); excelComments.add(errorMessageMap); @@ -829,10 +829,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } String otherStartMonth = (String) otherStartTimeMap.get(SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")); - if (StringUtils.isNotBlank(otherStartMonth) && otherStartMonth.length() > 7) { - otherStartMonth = otherStartMonth.substring(0, 7); - } - if (StringUtils.isNotBlank(otherStartMonth) && !SalaryDateUtil.checkYearMonth(otherStartMonth)) { +// if (StringUtils.isNotBlank(otherStartMonth) && otherStartMonth.length() > 7) { +// otherStartMonth = otherStartMonth.substring(0, 7); +// } + if (StringUtils.isNotBlank(otherStartMonth) && (!SalaryDateUtil.checkYearMonth(otherStartMonth) || otherStartMonth.length() != 7)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100320, "其他福利起始缴纳时间格式错误,正确格式为YYYY-MM")); excelComments.add(errorMessageMap); @@ -840,10 +840,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } String otherEndMonth = (String) otherEndTimeMap.get(SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")); - if (StringUtils.isNotBlank(otherEndMonth) && otherEndMonth.length() > 7) { - otherEndMonth = otherEndMonth.substring(0, 7); - } - if (StringUtils.isNotBlank(otherEndMonth) && !SalaryDateUtil.checkYearMonth(otherEndMonth)) { +// if (StringUtils.isNotBlank(otherEndMonth) && otherEndMonth.length() > 7) { +// otherEndMonth = otherEndMonth.substring(0, 7); +// } + if (StringUtils.isNotBlank(otherEndMonth) && (!SalaryDateUtil.checkYearMonth(otherEndMonth) || otherEndMonth.length() != 7)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100321, "其他福利最后缴纳时间格式错误,正确格式为YYYY-MM")); excelComments.add(errorMessageMap);