From 2217289657c3a402e132490497b10f3876bc1aa1 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 06 十一月 2023 10:17:36 +0800
Subject: [PATCH] 获取三一地址
---
ard-work/src/main/java/com/ruoyi/health/client/EquipmentsHealthClient.java | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/health/client/EquipmentsHealthClient.java b/ard-work/src/main/java/com/ruoyi/health/client/EquipmentsHealthClient.java
index 6c58c28..421a75b 100644
--- a/ard-work/src/main/java/com/ruoyi/health/client/EquipmentsHealthClient.java
+++ b/ard-work/src/main/java/com/ruoyi/health/client/EquipmentsHealthClient.java
@@ -126,4 +126,34 @@
return new HashMap();
}
}
+
+ public static Map<String,Object> GetEquipmentAlertInfo(String url,String token,Integer id){
+ OkHttpClient okHttpClient = new OkHttpClient();
+// MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+// RequestBody formBody = RequestBody.create(mediaType, "");
+ RequestBody formBody = new Builder()
+ .add("partid", String.valueOf(id))
+ .build();
+ Request request = new Request.Builder().url(url).post(formBody).addHeader("roadflow-token",token).build();
+ Response response = null;
+ try {
+ response = okHttpClient.newCall(request).execute();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ ResponseBody responseBody = response.body();
+
+ try {
+ String message = responseBody.string();
+ System.out.println(message);
+ Map<String,Object> result = (Map<String, Object>) JSON.parse(message);
+ return result;
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return new HashMap();
+ }
+ }
}
--
Gitblit v1.9.3