From 2bd0098d66577892cc050f5f2db5a70d6d02da61 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 10 Sep 2020 09:48:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=89=B9=E9=87=8F=E6=8F=92?= =?UTF-8?q?=E5=85=A5=20=E8=BF=98=E9=9C=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/GridCorreLationServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index 1db443914c..0e992f24df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexOutputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -359,7 +360,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } if (!CollectionUtils.isEmpty(gridScoreEntityList)) { gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal); - gridScoreDao.insertBatches(gridScoreEntityList); + //批量插入 + List> partition = ListUtils.partition(gridScoreEntityList, 100); + partition.forEach(list -> { + gridScoreDao.insertBatches(list); + }); } } @@ -628,7 +633,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } if (!CollectionUtils.isEmpty(gridScoreEntityList)) { gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); - gridScoreDao.insertBatches(gridScoreEntityList); + //批量插入 + List> partition = ListUtils.partition(gridScoreEntityList, 100); + partition.forEach(list -> { + gridScoreDao.insertBatches(list); + }); } }