|
|
@@ -92,6 +92,10 @@ public class SyncAirDataService { |
|
|
|
String odorOu = this.getValue(airDataMap, "Odor OU"); // 恶臭气体 |
|
|
|
String hrch4 = this.getValue(airDataMap, "[HR]CH4(ppm)"); // [HR]甲烷(ppm) |
|
|
|
|
|
|
|
ox = this.getOx(ox); |
|
|
|
no2 = this.getNo2(no2); |
|
|
|
String o3 = this.getO3(ox, no2); |
|
|
|
|
|
|
|
airData.setCl2(cl2); |
|
|
|
airData.setCo(co); |
|
|
|
airData.setCo2(co2); |
|
|
@@ -116,7 +120,7 @@ public class SyncAirDataService { |
|
|
|
airData.setNo(no); |
|
|
|
airData.setOdorOu(odorOu); |
|
|
|
airData.setHrch4(hrch4); |
|
|
|
airData.setO3(this.getO3(ox, no2)); |
|
|
|
airData.setO3(o3); |
|
|
|
airData.setCreateTime(DateUtils.now()); |
|
|
|
airData.setCreateUser("0"); |
|
|
|
Integer count = airDataMapper.insert(airData); |
|
|
@@ -180,21 +184,24 @@ public class SyncAirDataService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private String getO3(String ox, String no2) { |
|
|
|
String o3 = ""; |
|
|
|
private String getOx(String ox) { |
|
|
|
if (StringUtils.isEmpty(ox)) { |
|
|
|
if (StringUtils.isNotEmpty(no2)) { |
|
|
|
o3 = "-" + no2; |
|
|
|
} |
|
|
|
return "0.0"; |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotEmpty(no2)) { |
|
|
|
Double o3d = Double.parseDouble(ox) - Double.parseDouble(no2); |
|
|
|
o3 = String.valueOf(o3d); |
|
|
|
} else { |
|
|
|
o3 = ox; |
|
|
|
} |
|
|
|
Double value = Double.valueOf(ox); |
|
|
|
value = value * 1000 * 48.00 / 22.4; |
|
|
|
return String.valueOf(value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private String getNo2(String no2) { |
|
|
|
if (StringUtils.isEmpty(no2)) { |
|
|
|
return "0.0"; |
|
|
|
} else { |
|
|
|
Double value = Double.valueOf(no2); |
|
|
|
value = value * 1000 * 46.01 / 22.4; |
|
|
|
return String.valueOf(value); |
|
|
|
} |
|
|
|
return o3; |
|
|
|
} |
|
|
|
|
|
|
|
private String getSo2(String so2) { |
|
|
@@ -207,4 +214,10 @@ public class SyncAirDataService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private String getO3(String ox, String no2) { |
|
|
|
Double o3d = Double.parseDouble(ox) - Double.parseDouble(no2); |
|
|
|
String o3 = String.valueOf(o3d); |
|
|
|
return o3; |
|
|
|
} |
|
|
|
|
|
|
|
} |