From 8e0bf2b693beb9fabeaf8024b98b4aca597d5f04 Mon Sep 17 00:00:00 2001 From: fcli Date: Thu, 5 Jan 2023 09:25:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E6=B8=85=E7=A9=BA=E6=A0=A1=E9=AA=8Cbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= 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 a26a9c801..9205ef09d 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -56,6 +56,7 @@ import java.io.InputStream; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.YearMonth; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -1026,7 +1027,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation List deleteIds = deleteParam.getIds(); // 已经核算过的不可操作 // 获取已经核算的数据 - List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER); + salaryMonthDate = salaryMonthDate.plusMonths(1); + String format = salaryMonthDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format); // 判断是否有核算过 List deleteList = new ArrayList<>(); for(int i=0; i Objects.equals(t , taxAgentId)); @@ -1085,8 +1089,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取所有想要删除的数据 List list = biz.listSome(queryParam); + LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER); + String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); // 获取已经核算的数据 - List employees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + List employees = getAddUpDeductionService(user).getAccountedEmployeeData(format); for(AddUpSituation item : list){ if (CollectionUtils.isNotEmpty(employees)) { Optional optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();