From 6418e4ad6ecb34aa4d9da067e70fd2871353ec82 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 15 Mar 2023 13:38:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1=E6=83=85?= =?UTF-8?q?=E5=86=B5=EF=BC=8C=E8=8E=B7=E5=8F=96=E5=BD=93=E6=9C=88=E7=A8=8E?= =?UTF-8?q?=E6=AC=BE=E6=89=80=E5=B1=9E=E6=9C=9F=E6=95=B0=E6=8D=AE=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=AF=BC=E5=85=A5bug=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AddUpSituationServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index 9a0a63e2d..9d62333b4 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -605,8 +605,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取租户下所有的人员 List employees = employBiz.listEmployee(); // 已经核算过的不可操作 - // 获取已经核算的数据 - List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(taxYearMonthStr); + // 获取已经核算的数据(获取税款所属期下一个月的数据) + YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); + String nextTaxYearMonthStr = taxYearMonthStr; + if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); + nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); + } + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(nextTaxYearMonthStr); //税款所属期 Date taxYearMonth = SalaryDateUtil.localDateToDate(LocalDate.parse(taxYearMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER)); @@ -737,7 +743,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // } // 判断是否有核算过 - if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) { + if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12") ) { Optional optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())).findFirst(); boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())); if (optionalAcctEmp.isPresent() && isExist) {