From db99e8239bc2ee954394a1a9db5945c8f7289438 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 1 Jul 2025 22:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=87=E5=BE=B7=E9=9A=86=20=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=96=AA=E8=B5=84=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalaryArchiveItemServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index 3a2db8a58..de8b1c1be 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -440,7 +440,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi List effectiveSalaryItemDels = Lists.newArrayList(); List salaryArchiveItemNews = Lists.newArrayList(); - salaryArchiveItems.forEach(e -> { + for (int j = 0; j < salaryArchiveItems.size(); j++) { + SalaryArchiveItemDetailSaveParam e = salaryArchiveItems.get(j); // 已生效 List effectiveList = effectiveSalaryItems.stream().filter(i -> i.getSalaryItemId().equals(e.getSalaryItemId())).collect(Collectors.toList()); // 当前已生效 @@ -461,7 +462,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi // 1.2 如果等于当前已生效 fixme 日期比较可能有bug } else if (saveEffectiveTime.equals(effectiveTime)) { if (effectiveBeforeSalaryItem != null && effectiveBeforeSalaryItem.getItemValue().equals(e.getAdjustValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同")); + // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同")); + continue; } if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100434, "与未生效的调整后不可相同")); @@ -469,14 +471,16 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi // 1.3 如果>已经生效且<=今天 } else if (saveEffectiveTime.after(effectiveTime) && !saveEffectiveTime.after(today)) { if (effectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同")); + // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同")); + continue; } if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100434, "与未生效的调整后不可相同")); } // 1.4 如果>今天 } else if (saveEffectiveTime.after(today) && effectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同")); + // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同")); + continue; } } else if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100434, "与未生效的调整后不可相同")); @@ -489,7 +493,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi effectiveSalaryItemDels.add(ineffectiveSalaryItem.getId()); } salaryArchiveItemNews.add(buildInsert(salaryArchive, e.getSalaryItemId(), e.getAdjustValue(), saveParam, nowTime, e.getDescription())); - }); + } // 落库处理 if (CollectionUtils.isNotEmpty(effectiveSalaryItemDels)) {