Commit 7b82037b authored by caotao's avatar caotao

业务代码新增判断兼容算法返回数据错误

parent fbcf9da9
......@@ -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) {
......@@ -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");
......@@ -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");
......@@ -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) {
......@@ -1027,7 +1027,7 @@ public class CommonServiceImpl {
}
try {
logger.info("--------------------repsonse: "+response);
logger.info("--------------------response: "+response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) {
throw new RuntimeException(e);
......@@ -1153,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