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();