Commit 7b82037b authored by caotao's avatar caotao

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

parent fbcf9da9
...@@ -216,9 +216,9 @@ public class CommonServiceImpl { ...@@ -216,9 +216,9 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::开始调用工况变量区间划分算法----------------------------------------"); logger.info("------------------------------------------风机::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkqjhfkey, params); realParams.put(gkqjhfkey, params);
String repsonse = HttpUtil.createPost(baseUrl + gkqjhfurlfan).body(JSON.toJSONString(realParams)).execute().body(); String response = HttpUtil.createPost(baseUrl + gkqjhfurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) { if (response.contains("\"status\":200")&&response.contains("rows")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse); JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result"); JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1"); JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows"); JSONArray rows = (JSONArray) result1.get("rows");
...@@ -232,7 +232,7 @@ public class CommonServiceImpl { ...@@ -232,7 +232,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::工况变量区间划分更新业务表成功----------------------------------------"); logger.info("------------------------------------------风机::工况变量区间划分更新业务表成功----------------------------------------");
} }
try { try {
logger.info(repsonse); logger.info(response);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
logger.info("------------------------------------------风机::调用工况变量区间划分算法结束----------------------------------------"); logger.info("------------------------------------------风机::调用工况变量区间划分算法结束----------------------------------------");
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -260,9 +260,9 @@ public class CommonServiceImpl { ...@@ -260,9 +260,9 @@ public class CommonServiceImpl {
logger.info("------------------------------------------光伏::开始调用工况变量区间划分算法----------------------------------------"); logger.info("------------------------------------------光伏::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkqjhfkey, params); realParams.put(gkqjhfkey, params);
String repsonse = HttpUtil.createPost(baseUrl + gkqjhfurlpv).body(JSON.toJSONString(realParams)).execute().body(); String response = HttpUtil.createPost(baseUrl + gkqjhfurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) { if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse); JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result"); JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1"); JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows"); JSONArray rows = (JSONArray) result1.get("rows");
...@@ -276,7 +276,7 @@ public class CommonServiceImpl { ...@@ -276,7 +276,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::工况变量区间划分更新业务表成功----------------------------------------"); logger.info("------------------------------------------风机::工况变量区间划分更新业务表成功----------------------------------------");
} }
try { try {
logger.info(repsonse); logger.info(response);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
logger.info("------------------------------------------光伏::调用工况变量区间划分算法结束----------------------------------------"); logger.info("------------------------------------------光伏::调用工况变量区间划分算法结束----------------------------------------");
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -405,9 +405,9 @@ public class CommonServiceImpl { ...@@ -405,9 +405,9 @@ public class CommonServiceImpl {
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams); realParams.put(gkxgxfxkey, requestParams);
logger.info("------------------------------风机相关性------------分析变量与工况变量相关性分析算参数---------------------------------------" + JSON.toJSONString(realParams)); logger.info("------------------------------风机相关性------------分析变量与工况变量相关性分析算参数---------------------------------------" + JSON.toJSONString(realParams));
String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurlfan).body(JSON.toJSONString(realParams)).execute().body(); String response = HttpUtil.createPost(baseUrl + gkxgxfxurlfan).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) { if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse); JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result"); JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1"); JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows"); JSONArray rows = (JSONArray) result1.get("rows");
...@@ -417,7 +417,7 @@ public class CommonServiceImpl { ...@@ -417,7 +417,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机相关性::相关性更新业务表成功----------------------------------------"); logger.info("------------------------------------------风机相关性::相关性更新业务表成功----------------------------------------");
} }
try { try {
logger.info("response-------------" + repsonse); logger.info("response-------------" + response);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
logger.info("----------------------------风机相关性--------------分析变量与工况变量相关性分析算法结束----------------------------------------"); logger.info("----------------------------风机相关性--------------分析变量与工况变量相关性分析算法结束----------------------------------------");
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -459,9 +459,9 @@ public class CommonServiceImpl { ...@@ -459,9 +459,9 @@ public class CommonServiceImpl {
logger.info("---------------------------------光伏相关性---------分析变量与工况变量相关性分析算法开始----------------------------------------"); logger.info("---------------------------------光伏相关性---------分析变量与工况变量相关性分析算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams); realParams.put(gkxgxfxkey, requestParams);
String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurlpv).body(JSON.toJSONString(realParams)).execute().body(); String response = HttpUtil.createPost(baseUrl + gkxgxfxurlpv).body(JSON.toJSONString(realParams)).execute().body();
if (repsonse.contains("\"status\":200")) { if (response.contains("\"status\":200")&&response.contains("rows")) {
JSONObject jsonObject = JSONObject.parseObject(repsonse); JSONObject jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result"); JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1"); JSONObject result1 = (JSONObject) result.get("result1");
JSONArray rows = (JSONArray) result1.get("rows"); JSONArray rows = (JSONArray) result1.get("rows");
...@@ -471,7 +471,7 @@ public class CommonServiceImpl { ...@@ -471,7 +471,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机相关性::相关性更新业务表成功----------------------------------------"); logger.info("------------------------------------------风机相关性::相关性更新业务表成功----------------------------------------");
} }
try { try {
logger.info("response----光伏相关性---------" + repsonse); logger.info("response----光伏相关性---------" + response);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
logger.info("----------------------------------光伏相关性--------分析变量与工况变量相关性分析算法结束----------------------------------------"); logger.info("----------------------------------光伏相关性--------分析变量与工况变量相关性分析算法结束----------------------------------------");
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -659,7 +659,7 @@ public class CommonServiceImpl { ...@@ -659,7 +659,7 @@ public class CommonServiceImpl {
realParams.put(gkzxzjskey2, requestParams); realParams.put(gkzxzjskey2, requestParams);
logger.info("------------------------------风机中心值------请求参数---------------------------------------" + JSON.toJSONString(realParams)); logger.info("------------------------------风机中心值------请求参数---------------------------------------" + JSON.toJSONString(realParams));
String response = HttpUtil.createPost(baseUrl + gkzxzjsurlfan).body(JSON.toJSONString(realParams)).execute().body(); 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 jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result"); JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1"); JSONObject result1 = (JSONObject) result.get("result1");
...@@ -696,7 +696,7 @@ public class CommonServiceImpl { ...@@ -696,7 +696,7 @@ public class CommonServiceImpl {
} }
try { try {
logger.info("------------------风机中心值--repsonse: " + response); logger.info("------------------风机中心值--response: " + response);
TimeUnit.SECONDS.sleep(zxzsleepTime); TimeUnit.SECONDS.sleep(zxzsleepTime);
logger.info("-----------------------------------风机中心值-------调用中心值计算算法结束----------------------------------------"); logger.info("-----------------------------------风机中心值-------调用中心值计算算法结束----------------------------------------");
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -800,7 +800,7 @@ public class CommonServiceImpl { ...@@ -800,7 +800,7 @@ public class CommonServiceImpl {
realParams.put(gkzxzjskey1, values); realParams.put(gkzxzjskey1, values);
realParams.put(gkzxzjskey2, requestParams); realParams.put(gkzxzjskey2, requestParams);
String response = HttpUtil.createPost(baseUrl + gkzxzjsurlpv).body(JSON.toJSONString(realParams)).execute().body(); 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 jsonObject = JSONObject.parseObject(response);
JSONObject result = (JSONObject) jsonObject.get("result"); JSONObject result = (JSONObject) jsonObject.get("result");
JSONObject result1 = (JSONObject) result.get("result1"); JSONObject result1 = (JSONObject) result.get("result1");
...@@ -836,7 +836,7 @@ public class CommonServiceImpl { ...@@ -836,7 +836,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------光伏中心值::中心值更新业务表成功----------------------------------------"); logger.info("------------------------------------------光伏中心值::中心值更新业务表成功----------------------------------------");
} }
try { try {
logger.info("-------------光伏中心值-------repsonse: " + response); logger.info("-------------光伏中心值-------response: " + response);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
logger.info("-----------------------------------光伏中心值-------调用中心值计算算法结束----------------------------------------"); logger.info("-----------------------------------光伏中心值-------调用中心值计算算法结束----------------------------------------");
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -1027,7 +1027,7 @@ public class CommonServiceImpl { ...@@ -1027,7 +1027,7 @@ public class CommonServiceImpl {
} }
try { try {
logger.info("--------------------repsonse: "+response); logger.info("--------------------response: "+response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------"); logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
...@@ -1153,7 +1153,7 @@ public class CommonServiceImpl { ...@@ -1153,7 +1153,7 @@ public class CommonServiceImpl {
} }
try { try {
logger.info("--------------------repsonse: " + response); logger.info("--------------------response: " + response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------"); logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(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