Commit c0a4bd08 authored by chenzhao's avatar chenzhao

修改代码

parent c4524de3
...@@ -66,7 +66,7 @@ public class IdxBizPvPointProcessVariableClassificationDto { ...@@ -66,7 +66,7 @@ public class IdxBizPvPointProcessVariableClassificationDto {
private String tagCode; private String tagCode;
@TableField("POINT_ID") @TableField("POINT_ID")
private Integer pointId; private String pointId;
@ApiModelProperty(value = "片区") @ApiModelProperty(value = "片区")
@TableField("ARAE") @TableField("ARAE")
......
...@@ -139,7 +139,7 @@ public class IdxBizFanHealthIndex { ...@@ -139,7 +139,7 @@ public class IdxBizFanHealthIndex {
* *
*/ */
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Integer gatewayId; private String gatewayId;
/** /**
* 点表地址 * 点表地址
......
...@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode; ...@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* *
...@@ -39,7 +40,7 @@ public class IdxBizFanHealthLevel{ ...@@ -39,7 +40,7 @@ public class IdxBizFanHealthLevel{
* *
*/ */
@TableField("REC_DATE") @TableField("REC_DATE")
private LocalDateTime recDate; private Date recDate;
/** /**
* *
......
...@@ -111,7 +111,7 @@ public class IdxBizFanWarningRecord{ ...@@ -111,7 +111,7 @@ public class IdxBizFanWarningRecord{
* 网关ID * 网关ID
*/ */
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Integer gatewayId; private String gatewayId;
/** /**
* 点表地址 * 点表地址
......
...@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode; ...@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* *
...@@ -39,7 +40,7 @@ public class IdxBizPvPointVarCentralValue{ ...@@ -39,7 +40,7 @@ public class IdxBizPvPointVarCentralValue{
* *
*/ */
@TableField("REC_DATE") @TableField("REC_DATE")
private LocalDateTime recDate; private Date recDate;
/** /**
* *
...@@ -147,14 +148,6 @@ public class IdxBizPvPointVarCentralValue{ ...@@ -147,14 +148,6 @@ public class IdxBizPvPointVarCentralValue{
@TableField("PROCESS3_MIN") @TableField("PROCESS3_MIN")
private Double process3Min; private Double process3Min;
@TableField("PROCESS1_MAX")
private Double process1Max;
/**
*
*/
@TableField("PROCESS1_MIN")
private Double process1Min;
/** /**
* *
*/ */
...@@ -188,7 +181,7 @@ public class IdxBizPvPointVarCentralValue{ ...@@ -188,7 +181,7 @@ public class IdxBizPvPointVarCentralValue{
/** /**
* *
*/ */
@TableField("ANALYSIS_POINT_ID_NAME") @TableField("ANALYSIS_POINT_NAME")
private String analysisPointIdName; private String analysisPointIdName;
/** /**
......
...@@ -913,10 +913,14 @@ public class CommonServiceImpl { ...@@ -913,10 +913,14 @@ public class CommonServiceImpl {
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey1, values); realParams.put(gkzxzjskey1, values);
String response = HttpUtil.createPost(baseUrl + jkzsjsfjurl).body(JSON.toJSONString(realParams)).execute().body(); String response = HttpUtil.createPost(baseUrl + jkzsjsfjurl).body(JSON.toJSONString(realParams)).execute().body();
logger.info("--------------------repsonse: "+response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
JSONObject result = JSON.parseObject(response).getJSONObject("result"); JSONObject result = JSON.parseObject(response).getJSONObject("result");
if (null != result){ if (null != result){
JSONObject jsonObject =result .getJSONObject("result1").getJSONObject("rows"); JSONArray jsonArray = result.getJSONObject("result1").getJSONArray("rows");
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(jsonObject), JSONObject.class); List<JSONObject> jsonObjects = jsonArray.toJavaList(JSONObject.class);
String s = JSON.toJSONString(result.getJSONObject("result1").getString("rows"));
// List<JSONObject> jsonObjects = JSON.parseArray(s, JSONObject.class);
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
jsonObjects.stream().forEach(e-> ids.add(e.getString("analysisVariableId"))); jsonObjects.stream().forEach(e-> ids.add(e.getString("analysisVariableId")));
...@@ -928,7 +932,7 @@ public class CommonServiceImpl { ...@@ -928,7 +932,7 @@ public class CommonServiceImpl {
for (JSONObject object : jsonObjects) { for (JSONObject object : jsonObjects) {
if (obj.getSequenceNbr().equals(object.getString("analysisVariableId"))){ if (obj.getSequenceNbr().equals(object.getString("analysisVariableId"))){
IdxBizFanHealthIndex idxBizFanHealthIndex = new IdxBizFanHealthIndex(); IdxBizFanHealthIndex idxBizFanHealthIndex = new IdxBizFanHealthIndex();
BeanUtils.copyProperties(idxBizFanHealthIndex,obj); BeanUtils.copyProperties(obj,idxBizFanHealthIndex);
idxBizFanHealthIndex.setHealthIndex(object.getDouble("indexValue")); idxBizFanHealthIndex.setHealthIndex(object.getDouble("indexValue"));
idxBizFanHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr()); idxBizFanHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr());
idxBizFanHealthIndex.setRecDate(new Date()); idxBizFanHealthIndex.setRecDate(new Date());
...@@ -939,6 +943,7 @@ public class CommonServiceImpl { ...@@ -939,6 +943,7 @@ public class CommonServiceImpl {
query.le(IdxBizFanHealthLevel::getGroupLowerLimit,object.getDouble("indexValue")); query.le(IdxBizFanHealthLevel::getGroupLowerLimit,object.getDouble("indexValue"));
query.ge(IdxBizFanHealthLevel::getGroupUpperLimit,object.getDouble("indexValue")); query.ge(IdxBizFanHealthLevel::getGroupUpperLimit,object.getDouble("indexValue"));
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query); IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
idxBizFanHealthIndex.setSequenceNbr(null);
idxBizFanHealthIndex.setHealthLevel(idxBizFanHealthLevel.getHealthLevel()); idxBizFanHealthIndex.setHealthLevel(idxBizFanHealthLevel.getHealthLevel());
idxBizFanHealthIndex.setAnalysisType("按时刻"); idxBizFanHealthIndex.setAnalysisType("按时刻");
idxBizFanHealthIndex.setANOMALY(object.getDouble("scoreValue")); idxBizFanHealthIndex.setANOMALY(object.getDouble("scoreValue"));
...@@ -949,12 +954,6 @@ public class CommonServiceImpl { ...@@ -949,12 +954,6 @@ public class CommonServiceImpl {
idxBizFanHealthIndexService.saveBatch(idxBizFanHealthIndexs); idxBizFanHealthIndexService.saveBatch(idxBizFanHealthIndexs);
} }
try {
logger.info("--------------------repsonse: "+response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
} }
......
...@@ -268,8 +268,8 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -268,8 +268,8 @@ public class HealthStatusIndicatorServiceImpl {
wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate); wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate);
List<IdxBizFanHealthIndex> healthIndices = idxBizFanHealthIndexMapper.selectList(wrapper); List<IdxBizFanHealthIndex> healthIndices = idxBizFanHealthIndexMapper.selectList(wrapper);
Map<Integer, Map<String, List<IdxBizFanHealthIndex>>> gateWayMaps = healthIndices.stream().collect(Collectors.groupingBy(IdxBizFanHealthIndex::getGatewayId, Collectors.groupingBy(IdxBizFanHealthIndex::getIndexAddress))); Map<String, Map<String, List<IdxBizFanHealthIndex>>> gateWayMaps = healthIndices.stream().collect(Collectors.groupingBy(IdxBizFanHealthIndex::getGatewayId, Collectors.groupingBy(IdxBizFanHealthIndex::getIndexAddress)));
for (Integer gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
Map<String, List<IdxBizFanHealthIndex>> healthDataMaps = gateWayMaps.get(gateWayId); Map<String, List<IdxBizFanHealthIndex>> healthDataMaps = gateWayMaps.get(gateWayId);
for (String address : healthDataMaps.keySet()) { for (String address : healthDataMaps.keySet()) {
List<IdxBizFanHealthIndex> idxBizFanHealthIndices = healthDataMaps.get(address); List<IdxBizFanHealthIndex> idxBizFanHealthIndices = healthDataMaps.get(address);
...@@ -335,8 +335,8 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -335,8 +335,8 @@ public class HealthStatusIndicatorServiceImpl {
wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate); wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate);
List<IdxBizFanHealthIndex> healthIndices = idxBizFanHealthIndexMapper.selectList(wrapper); List<IdxBizFanHealthIndex> healthIndices = idxBizFanHealthIndexMapper.selectList(wrapper);
Map<Integer, Map<String, List<IdxBizFanHealthIndex>>> gateWayMaps = healthIndices.stream().collect(Collectors.groupingBy(IdxBizFanHealthIndex::getGatewayId, Collectors.groupingBy(IdxBizFanHealthIndex::getIndexAddress))); Map<String, Map<String, List<IdxBizFanHealthIndex>>> gateWayMaps = healthIndices.stream().collect(Collectors.groupingBy(IdxBizFanHealthIndex::getGatewayId, Collectors.groupingBy(IdxBizFanHealthIndex::getIndexAddress)));
for (Integer gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
Map<String, List<IdxBizFanHealthIndex>> healthDataMaps = gateWayMaps.get(gateWayId); Map<String, List<IdxBizFanHealthIndex>> healthDataMaps = gateWayMaps.get(gateWayId);
for (String address : healthDataMaps.keySet()) { for (String address : healthDataMaps.keySet()) {
List<IdxBizFanHealthIndex> idxBizFanHealthIndices = healthDataMaps.get(address); List<IdxBizFanHealthIndex> idxBizFanHealthIndices = healthDataMaps.get(address);
...@@ -403,8 +403,8 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -403,8 +403,8 @@ public class HealthStatusIndicatorServiceImpl {
wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate); wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate);
List<IdxBizFanHealthIndex> healthIndices = idxBizFanHealthIndexMapper.selectList(wrapper); List<IdxBizFanHealthIndex> healthIndices = idxBizFanHealthIndexMapper.selectList(wrapper);
Map<Integer, Map<String, List<IdxBizFanHealthIndex>>> gateWayMaps = healthIndices.stream().collect(Collectors.groupingBy(IdxBizFanHealthIndex::getGatewayId, Collectors.groupingBy(IdxBizFanHealthIndex::getIndexAddress))); Map<String, Map<String, List<IdxBizFanHealthIndex>>> gateWayMaps = healthIndices.stream().collect(Collectors.groupingBy(IdxBizFanHealthIndex::getGatewayId, Collectors.groupingBy(IdxBizFanHealthIndex::getIndexAddress)));
for (Integer gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
Map<String, List<IdxBizFanHealthIndex>> healthDataMaps = gateWayMaps.get(gateWayId); Map<String, List<IdxBizFanHealthIndex>> healthDataMaps = gateWayMaps.get(gateWayId);
for (String address : healthDataMaps.keySet()) { for (String address : healthDataMaps.keySet()) {
List<IdxBizFanHealthIndex> idxBizFanHealthIndices = healthDataMaps.get(address); List<IdxBizFanHealthIndex> idxBizFanHealthIndices = healthDataMaps.get(address);
......
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