Commit 42093d33 authored by chenzhao's avatar chenzhao

修改代码

parent 667152af
...@@ -1474,9 +1474,6 @@ public class CommonServiceImpl { ...@@ -1474,9 +1474,6 @@ public class CommonServiceImpl {
if (!openHealth){ if (!openHealth){
return; return;
} }
Date time = new Date(); Date time = new Date();
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData(); List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData();
...@@ -1510,6 +1507,21 @@ public class CommonServiceImpl { ...@@ -1510,6 +1507,21 @@ public class CommonServiceImpl {
} }
while (totle == 0){
try {
SearchHits<ESEquipments> searchHits = elasticsearchTemplate.search(queryBuilder.build(), ESEquipments.class);
for (SearchHit searchHit : searchHits.getSearchHits()) {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent());
ESEquipments eSAlertCalled = JSONObject.toJavaObject(jsonObject, ESEquipments.class);
equipments.add(eSAlertCalled);
}
totle = searchHits.getTotalHits();
} catch (Exception e) {
// TODO: handle exception
}
}
for (IdxBizFanPointProcessVariableClassificationDto datum : data) { for (IdxBizFanPointProcessVariableClassificationDto datum : data) {
for (ESEquipments equipment : equipments) { for (ESEquipments equipment : equipments) {
if (equipment.getAddress().equals(datum.getIndexAddress()) && equipment.getGatewayId().equals(datum.getGatewayId())) { if (equipment.getAddress().equals(datum.getIndexAddress()) && equipment.getGatewayId().equals(datum.getGatewayId())) {
...@@ -1621,7 +1633,7 @@ public class CommonServiceImpl { ...@@ -1621,7 +1633,7 @@ public class CommonServiceImpl {
DoubleColumn.create("indexValue",indexValue), DoubleColumn.create("scoreValue",scoreValue)); DoubleColumn.create("indexValue",indexValue), DoubleColumn.create("scoreValue",scoreValue));
System.out.println(healthData.print()); System.out.println(healthData.print());
try { try {
healthData.write().csv(new Date().getTime()+".csv"); healthData.write().csv(new Date().getTime()+"fj.csv");
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
...@@ -1831,7 +1843,7 @@ public class CommonServiceImpl { ...@@ -1831,7 +1843,7 @@ public class CommonServiceImpl {
DoubleColumn.create("indexValue",indexValue), DoubleColumn.create("scoreValue",scoreValue)); DoubleColumn.create("indexValue",indexValue), DoubleColumn.create("scoreValue",scoreValue));
System.out.println(healthData.print()); System.out.println(healthData.print());
try { try {
healthData.write().csv(new Date().getTime()+".csv"); healthData.write().csv(new Date().getTime()+"gf.csv");
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment