Browse Source

暂时批量插入 还需优化

master
jianjun 5 years ago
parent
commit
89ea820ecd
  1. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -361,7 +361,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
}
if (!CollectionUtils.isEmpty(gridScoreEntityList)) {
gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal);
gridScoreDao.insertBatches(gridScoreEntityList);
//批量插入
List<List<GridScoreEntity>> partition = ListUtils.partition(gridScoreEntityList, 100);
partition.forEach(list -> {
gridScoreDao.insertBatches(list);
});
}
}
@ -634,7 +638,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
}
if (!CollectionUtils.isEmpty(gridScoreEntityList)) {
gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR);
gridScoreDao.insertBatches(gridScoreEntityList);
//批量插入
List<List<GridScoreEntity>> partition = ListUtils.partition(gridScoreEntityList, 100);
partition.forEach(list -> {
gridScoreDao.insertBatches(list);
});
}
}

Loading…
Cancel
Save