瀏覽代碼

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_air_monitor into develop

tags/V1.0.1^2
chengwang 1 年之前
父節點
當前提交
42284b04f6
共有 4 個檔案被更改,包括 28 行新增6 行删除
  1. +4
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/AirData.java
  2. +1
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java
  3. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/ExportReportService.java
  4. +22
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java

+ 4
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/AirData.java 查看文件

@@ -212,6 +212,9 @@ public class AirData extends BaseEntity {
*/
private String hrch4;


/**
* 臭氧(单位ug/m3)
*/
private String o3;

}

+ 1
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java 查看文件

@@ -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();
}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/ExportReportService.java 查看文件

@@ -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()) {

+ 22
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java 查看文件

@@ -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;
}
}

Loading…
取消
儲存