|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.tuoheng.admin.service.airData.report; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
@@ -29,9 +30,9 @@ import java.io.File; |
|
|
|
import java.io.FileInputStream; |
|
|
|
import java.io.FileNotFoundException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
@@ -62,60 +63,36 @@ public class ExportReportService { |
|
|
|
return result; |
|
|
|
} |
|
|
|
AirDataType airDataType = airDataTypeMapper.selectOne(Wrappers.<AirDataType>lambdaQuery() |
|
|
|
.eq(AirDataType::getDataType,request.getAirDataType())); |
|
|
|
if(ObjectUtil.isNull(airDataType)){ |
|
|
|
return JsonResult.error("大气数据类型为空"); |
|
|
|
.eq(AirDataType::getDataType, request.getAirDataType()) |
|
|
|
.eq(AirDataType::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isEmpty(airDataType)) { |
|
|
|
log.info("导出报告,大气类型不存在,airDataType={}", request.getAirDataType()); |
|
|
|
throw new ServiceException("大气类型不存在"); |
|
|
|
} |
|
|
|
AirDataExport airDataExport = this.checkAirDataExport(request,airDataType); |
|
|
|
AirDataExport airDataExport = this.checkAirDataExport(request, airDataType); |
|
|
|
if (ObjectUtil.isNotEmpty(airDataExport)) { |
|
|
|
return JsonResult.success(airDataExport.getOssUrl(), "导出成功"); |
|
|
|
} |
|
|
|
Inspection inspection = (Inspection) result.getData(); |
|
|
|
|
|
|
|
|
|
|
|
String filename = inspection.getName() + "-" + inspection.getCode() + "-" + airDataType.getDataType() + ".doc"; |
|
|
|
List<AirData> airDataList = airDataMapper.selectList(Wrappers.<AirData>lambdaQuery() |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.orderByAsc(AirData::getCreateTime)); |
|
|
|
String detectionTime = ""; |
|
|
|
if (CollectionUtil.isNotEmpty(airDataList)) { |
|
|
|
detectionTime = this.getDetectionTime(airDataList); |
|
|
|
this.handle(request, airDataType, airDataList); |
|
|
|
} |
|
|
|
String filename = inspection.getName() + "-" + inspection.getCode() + "-" + airDataType.getDataType() + ".doc"; |
|
|
|
String filePath = UploadFileConfig.uploadFolder + "/report/" + filename; |
|
|
|
File fd = new File(UploadFileConfig.uploadFolder + "/report"); |
|
|
|
if (!fd.exists()) { |
|
|
|
fd.mkdirs(); |
|
|
|
} |
|
|
|
AirData beginAirData = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getCUtcTime) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData endAirData = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getCUtcTime) |
|
|
|
.last(" limit 1")); |
|
|
|
|
|
|
|
//根据大气数据类型进行判断 |
|
|
|
Map<String, String> dataTypeMap = this.getData(airDataType, request); |
|
|
|
|
|
|
|
// 生成word |
|
|
|
File f = new File(filePath); |
|
|
|
if (!f.exists() || f.length() < 1000) { |
|
|
|
String detectionTime = ""; |
|
|
|
if (ObjectUtil.isNotEmpty(beginAirData)) { |
|
|
|
detectionTime += beginAirData.getCUtcTime(); |
|
|
|
} |
|
|
|
detectionTime += "至"; |
|
|
|
if (ObjectUtil.isNotEmpty(endAirData)) { |
|
|
|
detectionTime += endAirData.getCUtcTime(); |
|
|
|
} |
|
|
|
String dataTypeMin = ""; |
|
|
|
String dataTypeMax = ""; |
|
|
|
String dataTypeCount = ""; |
|
|
|
String dataTypeAvg = ""; |
|
|
|
|
|
|
|
if(!dataTypeMap.isEmpty()){ |
|
|
|
dataTypeMin = dataTypeMap.get("min"); |
|
|
|
dataTypeMax = dataTypeMap.get("max"); |
|
|
|
dataTypeCount = dataTypeMap.get("count"); |
|
|
|
dataTypeAvg = dataTypeMap.get("avg"); |
|
|
|
} |
|
|
|
result = generateReportWordService.buildWord(filePath, request, airDataType, detectionTime, dataTypeMin,dataTypeMax,dataTypeCount,dataTypeAvg,inspection.getEquipmentMountCode()); |
|
|
|
result = generateReportWordService.buildWord(filePath, request, airDataType, detectionTime, inspection.getEquipmentMountCode()); |
|
|
|
if (0 != result.getCode()) { |
|
|
|
log.info("导出报告业务:生成word失败:{}", result.getMsg()); |
|
|
|
return result; |
|
|
@@ -134,182 +111,6 @@ public class ExportReportService { |
|
|
|
return JsonResult.success(ossUrl, "导出成功"); |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, String> getData(AirDataType airDataType, ExportReportRequest request) { |
|
|
|
List<AirData> airDataList = airDataMapper.selectList(Wrappers.<AirData>lambdaQuery() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode())); |
|
|
|
Integer count = Math.toIntExact(airDataList.stream().count()); |
|
|
|
String dataTypeCount = String.valueOf(count); |
|
|
|
|
|
|
|
String dataType = airDataType.getDataType(); |
|
|
|
//判断dataType值是哪一个 |
|
|
|
Map<String,String> dataTypeMap = new HashMap<>(); |
|
|
|
if(dataType.equals("co")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getCo) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getCo) |
|
|
|
.last(" limit 1")); |
|
|
|
Double co = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getCo()); |
|
|
|
co += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(co / count); |
|
|
|
String coMax = airDataMax.getCo(); |
|
|
|
String coMin = airDataMin.getCo(); |
|
|
|
dataTypeMap.put("min",coMin); |
|
|
|
dataTypeMap.put("max",coMax); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
|
|
|
|
} |
|
|
|
if(dataType.equals("pm_10")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getPm10) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getPm10) |
|
|
|
.last(" limit 1")); |
|
|
|
String pm10Max = airDataMax.getPm10(); |
|
|
|
String pm10Min = airDataMin.getPm10(); |
|
|
|
Double pm10 = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getPm10()); |
|
|
|
pm10 += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(pm10 / count); |
|
|
|
dataTypeMap.put("min",pm10Min); |
|
|
|
dataTypeMap.put("max",pm10Max); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
} |
|
|
|
if(dataType.equals("pm_2_5")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getPm25) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getPm25) |
|
|
|
.last(" limit 1")); |
|
|
|
Double pm25 = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getPm25()); |
|
|
|
pm25 += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(pm25 / count); |
|
|
|
String pm25Max = airDataMax.getPm25(); |
|
|
|
String pm25Min = airDataMin.getPm25(); |
|
|
|
dataTypeMap.put("min",pm25Min); |
|
|
|
dataTypeMap.put("max",pm25Max); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
} |
|
|
|
if(dataType.equals("so2")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getSo2) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getSo2) |
|
|
|
.last(" limit 1")); |
|
|
|
Double so2 = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getSo2()); |
|
|
|
so2 += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(so2 / count); |
|
|
|
String so2Max = airDataMax.getSo2(); |
|
|
|
String so2Min = airDataMin.getSo2(); |
|
|
|
dataTypeMap.put("min",so2Min); |
|
|
|
dataTypeMap.put("max",so2Max); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
} |
|
|
|
if(dataType.equals("vocs")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getVocs) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getVocs) |
|
|
|
.last(" limit 1")); |
|
|
|
String vocsMax = airDataMax.getVocs(); |
|
|
|
String vocsMin = airDataMin.getVocs(); |
|
|
|
Double vocs = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getVocs()); |
|
|
|
vocs += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(vocs / count); |
|
|
|
dataTypeMap.put("min",vocsMin); |
|
|
|
dataTypeMap.put("max",vocsMax); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
} |
|
|
|
if(dataType.equals("no2")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getNo2) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getNo2) |
|
|
|
.last(" limit 1")); |
|
|
|
Double no2 = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getNo2()); |
|
|
|
no2 += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(no2 / count); |
|
|
|
String no2Max = airDataMax.getNo2(); |
|
|
|
String no2Min = airDataMin.getNo2(); |
|
|
|
dataTypeMap.put("min",no2Min); |
|
|
|
dataTypeMap.put("max",no2Max); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
} |
|
|
|
if(dataType.equals("o3")){ |
|
|
|
AirData airDataMax = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(AirData::getO3) |
|
|
|
.last(" limit 1")); |
|
|
|
AirData airDataMin = airDataMapper.selectOne(new LambdaQueryWrapper<AirData>() |
|
|
|
.eq(AirData::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByAsc(AirData::getO3) |
|
|
|
.last(" limit 1")); |
|
|
|
Double o3 = null; |
|
|
|
for (AirData airData : airDataList) { |
|
|
|
double tempCo = Double.parseDouble(airData.getO3()); |
|
|
|
o3 += tempCo; |
|
|
|
} |
|
|
|
String ndAvg = String.valueOf(o3 / count); |
|
|
|
String o3Max = airDataMax.getO3(); |
|
|
|
String o3Min = airDataMin.getO3(); |
|
|
|
dataTypeMap.put("min",o3Min); |
|
|
|
dataTypeMap.put("max",o3Max); |
|
|
|
dataTypeMap.put("avg",ndAvg); |
|
|
|
} |
|
|
|
dataTypeMap.put("count",dataTypeCount); |
|
|
|
return dataTypeMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 检查参数 |
|
|
|
* |
|
|
@@ -337,20 +138,102 @@ public class ExportReportService { |
|
|
|
return JsonResult.success(inspection); |
|
|
|
} |
|
|
|
|
|
|
|
private AirDataExport checkAirDataExport(ExportReportRequest request,AirDataType airDataType) { |
|
|
|
private AirDataExport checkAirDataExport(ExportReportRequest request, AirDataType airDataType) { |
|
|
|
AirDataExport airDataExport = airDataExportMapper.selectOne(new LambdaQueryWrapper<AirDataExport>() |
|
|
|
.eq(AirDataExport::getInspectionId, request.getInspectionId()) |
|
|
|
.eq(AirDataExport::getAirDataTypeId, airDataType.getId()) |
|
|
|
.eq(AirDataExport::getExportType, "report") |
|
|
|
.eq(AirDataExport::getGridSize, request.getGridSize()) |
|
|
|
.eq(AirDataExport::getMark, MarkEnum.VALID.getCode())); |
|
|
|
.eq(AirDataExport::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.last("limit 1")); |
|
|
|
return airDataExport; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param airDataList |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private String getDetectionTime(List<AirData> airDataList) { |
|
|
|
AirData beginAirData = airDataList.get(0); |
|
|
|
AirData endAirData = airDataList.get(airDataList.size() - 1); |
|
|
|
String detectionTime = ""; |
|
|
|
if (ObjectUtil.isNotEmpty(beginAirData)) { |
|
|
|
detectionTime += beginAirData.getCUtcTime(); |
|
|
|
} |
|
|
|
detectionTime += "至"; |
|
|
|
if (ObjectUtil.isNotEmpty(endAirData)) { |
|
|
|
detectionTime += endAirData.getCUtcTime(); |
|
|
|
} |
|
|
|
return detectionTime; |
|
|
|
} |
|
|
|
|
|
|
|
private void handle(ExportReportRequest request, AirDataType airDataType, List<AirData> airDataList) { |
|
|
|
List<Double> list = null; |
|
|
|
AirData airDataMax = null; |
|
|
|
AirData airDataMin = null; |
|
|
|
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(); |
|
|
|
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(); |
|
|
|
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(); |
|
|
|
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(); |
|
|
|
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(); |
|
|
|
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(); |
|
|
|
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(); |
|
|
|
singlePointConcentrationMax = airDataMax.getO3(); |
|
|
|
singlePointConcentrationMin = airDataMin.getO3(); |
|
|
|
} else { |
|
|
|
log.info("大气类型,暂不提供, airDataType={}", airDataType.getDataType()); |
|
|
|
return; |
|
|
|
} |
|
|
|
double average = list.stream().collect(Collectors.averagingDouble(Double::doubleValue)); |
|
|
|
String averageConcentration = average + airDataType.getUnit(); |
|
|
|
singlePointConcentrationMax = singlePointConcentrationMax + " " + airDataType.getUnit() + "(" + airDataMax.getLongitude() + "E, " + airDataMax.getLatitude() + "N) " + airDataMax.getCUtcTime(); |
|
|
|
singlePointConcentrationMin = singlePointConcentrationMin + " " + airDataType.getUnit() + "(" + airDataMin.getLongitude() + "E, " + airDataMin.getLatitude() + "N) " + airDataMin.getCUtcTime(); |
|
|
|
|
|
|
|
request.setSamplingPointsNum(String.valueOf(airDataList.size())); |
|
|
|
request.setAverageConcentration(averageConcentration); |
|
|
|
request.setSinglePointConcentrationMax(singlePointConcentrationMax); |
|
|
|
request.setSinglePointConcentrationMin(singlePointConcentrationMin); |
|
|
|
} |
|
|
|
|
|
|
|
private String uploadOss(String filePath, String filename) { |
|
|
|
File file = new File(filePath); |
|
|
|
InputStream in = null; |
|
|
|
String fileUrl = ""; |
|
|
|
InputStream in; |
|
|
|
String fileUrl; |
|
|
|
try { |
|
|
|
in = new FileInputStream(file); |
|
|
|
aliyunOSSUtil.uploadFile2OSS(in, filename); |