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); + }); } }