Browse Source

Merge branch 'develop' of gitadmin/tuoheng_air_monitor into release

tags/V1.0.1
wanjing 1 year ago
parent
commit
e5ca9b6107
3 changed files with 23 additions and 26 deletions
  1. +21
    -21
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/ExportReportService.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/GenerateReportWordService.java
  3. +1
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionListDataService.java

+ 21
- 21
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/ExportReportService.java View File

@@ -179,45 +179,45 @@ public class ExportReportService {
String singlePointConcentrationMax = "";
String singlePointConcentrationMin = "";
if ("co".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getCo())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getCo()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getCo()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getCo().isEmpty()).map(p -> Double.parseDouble(p.getCo())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getCo().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getCo()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getCo().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getCo()))).get();
singlePointConcentrationMax = airDataMax.getCo();
singlePointConcentrationMin = airDataMin.getCo();
} else if ("pm_10".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getPm10())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getPm10()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getPm10()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getPm10().isEmpty()).map(p -> Double.parseDouble(p.getPm10())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getPm10().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getPm10()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getPm10().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getPm10()))).get();
singlePointConcentrationMax = airDataMax.getPm10();
singlePointConcentrationMin = airDataMin.getPm10();
} else if ("pm_2_5".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getPm25())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getPm25()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getPm25()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getPm25().isEmpty()).map(p -> Double.parseDouble(p.getPm25())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getPm25().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getPm25()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getPm25().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getPm25()))).get();
singlePointConcentrationMax = airDataMax.getPm25();
singlePointConcentrationMin = airDataMin.getPm25();
} else if ("so2".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getSo2())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getSo2()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getSo2()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getSo2().isEmpty()).map(p -> Double.parseDouble(p.getSo2())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getSo2().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getSo2()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getSo2().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getSo2()))).get();
singlePointConcentrationMax = airDataMax.getSo2();
singlePointConcentrationMin = airDataMin.getSo2();
} else if ("vocs".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getVocs())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getVocs()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getVocs()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getVocs().isEmpty()).map(p -> Double.parseDouble(p.getVocs())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getVocs().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getVocs()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getVocs().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getVocs()))).get();
singlePointConcentrationMax = airDataMax.getVocs();
singlePointConcentrationMin = airDataMin.getVocs();
} else if ("no2".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getNo2())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getNo2()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getNo2()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getNo2().isEmpty()).map(p -> Double.parseDouble(p.getNo2())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getNo2().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getNo2()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getNo2().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getNo2()))).get();
singlePointConcentrationMax = airDataMax.getNo2();
singlePointConcentrationMin = airDataMin.getNo2();
} else if ("o3".equals(airDataType.getDataType())) {
list = airDataList.stream().map(p -> Double.parseDouble(p.getO3())).collect(Collectors.toList());
airDataMax = airDataList.stream().max(Comparator.comparing(x -> Double.parseDouble(x.getO3()))).get();
airDataMin = airDataList.stream().min(Comparator.comparing(x -> Double.parseDouble(x.getO3()))).get();
list = airDataList.stream().filter(x -> x != null && !x.getO3().isEmpty()).map(p -> Double.parseDouble(p.getO3())).collect(Collectors.toList());
airDataMax = airDataList.stream().filter(x -> x != null && !x.getO3().isEmpty()).max(Comparator.comparing(x -> Double.parseDouble(x.getO3()))).get();
airDataMin = airDataList.stream().filter(x -> x != null && !x.getO3().isEmpty()).min(Comparator.comparing(x -> Double.parseDouble(x.getO3()))).get();
singlePointConcentrationMax = airDataMax.getO3();
singlePointConcentrationMin = airDataMin.getO3();
} else {

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/GenerateReportWordService.java View File

@@ -52,7 +52,7 @@ public class GenerateReportWordService {
wordUtils.insertContext(airDataType.getDataType() + "网格浓度最小值:" + request.getGridConcentrationMix(), 10, Font.NORMAL, Element.ALIGN_LEFT, 20, 2, 2);
wordUtils.insertContext(airDataType.getDataType() + "单点浓度最高值:" + request.getSinglePointConcentrationMax(), 10, Font.NORMAL, Element.ALIGN_LEFT, 20, 2, 2);
wordUtils.insertContext(airDataType.getDataType() + "单点浓度最低值:" + request.getSinglePointConcentrationMin(), 10, Font.NORMAL, Element.ALIGN_LEFT, 20, 2, 2);
wordUtils.insertImg(request.getOssUrl(), Image.ALIGN_CENTER, 500, 400, 100, 100, 100, 0);
wordUtils.insertImg(request.getOssUrl(), Image.ALIGN_CENTER, 500, 400, 100, 40, 40, 0);
wordUtils.insertImg(airDataType.getReferenceIndicatorHorizontalImage(), Image.ALIGN_CENTER, 500, 10, 100, 10, 10, 0);
} catch (DocumentException e) {
log.info("生成报告word异常");

+ 1
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionListDataService.java View File

@@ -1,10 +1,7 @@
package com.tuoheng.admin.service.inspection.query;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.domain.Inspection;
import com.tuoheng.admin.entity.domain.User;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.common.core.utils.JsonResult;
@@ -39,7 +36,7 @@ public class QueryInspectionListDataService {
return JsonResult.error("查询任务数据失败");
}
List<Inspection> inspectionsList = inspectionMapper.selectInspectionList(tenantId);
log.info("查询出来任务列表:{}",inspectionsList);
// log.info("查询出来任务列表:{}",inspectionsList);
return JsonResult.success(inspectionsList);
}


Loading…
Cancel
Save