Selaa lähdekoodia

1、修改no2,ox,o3计算公式;2、修改vocs导出表格中单位为ppm;

tags/v1.0.3^2^2
wanjing 11 kuukautta sitten
vanhempi
commit
3b8da14d92
2 muutettua tiedostoa jossa 27 lisäystä ja 14 poistoa
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/constant/SystemConstant.java
  2. +26
    -13
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/constant/SystemConstant.java Näytä tiedosto

* 表格表头集1 * 表格表头集1
*/ */
String[] EXCEL_SECOND_NAME = {"采样点时间","海拔高度m","经度", String[] EXCEL_SECOND_NAME = {"采样点时间","海拔高度m","经度",
"纬度","SO2 μg/m³","CO mg/m³","NO2 μg/m³","O3 μg/m³","VOCS μg/m³","PM2.5 μg/m³","PM10 μg/m³",
"纬度","SO2 μg/m³","CO mg/m³","NO2 μg/m³","O3 μg/m³","VOCS ppm","PM2.5 μg/m³","PM10 μg/m³",
"设备序列号","序号"}; "设备序列号","序号"};


/** /**

+ 26
- 13
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java Näytä tiedosto

String odorOu = this.getValue(airDataMap, "Odor OU"); // 恶臭气体 String odorOu = this.getValue(airDataMap, "Odor OU"); // 恶臭气体
String hrch4 = this.getValue(airDataMap, "[HR]CH4(ppm)"); // [HR]甲烷(ppm) 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.setCl2(cl2);
airData.setCo(co); airData.setCo(co);
airData.setCo2(co2); airData.setCo2(co2);
airData.setNo(no); airData.setNo(no);
airData.setOdorOu(odorOu); airData.setOdorOu(odorOu);
airData.setHrch4(hrch4); airData.setHrch4(hrch4);
airData.setO3(this.getO3(ox, no2));
airData.setO3(o3);
airData.setCreateTime(DateUtils.now()); airData.setCreateTime(DateUtils.now());
airData.setCreateUser("0"); airData.setCreateUser("0");
Integer count = airDataMapper.insert(airData); Integer count = airDataMapper.insert(airData);
} }
} }


private String getO3(String ox, String no2) {
String o3 = "";
private String getOx(String ox) {
if (StringUtils.isEmpty(ox)) { if (StringUtils.isEmpty(ox)) {
if (StringUtils.isNotEmpty(no2)) {
o3 = "-" + no2;
}
return "0.0";
} else { } 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) { private String getSo2(String so2) {
} }
} }


private String getO3(String ox, String no2) {
Double o3d = Double.parseDouble(ox) - Double.parseDouble(no2);
String o3 = String.valueOf(o3d);
return o3;
}

} }

Loading…
Peruuta
Tallenna