Commit c0a4bd08 authored by chenzhao's avatar chenzhao

修改代码

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