|
@@ -400,11 +400,15 @@ public class DataDashboardService {
|
|
|
}
|
|
|
saveList.sort(Comparator.comparing(DatastatSortStrategy::getDateStr).reversed()
|
|
|
.thenComparing(DatastatSortStrategy::getGhId).thenComparing(DatastatSortStrategy::getPosition));
|
|
|
- if (CollectionUtils.isNotEmpty(saveList)) {
|
|
|
- longArticleBaseMapper.deleteByDateStrBetween(beginDate, endDate, articleType);
|
|
|
- for (List<DatastatSortStrategy> saveListPartition : Lists.partition(saveList, 1000)) {
|
|
|
- longArticleBaseMapper.batchInsertDatastatSortStrategy(saveListPartition);
|
|
|
+ try {
|
|
|
+ if (CollectionUtils.isNotEmpty(saveList)) {
|
|
|
+ longArticleBaseMapper.deleteByDateStrBetween(beginDate, endDate, articleType);
|
|
|
+ for (List<DatastatSortStrategy> saveListPartition : Lists.partition(saveList, 1000)) {
|
|
|
+ longArticleBaseMapper.batchInsertDatastatSortStrategy(saveListPartition);
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("DatastatSortStrategy save error:{}", e.getMessage());
|
|
|
}
|
|
|
log.info("newSortStrategyData finish");
|
|
|
return NewSortStrategyExport.dbObjToExportObj(saveList);
|