From b20a6e4cbf05368ac1db13e9ffb518571aecabdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 6 Jun 2022 19:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalarySobServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 2f61a600a..ab15f0093 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -35,6 +35,7 @@ import weaver.hrm.User; import java.time.YearMonth; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -216,7 +217,12 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { // 5、保存 SalarySobItemBO.Result result = SalarySobItemBO.initSalarySobItem(salarySobPO.getId(), salarySobDefaultItemGroupPOS, salarySobDefaultItemPOS, defaultSalaryItemPOS, (long) user.getUID(), SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobItems())) { - salarySobItemService.batchInsert(result.getNeedInsertSalarySobItems()); + + List list = new ArrayList<>(result.getNeedInsertSalarySobItems().stream() + .collect(Collectors.toMap(SalarySobItemPO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue)) + .values()); + + salarySobItemService.batchInsert(list); } if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobItemGroups())) { salarySobItemGroupService.batchInsert(result.getNeedInsertSalarySobItemGroups());