|
|
@@ -798,6 +798,18 @@ public class AppDeviceService {
|
|
|
// 并行构建导出数据列表
|
|
|
Map<String, List<ExportParam>> exportDataMap = buildExportDataParallel(
|
|
|
monitorTargetRegion, trendParam, sensorEchartDataResult);
|
|
|
+ //指定指标则只需要单个指标
|
|
|
+ Map<String, List<ExportParam>> finalExportDataMap = new HashMap<>(8);
|
|
|
+ if (StrUtil.isNotBlank(trendParam.getType())) {
|
|
|
+ for (Map.Entry<String, List<ExportParam>> entry : exportDataMap.entrySet()) {
|
|
|
+ if (StrUtil.equals(entry.getKey(), trendParam.getType())) {
|
|
|
+ finalExportDataMap.put(entry.getKey(), entry.getValue());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ finalExportDataMap = exportDataMap;
|
|
|
+ }
|
|
|
// 温度导出参数
|
|
|
List<ExportParam> tempExportParamList = exportDataMap.get("temperature");
|
|
|
// 湿度导出参数
|
|
|
@@ -845,7 +857,7 @@ public class AppDeviceService {
|
|
|
|
|
|
// 生成PDF报告
|
|
|
generatePdfReport(response, file, monitorTargetRegion, trendParam,
|
|
|
- sensorEchartDataResult, statsMap, exportDataMap);
|
|
|
+ sensorEchartDataResult, statsMap, finalExportDataMap);
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException("PDF生成失败", e);
|
|
|
}
|
|
|
@@ -1814,7 +1826,7 @@ public class AppDeviceService {
|
|
|
value += "°C";
|
|
|
} else if (type.equals("S")) {
|
|
|
value += "%";
|
|
|
- } else if (type.equals("C")){
|
|
|
+ } else if (type.equals("C")) {
|
|
|
value += "ppm";
|
|
|
}
|
|
|
dataTable.addCell(new Cell().add(new Paragraph(value).setFont(font)));
|