@@ -212,6 +212,9 @@ public class AirData extends BaseEntity { | |||
*/ | |||
private String hrch4; | |||
/** | |||
* 臭氧(单位ug/m3) | |||
*/ | |||
private String o3; | |||
} |
@@ -75,10 +75,8 @@ public class MqttProviderConfig { | |||
client.setCallback(new MqttConsumerCallBack()); | |||
client.connect(options); | |||
// client.subscribe("$share/g1/v1/123456/environment/message", 0); | |||
client.subscribe("$share/g1/v1/298dd766/environment/message", 0); | |||
QueryWrapper wrapper = new QueryWrapper(); | |||
wrapper.eq("mark", 1); | |||
} catch (MqttException e) { | |||
e.printStackTrace(); | |||
} |
@@ -66,7 +66,7 @@ public class ExportReportService { | |||
Inspection inspection = (Inspection) result.getData(); | |||
AirDataType airDataType = airDataTypeMapper.selectById(request.getAirDataTypeId()); | |||
String filename = inspection.getCode() + "-" + airDataType.getDataType() + "(" +request.getGridSize() + ")浓度分布报告" + ".doc"; | |||
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()) { |
@@ -110,6 +110,7 @@ public class SyncAirDataService { | |||
airData.setNo(no); | |||
airData.setOdorOu(odorOu); | |||
airData.setHrch4(hrch4); | |||
airData.setO3(this.getO3(ox, no2)); | |||
airData.setCreateTime(DateUtils.now()); | |||
airData.setCreateUser("0"); | |||
Integer count = airDataMapper.insert(airData); | |||
@@ -155,7 +156,27 @@ public class SyncAirDataService { | |||
} | |||
private String getValue(Map<String, Object> airDataMap, String key) { | |||
return airDataMap.get(key) == null ? "" : (String) airDataMap.get(key); | |||
if (airDataMap.containsKey(key)) { | |||
return airDataMap.get(key) == null ? "" : (String) airDataMap.get(key).toString(); | |||
} else { | |||
return ""; | |||
} | |||
} | |||
private String getO3(String ox, String no2) { | |||
String o3 = ""; | |||
if (StringUtils.isEmpty(ox)) { | |||
if (StringUtils.isNotEmpty(no2)) { | |||
o3 = "-" + no2; | |||
} | |||
} else { | |||
if (StringUtils.isNotEmpty(no2)) { | |||
Double o3d = Double.parseDouble(ox) - Double.parseDouble(no2); | |||
o3 = String.valueOf(o3d); | |||
} else { | |||
o3 = ox; | |||
} | |||
} | |||
return o3; | |||
} | |||
} |