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)) {