Commit ccbf7349 authored by tangwei's avatar tangwei

解决冲突

parents 53304062 b672f5d5
...@@ -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")
......
package com.yeejoin.amos.boot.module.jxiop.biz.entity; package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -24,7 +26,7 @@ public class IdxBizFanHealthIndex { ...@@ -24,7 +26,7 @@ public class IdxBizFanHealthIndex {
/** /**
* *
*/ */
@TableField("SEQUENCE_NBR") @TableId(value = "SEQUENCE_NBR", type = IdType.ID_WORKER_STR)
private String sequenceNbr; private String sequenceNbr;
/** /**
...@@ -139,7 +141,7 @@ public class IdxBizFanHealthIndex { ...@@ -139,7 +141,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;
/** /**
* *
......
...@@ -142,7 +142,7 @@ public class IdxBizFanPointProcessVariableClassification{ ...@@ -142,7 +142,7 @@ public class IdxBizFanPointProcessVariableClassification{
* *
*/ */
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Long gatewayId; private String gatewayId;
/** /**
* 点表地址 * 点表地址
......
...@@ -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;
/** /**
* 点表地址 * 点表地址
......
package com.yeejoin.amos.boot.module.jxiop.biz.entity; package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
...@@ -27,7 +29,7 @@ public class IdxBizPvHealthIndex{ ...@@ -27,7 +29,7 @@ public class IdxBizPvHealthIndex{
/** /**
* *
*/ */
@TableField("SEQUENCE_NBR") @TableId(value = "SEQUENCE_NBR", type = IdType.ID_WORKER_STR)
private String sequenceNbr; private String sequenceNbr;
/** /**
...@@ -100,13 +102,13 @@ public class IdxBizPvHealthIndex{ ...@@ -100,13 +102,13 @@ public class IdxBizPvHealthIndex{
* *
*/ */
@TableField("ANALYSIS_START_TIME") @TableField("ANALYSIS_START_TIME")
private LocalDateTime analysisStartTime; private Date analysisStartTime;
/** /**
* *
*/ */
@TableField("ANALYSIS_END_TIME") @TableField("ANALYSIS_END_TIME")
private LocalDateTime analysisEndTime; private Date analysisEndTime;
/** /**
* 片区 * 片区
......
...@@ -150,7 +150,7 @@ public class IdxBizPvPointProcessVariableClassification{ ...@@ -150,7 +150,7 @@ public class IdxBizPvPointProcessVariableClassification{
* *
*/ */
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Long 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;
/** /**
* *
...@@ -180,7 +181,7 @@ public class IdxBizPvPointVarCentralValue{ ...@@ -180,7 +181,7 @@ public class IdxBizPvPointVarCentralValue{
/** /**
* *
*/ */
@TableField("ANALYSIS_POINT_ID_NAME") @TableField("ANALYSIS_POINT_NAME")
private String analysisPointIdName; private String analysisPointIdName;
/** /**
......
...@@ -990,10 +990,14 @@ public class CommonServiceImpl { ...@@ -990,10 +990,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")));
...@@ -1005,10 +1009,11 @@ public class CommonServiceImpl { ...@@ -1005,10 +1009,11 @@ 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());
idxBizFanHealthIndex.setSequenceNbr(null);
//获取健康指数对应等级 //获取健康指数对应等级
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanHealthLevel::getAnalysisObjType,"设备"); query.eq(IdxBizFanHealthLevel::getAnalysisObjType,"设备");
...@@ -1026,12 +1031,6 @@ public class CommonServiceImpl { ...@@ -1026,12 +1031,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