|
|
@ -11,11 +11,14 @@ import org.apache.http.client.fluent.Request; |
|
|
import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
import org.apache.http.client.methods.HttpDelete; |
|
|
import org.apache.http.client.methods.HttpDelete; |
|
|
import org.apache.http.client.methods.HttpGet; |
|
|
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.client.utils.URIBuilder; |
|
|
import org.apache.http.entity.ContentType; |
|
|
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.CloseableHttpClient; |
|
|
import org.apache.http.impl.client.HttpClients; |
|
|
import org.apache.http.impl.client.HttpClients; |
|
|
import org.apache.http.util.EntityUtils; |
|
|
import org.apache.http.util.EntityUtils; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.lang.reflect.Type; |
|
|
import java.lang.reflect.Type; |
|
|
@ -28,6 +31,7 @@ import java.util.List; |
|
|
public class EXAUtils { |
|
|
public class EXAUtils { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据分页条件和测点名称测点描述模糊查询 |
|
|
* 根据分页条件和测点名称测点描述模糊查询 |
|
|
* |
|
|
* |
|
|
@ -144,6 +148,29 @@ public class EXAUtils { |
|
|
return result; |
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据分页条件和测点名称测点描述模糊查询 |
|
|
* 根据分页条件和测点名称测点描述模糊查询 |
|
|
* |
|
|
* |
|
|
|