Authored by zhichao

导入导出

1.【无】导入导出逻辑修改
@@ -162,6 +162,7 @@ public class ExportServiceImpl implements ExportService { @@ -162,6 +162,7 @@ public class ExportServiceImpl implements ExportService {
162 } 162 }
163 List<String> reportCodeList = reportList.stream().map(Report::getReportCode).collect(Collectors.toList()); 163 List<String> reportCodeList = reportList.stream().map(Report::getReportCode).collect(Collectors.toList());
164 reportService.delete(new LambdaQueryWrapper<Report>().in(Report::getReportCode, reportCodeList)); 164 reportService.delete(new LambdaQueryWrapper<Report>().in(Report::getReportCode, reportCodeList));
  165 + reportList.forEach(item->{item.setId(null);});
165 reportService.insertBatch(reportList); 166 reportService.insertBatch(reportList);
166 167
167 //新增大屏配置 168 //新增大屏配置
@@ -169,6 +170,7 @@ public class ExportServiceImpl implements ExportService { @@ -169,6 +170,7 @@ public class ExportServiceImpl implements ExportService {
169 reportList.stream().map(Report::getReportDashboardList).distinct().forEach(reportDashboardList::addAll); 170 reportList.stream().map(Report::getReportDashboardList).distinct().forEach(reportDashboardList::addAll);
170 if (reportDashboardList.size() != 0) { 171 if (reportDashboardList.size() != 0) {
171 reportDashboardService.delete(new LambdaQueryWrapper<ReportDashboard>().in(ReportDashboard::getReportCode, reportCodeList)); 172 reportDashboardService.delete(new LambdaQueryWrapper<ReportDashboard>().in(ReportDashboard::getReportCode, reportCodeList));
  173 + reportDashboardList.forEach(item->{item.setId(null);});
172 reportDashboardService.insertBatch(reportDashboardList); 174 reportDashboardService.insertBatch(reportDashboardList);
173 } 175 }
174 176
@@ -179,6 +181,7 @@ public class ExportServiceImpl implements ExportService { @@ -179,6 +181,7 @@ public class ExportServiceImpl implements ExportService {
179 return; 181 return;
180 } 182 }
181 reportDashboardWidgetService.delete(new LambdaQueryWrapper<ReportDashboardWidget>().in(ReportDashboardWidget::getReportCode, reportCodeList)); 183 reportDashboardWidgetService.delete(new LambdaQueryWrapper<ReportDashboardWidget>().in(ReportDashboardWidget::getReportCode, reportCodeList));
  184 + reportDashboardWidgetList.forEach(item->{item.setId(null);});
182 reportDashboardWidgetService.insertBatch(reportDashboardWidgetList); 185 reportDashboardWidgetService.insertBatch(reportDashboardWidgetList);
183 186
184 //新增数据集 187 //新增数据集
@@ -192,6 +195,7 @@ public class ExportServiceImpl implements ExportService { @@ -192,6 +195,7 @@ public class ExportServiceImpl implements ExportService {
192 dataSet.setSourceCode(dataSet.getSourceCodeChange()); 195 dataSet.setSourceCode(dataSet.getSourceCodeChange());
193 } 196 }
194 } 197 }
  198 + dataSetList.forEach(item->{item.setId(null);});
195 dataSetService.insertBatch(dataSetList); 199 dataSetService.insertBatch(dataSetList);
196 } 200 }
197 201
@@ -200,6 +204,7 @@ public class ExportServiceImpl implements ExportService { @@ -200,6 +204,7 @@ public class ExportServiceImpl implements ExportService {
200 dataSetList.stream().map(DataSet::getDataSetParamList).distinct().forEach(dataSetParamList::addAll); 204 dataSetList.stream().map(DataSet::getDataSetParamList).distinct().forEach(dataSetParamList::addAll);
201 if (dataSetParamList.size() != 0) { 205 if (dataSetParamList.size() != 0) {
202 dataSetParamService.delete(new LambdaQueryWrapper<DataSetParam>().in(DataSetParam::getSetCode, setCodeList)); 206 dataSetParamService.delete(new LambdaQueryWrapper<DataSetParam>().in(DataSetParam::getSetCode, setCodeList));
  207 + dataSetParamList.forEach(item->{item.setId(null);});
203 dataSetParamService.insertBatch(dataSetParamList); 208 dataSetParamService.insertBatch(dataSetParamList);
204 } 209 }
205 210
@@ -208,6 +213,7 @@ public class ExportServiceImpl implements ExportService { @@ -208,6 +213,7 @@ public class ExportServiceImpl implements ExportService {
208 dataSetList.stream().map(DataSet::getDataSetTransformList).distinct().forEach(dataSetTransformList::addAll); 213 dataSetList.stream().map(DataSet::getDataSetTransformList).distinct().forEach(dataSetTransformList::addAll);
209 if (dataSetTransformList.size() != 0) { 214 if (dataSetTransformList.size() != 0) {
210 dataSetTransformService.delete(new LambdaQueryWrapper<DataSetTransform>().in(DataSetTransform::getSetCode, setCodeList)); 215 dataSetTransformService.delete(new LambdaQueryWrapper<DataSetTransform>().in(DataSetTransform::getSetCode, setCodeList));
  216 + dataSetTransformList.forEach(item->{item.setId(null);});
211 dataSetTransformService.insertBatch(dataSetTransformList); 217 dataSetTransformService.insertBatch(dataSetTransformList);
212 } 218 }
213 } 219 }