Commit d2438050 authored by tangwei's avatar tangwei

解决冲突

parents 556e0807 7b82037b
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.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
......@@ -27,7 +29,7 @@ public class IdxBizPvPointVarCentralValue{
/**
*
*/
@TableField("SEQUENCE_NBR")
@TableId(value = "SEQUENCE_NBR" ,type = IdType.UUID)
private String sequenceNbr;
/**
......
......@@ -71,13 +71,13 @@ public class IdxBizPvPointVarCorrelation{
*
*/
@TableField("ANALYSIS_POINT_ID")
private Integer analysisPointId;
private String analysisPointId;
/**
*
*/
@TableField("PROCESS_POINT_ID")
private Integer processPointId;
private String processPointId;
/**
* 片区
......@@ -131,7 +131,7 @@ public class IdxBizPvPointVarCorrelation{
*
*/
@TableField("PROCESS_INDEX_ADDRESS")
private Integer processIndexAddress;
private String processIndexAddress;
/**
* 设备名称
......
......@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
@Service
public class CommonServiceImpl {
private static final HashMap<String,Object> cacheExecInfo = new HashMap<>();
private static final HashMap<String, Object> cacheExecInfo = new HashMap<>();
//utc时间格式
public static final String FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
public static final String FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
......@@ -58,7 +58,7 @@ public class CommonServiceImpl {
@Value("${gkblhf.key:input 1}")
String gkqjhfkey;
//----------------工况变量相关性计算请求属性配置------------------------
@Value("${gkxgxfxfan.url:b5797e0a-d456-44d3-9f21-9528e5321b74}")
@Value("${gkxgxfxfan.url:7e40b660-67d5-4678-886d-da125a3c4587}")
String gkxgxfxurlfan;
@Value("${gkxgxfxpv.url:3d583330-1b3c-4c7a-b904-9e94f3de9fc9}")
String gkxgxfxurlpv;
......@@ -216,9 +216,9 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkqjhfkey, params);
String repsonse = HttpUtil.createPost(baseUrl + gkqjhfurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse);
String response = HttpUtil.createPost(baseUrl + gkqjhfurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (response.contains("\"status\":200")&&response.contains("rows")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows");
......@@ -232,7 +232,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::工况变量区间划分更新业务表成功----------------------------------------");
}
try {
logger.info(repsonse);
logger.info(response);
TimeUnit.SECONDS.sleep(sleepTime);
logger.info("------------------------------------------风机::调用工况变量区间划分算法结束----------------------------------------");
} catch (InterruptedException e) {
......@@ -260,9 +260,9 @@ public class CommonServiceImpl {
logger.info("------------------------------------------光伏::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkqjhfkey, params);
String repsonse = HttpUtil.createPost(baseUrl + gkqjhfurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse);
String response = HttpUtil.createPost(baseUrl + gkqjhfurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows");
......@@ -276,7 +276,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::工况变量区间划分更新业务表成功----------------------------------------");
}
try {
logger.info(repsonse);
logger.info(response);
TimeUnit.SECONDS.sleep(sleepTime);
logger.info("------------------------------------------光伏::调用工况变量区间划分算法结束----------------------------------------");
} catch (InterruptedException e) {
......@@ -372,7 +372,7 @@ public class CommonServiceImpl {
//遍历处理数据-组装风机
public void foreachHandlerConditionVariabAnalyseFan(String tableName, List<IdxBizFanPointVarCorrelation> list, String startTime, String endTime, IdxBizFanPointProcessVariableClassification idxBizFanPointProcessVariableClassification) {
String sql1 = String.format("select value from %s where address='%s' and time >= '%s' and where time <= '%s' ", tableName, idxBizFanPointProcessVariableClassification.getIndexAddress(),startTime,endTime);
String sql1 = String.format("select value from %s where address='%s' and time >= '%s' and time <= '%s' ", tableName, idxBizFanPointProcessVariableClassification.getIndexAddress(),startTime,endTime);
List<Map<String, Object>> returnList = influxdbUtil.query(sql1);
List<Map<String, Object>> params = new ArrayList<>();
returnList.forEach((k) -> {
......@@ -386,7 +386,7 @@ public class CommonServiceImpl {
logger.info("---------------------------------风机相关性-----------开始查询influxdb--------------------------------");
List<Map<String, Object>> params1 = new ArrayList<>();
List<Map<String, Object>> requestParams = new ArrayList<>();
String sql = String.format("select value from %s where address='%s' and time >= '%s' and where time <= '%s' ", tableName, idxBizFanPointVarCorrelation.getProcessIndexAddress(),startTime,endTime);
String sql = String.format("select value from %s where address='%s' and time >= '%s' and time <= '%s' ", tableName, idxBizFanPointVarCorrelation.getProcessIndexAddress(),startTime,endTime);
List<Map<String, Object>> returnList1 = influxdbUtil.query(sql);
returnList.forEach((k) -> {
Map<String, Object> map = new HashMap<>();
......@@ -405,9 +405,9 @@ public class CommonServiceImpl {
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams);
logger.info("------------------------------风机相关性------------分析变量与工况变量相关性分析算参数---------------------------------------" + JSON.toJSONString(realParams));
String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse);
String response = HttpUtil.createPost(baseUrl + gkxgxfxurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows");
......@@ -417,7 +417,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机相关性::相关性更新业务表成功----------------------------------------");
}
try {
logger.info("response-------------" + repsonse);
logger.info("response-------------" + response);
TimeUnit.SECONDS.sleep(sleepTime);
logger.info("----------------------------风机相关性--------------分析变量与工况变量相关性分析算法结束----------------------------------------");
} catch (InterruptedException e) {
......@@ -459,9 +459,9 @@ public class CommonServiceImpl {
logger.info("---------------------------------光伏相关性---------分析变量与工况变量相关性分析算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams);
String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse);
String response = HttpUtil.createPost(baseUrl + gkxgxfxurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows");
......@@ -471,7 +471,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机相关性::相关性更新业务表成功----------------------------------------");
}
try {
logger.info("response----光伏相关性---------" + repsonse);
logger.info("response----光伏相关性---------" + response);
TimeUnit.SECONDS.sleep(sleepTime);
logger.info("----------------------------------光伏相关性--------分析变量与工况变量相关性分析算法结束----------------------------------------");
} catch (InterruptedException e) {
......@@ -659,7 +659,7 @@ public class CommonServiceImpl {
realParams.put(gkzxzjskey2, requestParams);
logger.info("------------------------------风机中心值------请求参数---------------------------------------" + JSON.toJSONString(realParams));
String response = HttpUtil.createPost(baseUrl + gkzxzjsurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (response.contains("\"status\":200")) {
if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1");
......@@ -673,8 +673,8 @@ public class CommonServiceImpl {
idxBizFanPointVarCentralValue.setProcess2Min(idxCentralValue.getDoubleValue("process2Min"));
idxBizFanPointVarCentralValue.setProcess3Min(idxCentralValue.getDoubleValue("process3Min"));
idxBizFanPointVarCentralValue.setProcess1Max(idxCentralValue.getDoubleValue("process1Max"));
idxBizFanPointVarCentralValue.setPorcess2Max(idxCentralValue.getDoubleValue("process1Max"));
idxBizFanPointVarCentralValue.setProcess3Max(idxCentralValue.getDoubleValue("process1Max"));
idxBizFanPointVarCentralValue.setPorcess2Max(idxCentralValue.getDoubleValue("process2Max"));
idxBizFanPointVarCentralValue.setProcess3Max(idxCentralValue.getDoubleValue("process3Max"));
idxBizFanPointVarCentralValue.setAnalysisPointId(idxCentralValue.getString("analysisVariableId"));
idxBizFanPointVarCentralValue.setAnalysisPointName(IdxBizFanPointProcessVariableClassification.getPointName());
idxBizFanPointVarCentralValue.setProcessPoint1Id(idxCentralValue.getString("processVariable1Id"));
......@@ -696,7 +696,7 @@ public class CommonServiceImpl {
}
try {
logger.info("------------------风机中心值--repsonse: " + response);
logger.info("------------------风机中心值--response: " + response);
TimeUnit.SECONDS.sleep(zxzsleepTime);
logger.info("-----------------------------------风机中心值-------调用中心值计算算法结束----------------------------------------");
} catch (InterruptedException e) {
......@@ -800,7 +800,7 @@ public class CommonServiceImpl {
realParams.put(gkzxzjskey1, values);
realParams.put(gkzxzjskey2, requestParams);
String response = HttpUtil.createPost(baseUrl + gkzxzjsurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (response.contains("\"status\":200")) {
if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1");
......@@ -814,8 +814,8 @@ public class CommonServiceImpl {
idxBizPvPointVarCentralValue.setProcess2Min(idxCentralValue.getDoubleValue("process2Min"));
idxBizPvPointVarCentralValue.setProcess3Min(idxCentralValue.getDoubleValue("process3Min"));
idxBizPvPointVarCentralValue.setProcess1Max(idxCentralValue.getDoubleValue("process1Max"));
idxBizPvPointVarCentralValue.setProcess2Max(idxCentralValue.getDoubleValue("process1Max"));
idxBizPvPointVarCentralValue.setProcess3Max(idxCentralValue.getDoubleValue("process1Max"));
idxBizPvPointVarCentralValue.setProcess2Max(idxCentralValue.getDoubleValue("process2Max"));
idxBizPvPointVarCentralValue.setProcess3Max(idxCentralValue.getDoubleValue("process3Max"));
idxBizPvPointVarCentralValue.setAnalysisPointId(idxCentralValue.getString("analysisVariableId"));
idxBizPvPointVarCentralValue.setAnalysisPointIdName(idxBizPvPointProcessVariableClassification.getPointName());
idxBizPvPointVarCentralValue.setProcessPoint1Id(idxCentralValue.getString("processVariable1Id"));
......@@ -836,7 +836,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------光伏中心值::中心值更新业务表成功----------------------------------------");
}
try {
logger.info("-------------光伏中心值-------repsonse: " + response);
logger.info("-------------光伏中心值-------response: " + response);
TimeUnit.SECONDS.sleep(sleepTime);
logger.info("-----------------------------------光伏中心值-------调用中心值计算算法结束----------------------------------------");
} catch (InterruptedException e) {
......@@ -990,14 +990,10 @@ 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){
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);
JSONObject jsonObject =result .getJSONObject("result1").getJSONObject("rows");
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(jsonObject), JSONObject.class);
List<String> ids = new ArrayList<>();
jsonObjects.stream().forEach(e-> ids.add(e.getString("analysisVariableId")));
......@@ -1009,11 +1005,10 @@ public class CommonServiceImpl {
for (JSONObject object : jsonObjects) {
if (obj.getSequenceNbr().equals(object.getString("analysisVariableId"))){
IdxBizFanHealthIndex idxBizFanHealthIndex = new IdxBizFanHealthIndex();
BeanUtils.copyProperties(obj,idxBizFanHealthIndex);
BeanUtils.copyProperties(idxBizFanHealthIndex,obj);
idxBizFanHealthIndex.setHealthIndex(object.getDouble("indexValue"));
idxBizFanHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr());
idxBizFanHealthIndex.setRecDate(new Date());
idxBizFanHealthIndex.setSequenceNbr(null);
//获取健康指数对应等级
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanHealthLevel::getAnalysisObjType,"设备");
......@@ -1031,6 +1026,12 @@ public class CommonServiceImpl {
idxBizFanHealthIndexService.saveBatch(idxBizFanHealthIndexs);
}
try {
logger.info("--------------------response: "+response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
......@@ -1152,7 +1153,7 @@ public class CommonServiceImpl {
}
try {
logger.info("--------------------repsonse: " + response);
logger.info("--------------------response: " + response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) {
throw new RuntimeException(e);
......
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