Authored by zhichao

导入导出

1.【无】导入导出逻辑修改
@@ -91,9 +91,21 @@ public class ExportServiceImpl implements ExportService { @@ -91,9 +91,21 @@ public class ExportServiceImpl implements ExportService {
91 } 91 }
92 ; 92 ;
93 }); 93 });
  94 + //组合大屏组件
  95 + Map<String, List<ReportDashboard>> reportDashboardMap = reportDashboardList.stream().collect(Collectors.groupingBy(ReportDashboard::getReportCode));
  96 + Map<String, List<ReportDashboardWidget>> reportDashboardWidgetMap = reportDashboardWidgetList.stream().collect(Collectors.groupingBy(ReportDashboardWidget::getReportCode));
  97 + for (Report report : reportList) {
  98 + if (reportDashboardMap.get(report.getReportCode()) != null) {
  99 + report.setReportDashboardList(reportDashboardMap.get(report.getReportCode()));
  100 + }
  101 + if (reportDashboardWidgetMap.get(report.getReportCode()) != null) {
  102 + report.setReportDashboardWidgetList(reportDashboardWidgetMap.get(report.getReportCode()));
  103 + }
  104 + }
94 if (setCodeList.size() == 0) { 105 if (setCodeList.size() == 0) {
95 return reportList; 106 return reportList;
96 } 107 }
  108 +
97 //接口地址 109 //接口地址
98 List<DataSet> dataSetList = dataSetService.list(new LambdaQueryWrapper<DataSet>() 110 List<DataSet> dataSetList = dataSetService.list(new LambdaQueryWrapper<DataSet>()
99 .in(DataSet::getSetCode, setCodeList)); 111 .in(DataSet::getSetCode, setCodeList));
@@ -107,21 +119,6 @@ public class ExportServiceImpl implements ExportService { @@ -107,21 +119,6 @@ public class ExportServiceImpl implements ExportService {
107 //数据转换 119 //数据转换
108 List<DataSetTransform> dataSetTransformList = dataSetTransformService.list(new LambdaQueryWrapper<DataSetTransform>() 120 List<DataSetTransform> dataSetTransformList = dataSetTransformService.list(new LambdaQueryWrapper<DataSetTransform>()
109 .in(DataSetTransform::getSetCode, setCodes)); 121 .in(DataSetTransform::getSetCode, setCodes));
110 - //数据源  
111 - List<String> sourceCodeList = dataSetList.stream().map(DataSet::getSourceCode).distinct().collect(Collectors.toList());  
112 - List<DataSource> dataSourceList = dataSourceService.list(new LambdaQueryWrapper<DataSource>()  
113 - .in(DataSource::getSourceCode, sourceCodeList));  
114 - //组合大屏组件  
115 - Map<String, List<ReportDashboard>> reportDashboardMap = reportDashboardList.stream().collect(Collectors.groupingBy(ReportDashboard::getReportCode));  
116 - Map<String, List<ReportDashboardWidget>> reportDashboardWidgetMap = reportDashboardWidgetList.stream().collect(Collectors.groupingBy(ReportDashboardWidget::getReportCode));  
117 - for (Report report : reportList) {  
118 - if (reportDashboardMap.get(report.getReportCode()) != null) {  
119 - report.setReportDashboardList(reportDashboardMap.get(report.getReportCode()));  
120 - }  
121 - if (reportDashboardWidgetMap.get(report.getReportCode()) != null) {  
122 - report.setReportDashboardWidgetList(reportDashboardWidgetMap.get(report.getReportCode()));  
123 - }  
124 - }  
125 //组合组件接口 122 //组合组件接口
126 Map<String, List<DataSet>> dataSetMap = dataSetList.stream().collect(Collectors.groupingBy(DataSet::getSetCode)); 123 Map<String, List<DataSet>> dataSetMap = dataSetList.stream().collect(Collectors.groupingBy(DataSet::getSetCode));
127 reportDashboardWidgetList.stream().filter(item -> item.getData().contains("setCode")).forEach(reportDashboardWidget -> { 124 reportDashboardWidgetList.stream().filter(item -> item.getData().contains("setCode")).forEach(reportDashboardWidget -> {
@@ -132,6 +129,11 @@ public class ExportServiceImpl implements ExportService { @@ -132,6 +129,11 @@ public class ExportServiceImpl implements ExportService {
132 } 129 }
133 } 130 }
134 }); 131 });
  132 +
  133 + //数据源
  134 + List<String> sourceCodeList = dataSetList.stream().map(DataSet::getSourceCode).distinct().collect(Collectors.toList());
  135 + List<DataSource> dataSourceList = dataSourceService.list(new LambdaQueryWrapper<DataSource>()
  136 + .in(DataSource::getSourceCode, sourceCodeList));
135 //组合接口参数转换数据源 137 //组合接口参数转换数据源
136 Map<String, List<DataSetTransform>> dataSetTransformMap = dataSetTransformList.stream().collect(Collectors.groupingBy(DataSetTransform::getSetCode)); 138 Map<String, List<DataSetTransform>> dataSetTransformMap = dataSetTransformList.stream().collect(Collectors.groupingBy(DataSetTransform::getSetCode));
137 Map<String, List<DataSetParam>> dataSetParamMap = dataSetParamList.stream().collect(Collectors.groupingBy(DataSetParam::getSetCode)); 139 Map<String, List<DataSetParam>> dataSetParamMap = dataSetParamList.stream().collect(Collectors.groupingBy(DataSetParam::getSetCode));