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