|
@@ -1,5 +1,6 @@
|
|
package com.persagy.dmp.rwd.iot.service.impl;
|
|
package com.persagy.dmp.rwd.iot.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.io.IORuntimeException;
|
|
import cn.hutool.http.HttpUtil;
|
|
import cn.hutool.http.HttpUtil;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -64,7 +65,15 @@ public class CurrentIotServiceImpl implements CurrentIotService {
|
|
JSONObject requestBody = new JSONObject();
|
|
JSONObject requestBody = new JSONObject();
|
|
requestBody.put("building", AppContext.getContext().getProjectId().substring(2));
|
|
requestBody.put("building", AppContext.getContext().getProjectId().substring(2));
|
|
requestBody.put("points", parameters);
|
|
requestBody.put("points", parameters);
|
|
- String response = HttpUtil.post(url, requestBody.toString(), 3000);
|
|
|
|
|
|
+
|
|
|
|
+ String response = null;
|
|
|
|
+ try{
|
|
|
|
+ //处理iot-collect 请求返回超时
|
|
|
|
+ response = HttpUtil.post(url, requestBody.toString(), 3000);
|
|
|
|
+ }catch (IORuntimeException e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return param;
|
|
|
|
+ }
|
|
//处理iot-collect 未部署情况
|
|
//处理iot-collect 未部署情况
|
|
if(response.contains("<html>")){
|
|
if(response.contains("<html>")){
|
|
return param;
|
|
return param;
|