From c4ff2ae3320b8d7680d9b6c0b705b53c06a6f2a1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 30 Sep 2022 10:14:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E9=BB=98=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E6=94=B9=E6=88=90500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/DataSyncConfigServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 3bf86234fe..5508e49cc4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.service.IcNatService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -231,6 +232,8 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); if (CollectionUtils.isNotEmpty(groupByStatus.get(false))){ - icNatService.insertBatch(groupByStatus.get(false)); + for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), 500)) { + icNatService.insertBatch(icNatEntities); + } } //组织关系表 List relationEntities = new ArrayList<>();