From 9d0194acd313d03443a9377d6c4a9a313f1f93f9 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 7 Aug 2023 16:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E4=BC=98=E5=8C=96=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=E8=A1=A5=E7=BC=B4=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=AD=E8=B4=A6=E5=8D=95=E6=9C=88=E4=BB=BD=E5=92=8C=E8=A1=A5?= =?UTF-8?q?=E7=BC=B4=E6=9C=88=E4=BB=BD=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIAccountServiceImpl.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index c28d12ebb..ddf812e94 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1544,12 +1544,18 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { excelComments.add(errorMessageMap); } - if (!checkBillMonth(billMonth)) { + if (billMonth.length() < 7 || !SalaryDateUtil.checkYearMonth(billMonth.substring(0, 7))) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "账单月份输入有误,请参照“2022-09”这种格式进行检查")); excelComments.add(errorMessageMap); } + if (headers.contains("补缴月份") && (supplementaryMonth.length() < 7 || !SalaryDateUtil.checkYearMonth(supplementaryMonth.substring(0, 7)))) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补缴月份输入有误,请参照“2022-09”这种格式进行检查")); + excelComments.add(errorMessageMap); + } //遍历表头 for (int j = 0; j < headers.size(); j++) { @@ -1611,9 +1617,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //根据员工id、个税扣缴义务人id、账单月份查询 //根据表头字段来区分正常缴纳和补缴两类数据 if (!headers.contains("补缴月份")) { - list = getInsuranceAccountDetailMapper().queryNormalList(billMonth, paymentOrganization, employeeIds.get(0)); + list = getInsuranceAccountDetailMapper().queryNormalList(billMonth.substring(0, 7), paymentOrganization, employeeIds.get(0)); } else { - list = getInsuranceAccountDetailMapper().querySupplementList(billMonth, paymentOrganization, employeeIds.get(0), supplementaryMonth); + list = getInsuranceAccountDetailMapper().querySupplementList(billMonth.substring(0, 7), paymentOrganization, employeeIds.get(0), supplementaryMonth.substring(0, 7)); } if (list.isEmpty()) { @@ -1973,7 +1979,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } if (!StringUtils.isEmpty(baseMap.getOrDefault("账单月份", "").toString())) { - insuranceAccountDetailPO.setBillMonth(baseMap.get("账单月份").toString()); + insuranceAccountDetailPO.setBillMonth(baseMap.get("账单月份").toString().substring(0, 7)); } if (!StringUtils.isEmpty(baseMap.getOrDefault("社保合计", "").toString())) { @@ -2007,7 +2013,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //如果导入的时补缴数据,还会包含补缴月份 if (!StringUtils.isEmpty(baseMap.getOrDefault("补缴月份", "").toString())) { - insuranceAccountDetailPO.setSupplementaryMonth(baseMap.get("补缴月份").toString()); + insuranceAccountDetailPO.setSupplementaryMonth(baseMap.get("补缴月份").toString().substring(0, 7)); } insuranceAccountDetailPO.setUpdateTime(new Date()); @@ -2996,7 +3002,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { excelComments.add(errorMessageMap); } - if (!checkBillMonth(billMonth)) { + if (billMonth.length() < 7 || !SalaryDateUtil.checkYearMonth(billMonth.substring(0, 7))) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "账单月份输入有误,请参照“2022-09”这种格式进行检查")); @@ -3071,7 +3077,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { list = getInsuranceAccountDetailMapper().queryBalanceList(InsuranceAccountDetailPO.builder() .employeeId(employeeId) .paymentOrganization(paymentOrganization) - .billMonth(billMonth) + .billMonth(billMonth.substring(0, 7)) .build()); if (list.isEmpty()) { @@ -3346,7 +3352,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); insuranceAccountDetailPO.setId(IdGenerator.generate()); insuranceAccountDetailPO.setEmployeeId(employeeId); - insuranceAccountDetailPO.setBillMonth(billMonth); + insuranceAccountDetailPO.setBillMonth(billMonth.substring(0, 7)); insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue()); insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue()); insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.IMPORT.getValue());