Raod 3 years ago
parent 0a9983ffa3
commit 852d05556f

@ -159,7 +159,7 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi
.lambda().eq(ReportDashboardWidget::getReportCode, reportCode)); .lambda().eq(ReportDashboardWidget::getReportCode, reportCode));
List<ReportDashboardWidgetDto> widgets = dto.getWidgets(); List<ReportDashboardWidgetDto> widgets = dto.getWidgets();
List<ReportDashboardWidget> reportDashboardWidgetList = new ArrayList<>(); // List<ReportDashboardWidget> reportDashboardWidgetList = new ArrayList<>();
for (int i = 0; i < widgets.size(); i++) { for (int i = 0; i < widgets.size(); i++) {
ReportDashboardWidget reportDashboardWidget = new ReportDashboardWidget(); ReportDashboardWidget reportDashboardWidget = new ReportDashboardWidget();
ReportDashboardWidgetDto reportDashboardWidgetDto = widgets.get(i); ReportDashboardWidgetDto reportDashboardWidgetDto = widgets.get(i);
@ -175,9 +175,13 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi
reportDashboardWidget.setEnableFlag(1); reportDashboardWidget.setEnableFlag(1);
reportDashboardWidget.setDeleteFlag(0); reportDashboardWidget.setDeleteFlag(0);
reportDashboardWidget.setSort((long) (i + 1)); reportDashboardWidget.setSort((long) (i + 1));
reportDashboardWidgetList.add(reportDashboardWidget);
//兼容底层,不采用批量插入
reportDashboardWidgetService.insert(reportDashboardWidget);
// reportDashboardWidgetList.add(reportDashboardWidget);
} }
reportDashboardWidgetService.insertBatch(reportDashboardWidgetList); // reportDashboardWidgetService.insertBatch(reportDashboardWidgetList);
} }

@ -315,14 +315,16 @@ public class DataSetServiceImpl implements DataSetService {
if (null == dataSetParamDtoList || dataSetParamDtoList.size() <= 0) { if (null == dataSetParamDtoList || dataSetParamDtoList.size() <= 0) {
return; return;
} }
List<DataSetParam> dataSetParamList = new ArrayList<>(); // List<DataSetParam> dataSetParamList = new ArrayList<>();
dataSetParamDtoList.forEach(dataSetParamDto -> { dataSetParamDtoList.forEach(dataSetParamDto -> {
DataSetParam dataSetParam = new DataSetParam(); DataSetParam dataSetParam = new DataSetParam();
BeanUtils.copyProperties(dataSetParamDto, dataSetParam); BeanUtils.copyProperties(dataSetParamDto, dataSetParam);
dataSetParam.setSetCode(setCode); dataSetParam.setSetCode(setCode);
dataSetParamList.add(dataSetParam); //不采用批量
dataSetParamService.insert(dataSetParam);
// dataSetParamList.add(dataSetParam);
}); });
dataSetParamService.insertBatch(dataSetParamList); // dataSetParamService.insertBatch(dataSetParamList);
} }
@ -335,15 +337,17 @@ public class DataSetServiceImpl implements DataSetService {
if (null == dataSetTransformDtoList || dataSetTransformDtoList.size() <= 0) { if (null == dataSetTransformDtoList || dataSetTransformDtoList.size() <= 0) {
return; return;
} }
List<DataSetTransform> dataSetTransformList = new ArrayList<>(); // List<DataSetTransform> dataSetTransformList = new ArrayList<>();
for (int i = 0; i < dataSetTransformDtoList.size(); i++) { for (int i = 0; i < dataSetTransformDtoList.size(); i++) {
DataSetTransform dataSetTransform = new DataSetTransform(); DataSetTransform dataSetTransform = new DataSetTransform();
BeanUtils.copyProperties(dataSetTransformDtoList.get(i), dataSetTransform); BeanUtils.copyProperties(dataSetTransformDtoList.get(i), dataSetTransform);
dataSetTransform.setOrderNum(i + 1); dataSetTransform.setOrderNum(i + 1);
dataSetTransform.setSetCode(setCode); dataSetTransform.setSetCode(setCode);
dataSetTransformList.add(dataSetTransform); //不采用批量
dataSetTransformService.insert(dataSetTransform);
// dataSetTransformList.add(dataSetTransform);
} }
dataSetTransformService.insertBatch(dataSetTransformList); // dataSetTransformService.insertBatch(dataSetTransformList);
} }
} }

Loading…
Cancel
Save