|
|
|
|
|
package com.anjiplus.template.gaea.business.modules.dashboard.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
...
|
...
|
@@ -101,11 +100,7 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi |
|
|
}
|
|
|
GaeaBeanUtils.copyAndFormatter(reportDashboard, reportDashboardDto);
|
|
|
|
|
|
List<ReportDashboardWidget> list = reportDashboardWidgetService.list(
|
|
|
new QueryWrapper<ReportDashboardWidget>().lambda()
|
|
|
.eq(ReportDashboardWidget::getReportCode, reportCode)
|
|
|
.orderByAsc(ReportDashboardWidget::getSort)
|
|
|
);
|
|
|
List<ReportDashboardWidget> list = reportDashboardWidgetService.list(new QueryWrapper<ReportDashboardWidget>().lambda().eq(ReportDashboardWidget::getReportCode, reportCode).orderByAsc(ReportDashboardWidget::getSort));
|
|
|
List<ReportDashboardWidgetDto> reportDashboardWidgetDtoList = new ArrayList<>();
|
|
|
list.forEach(reportDashboardWidget -> {
|
|
|
ReportDashboardWidgetDto reportDashboardWidgetDto = new ReportDashboardWidgetDto();
|
...
|
...
|
@@ -155,8 +150,7 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi |
|
|
}
|
|
|
|
|
|
//删除reportDashboardWidget
|
|
|
reportDashboardWidgetService.delete(new QueryWrapper<ReportDashboardWidget>()
|
|
|
.lambda().eq(ReportDashboardWidget::getReportCode, reportCode));
|
|
|
reportDashboardWidgetService.delete(new QueryWrapper<ReportDashboardWidget>().lambda().eq(ReportDashboardWidget::getReportCode, reportCode));
|
|
|
List<ReportDashboardWidgetDto> widgets = dto.getWidgets();
|
|
|
|
|
|
// List<ReportDashboardWidget> reportDashboardWidgetList = new ArrayList<>();
|
...
|
...
|
@@ -191,6 +185,9 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi |
|
|
DataSetDto setDto = new DataSetDto();
|
|
|
setDto.setSetCode(dto.getSetCode());
|
|
|
setDto.setContextData(dto.getContextData());
|
|
|
|
|
|
log.info("请求数据参数:{}", setDto);
|
|
|
|
|
|
OriginalDataDto result = dataSetService.getData(setDto);
|
|
|
List<JSONObject> data = result.getData();
|
|
|
//处理时间轴
|
...
|
...
|
@@ -224,12 +221,10 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi |
|
|
//将涉及到的图片保存下来(1.背景图,2.组件为图片的)
|
|
|
String backgroundImage = detail.getDashboard().getBackgroundImage();
|
|
|
zipLoadImage(backgroundImage, path);
|
|
|
detail.getWidgets().stream()
|
|
|
.filter(reportDashboardWidgetDto -> "widget-image".equals(reportDashboardWidgetDto.getType()))
|
|
|
.forEach(reportDashboardWidgetDto -> {
|
|
|
String imageAddress = reportDashboardWidgetDto.getValue().getSetup().getString("imageAdress");
|
|
|
zipLoadImage(imageAddress, path);
|
|
|
});
|
|
|
detail.getWidgets().stream().filter(reportDashboardWidgetDto -> "widget-image".equals(reportDashboardWidgetDto.getType())).forEach(reportDashboardWidgetDto -> {
|
|
|
String imageAddress = reportDashboardWidgetDto.getValue().getSetup().getString("imageAdress");
|
|
|
zipLoadImage(imageAddress, path);
|
|
|
});
|
|
|
|
|
|
//showDataSet == 0 代表不包含数据集
|
|
|
if (0 == showDataSet) {
|
...
|
...
|
@@ -332,14 +327,12 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi |
|
|
//将涉及到的图片路径替换(1.背景图,2.组件为图片的)
|
|
|
String backgroundImage = detail.getDashboard().getBackgroundImage();
|
|
|
detail.getDashboard().setBackgroundImage(replaceUrl(backgroundImage, fileMap));
|
|
|
detail.getWidgets().stream()
|
|
|
.filter(reportDashboardWidgetDto -> "widget-image".equals(reportDashboardWidgetDto.getType()))
|
|
|
.forEach(reportDashboardWidgetDto -> {
|
|
|
String imageAddress = reportDashboardWidgetDto.getValue().getSetup().getString("imageAdress");
|
|
|
String address = replaceUrl(imageAddress, fileMap);
|
|
|
reportDashboardWidgetDto.getValue().getSetup().put("imageAdress", address);
|
|
|
reportDashboardWidgetDto.getOptions().getJSONArray("setup").getJSONObject(4).put("value", address);
|
|
|
});
|
|
|
detail.getWidgets().stream().filter(reportDashboardWidgetDto -> "widget-image".equals(reportDashboardWidgetDto.getType())).forEach(reportDashboardWidgetDto -> {
|
|
|
String imageAddress = reportDashboardWidgetDto.getValue().getSetup().getString("imageAdress");
|
|
|
String address = replaceUrl(imageAddress, fileMap);
|
|
|
reportDashboardWidgetDto.getValue().getSetup().put("imageAdress", address);
|
|
|
reportDashboardWidgetDto.getOptions().getJSONArray("setup").getJSONObject(4).put("value", address);
|
|
|
});
|
|
|
//将新的大屏编码赋值
|
|
|
detail.setReportCode(reportCode);
|
|
|
|
...
|
...
|
@@ -365,6 +358,7 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi |
|
|
|
|
|
/**
|
|
|
* 将大屏涉及到的图片存入指定文件夹
|
|
|
*
|
|
|
* @param imageAddress
|
|
|
* @param path
|
|
|
*/
|
...
|
...
|
|