fix(X-Pack): 定时报告导出视图名称相同失败

This commit is contained in:
fit2cloud-chenyw 2024-06-03 12:14:27 +08:00
parent 6598ad5986
commit 8ef998b03b
2 changed files with 8 additions and 4 deletions

View File

@ -54,14 +54,18 @@ public class CoreVisualizationExportManage {
}
if (CollectionUtils.isEmpty(chartViewDTOS)) return null;
Map<String, ChartExtRequest> chartExtRequestMap = buildViewRequest(visualization, onlyDisplay);
List<ExcelSheetModel> sheets = chartViewDTOS.stream().map(view -> {
List<ExcelSheetModel> sheets = new ArrayList<>();
for (int i = 0; i < chartViewDTOS.size(); i++) {
ChartViewDTO view = chartViewDTOS.get(i);
ChartExtRequest extRequest = chartExtRequestMap.get(view.getId().toString());
if (ObjectUtils.isNotEmpty(extRequest)) {
view.setChartExtRequest(extRequest);
}
view.getChartExtRequest().setUser(AuthUtils.getUser().getUserId());
return exportViewData(view);
}).toList();
view.setTitle((i + 1) + "-" + view.getTitle());
sheets.add(exportViewData(view));
}
return VisualizationExcelUtils.exportExcel(sheets, visualization.getName(), visualization.getId().toString());
}

@ -1 +1 @@
Subproject commit e22c8ef0d999bdf902fd8b5f537c0830d5261b7a
Subproject commit 0cf469c20f184e57c2e7e88e99896b2f6baed265