|
|
|
@ -1,9 +1,6 @@ |
|
|
|
package cn.iocoder.yudao.module.alert.utils; |
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.alert.controller.admin.exa.vo.EXAHistoryReqVO; |
|
|
|
import cn.iocoder.yudao.module.alert.controller.admin.exa.vo.EXAHttp; |
|
|
|
import cn.iocoder.yudao.module.alert.controller.admin.exa.vo.EXAPageReqVO; |
|
|
|
import cn.iocoder.yudao.module.alert.controller.admin.exa.vo.Point; |
|
|
|
import cn.iocoder.yudao.module.alert.controller.admin.exa.vo.*; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.google.gson.Gson; |
|
|
|
@ -14,11 +11,14 @@ import org.apache.http.client.fluent.Request; |
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
|
import org.apache.http.client.methods.HttpDelete; |
|
|
|
import org.apache.http.client.methods.HttpGet; |
|
|
|
import org.apache.http.client.methods.HttpPost; |
|
|
|
import org.apache.http.client.utils.URIBuilder; |
|
|
|
import org.apache.http.entity.ContentType; |
|
|
|
import org.apache.http.entity.StringEntity; |
|
|
|
import org.apache.http.impl.client.CloseableHttpClient; |
|
|
|
import org.apache.http.impl.client.HttpClients; |
|
|
|
import org.apache.http.util.EntityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.lang.reflect.Type; |
|
|
|
@ -31,6 +31,7 @@ import java.util.List; |
|
|
|
public class EXAUtils { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 根据分页条件和测点名称测点描述模糊查询 |
|
|
|
* |
|
|
|
@ -147,6 +148,29 @@ public class EXAUtils { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public EXAResult getNowDataList(String EXA_IP,EXANowListReqVO exaNowListReqVO) throws URISyntaxException, IOException { |
|
|
|
EXAResult result = new EXAResult(); |
|
|
|
try { |
|
|
|
// 目标 RPC 服务的 URL
|
|
|
|
String url = "http://"+EXA_IP+":9000/exawebapi/exanow/GetFloatValueBatch"; |
|
|
|
String param = JSON.toJSONString(exaNowListReqVO); |
|
|
|
String resultStr = Request.Post(url) |
|
|
|
.addHeader("Content-type", "application/json") |
|
|
|
.bodyString(param, ContentType.APPLICATION_JSON) |
|
|
|
.execute().returnContent().asString(Charset.forName("utf-8")); |
|
|
|
Gson gson=new Gson(); |
|
|
|
|
|
|
|
result= gson.fromJson(resultStr, EXAResult.class); |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 根据分页条件和测点名称测点描述模糊查询 |
|
|
|
* |
|
|
|
|