From cfa36565f54f4274e415af9899db2aedadbd7b76 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期三, 06 九月 2023 16:10:43 +0800
Subject: [PATCH] 设备健康详情
---
ard-work/pom.xml | 8 +++
ard-work/src/main/java/com/ruoyi/utils/soap/ARDSoapUtil.java | 2
ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java | 65 ++++++++++++++++++++++++++++----
3 files changed, 65 insertions(+), 10 deletions(-)
diff --git a/ard-work/pom.xml b/ard-work/pom.xml
index a0196e6..2b163b3 100644
--- a/ard-work/pom.xml
+++ b/ard-work/pom.xml
@@ -182,10 +182,16 @@
<version>1.1.1</version>
</dependency>
<dependency>
+ <groupId>wsdl4j</groupId>
+ <artifactId>wsdl4j</artifactId>
+ <version>1.6.3</version>
+ </dependency>
+ <dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
- <version>0.2</version>
+ <version>0.5</version>
</dependency>
+
</dependencies>
diff --git a/ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java b/ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java
index fa34022..0bff24a 100644
--- a/ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java
+++ b/ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java
@@ -28,18 +28,17 @@
@Autowired
ISysConfigService configService;
- @PreAuthorize("@ss.hasPermi('sy:syCar:getSDKCarPositionByRight')")
+ @PreAuthorize("@ss.hasPermi('sy:syCar:getEquipmentList')")
@ApiOperation("鑾峰彇璁惧鍒楄〃")
@GetMapping("getEquipmentList")
public Results getEquipmentList(){
String url = configService.getHealth();
JSONObject j = new JSONObject();
-
Map<String, Object> map = new HashMap();
String result = ARDSoapUtil.postSoapResult(url, "GetEquipmentList", map);
if ("".equals(result)) {
//杩斿洖缁撴灉涓虹┖
- return Results.error("鏌ヨ澶辫触锛�");
+ return Results.error("娌℃湁璁惧淇℃伅");
}
Map<String, Object> mapResult = (Map<String, Object>) JSON.parse((String) result);
if ((int) mapResult.get("code") == 200) {
@@ -48,11 +47,6 @@
for (int i = 0; i < listResult.size(); i++) {
Map<String, Object> mapTemp = listResult.get(i);
int id = (Integer) mapTemp.get("id"); //涓婚敭id
- String equipKey = (String) mapTemp.get("EquipKey"); //璁惧Key
- String equipNumber = (String) mapTemp.get("EquipNumber"); //璁惧缂栧彿
- String equipName = (String) mapTemp.get("EquipName"); //璁惧鍚嶇О
- String equipLevel = (String) mapTemp.get("EquipLevel"); //璁惧鎶ヨ绛夌骇 0姝e父 1娉ㄦ剰 2涓ラ噸
- String measureDate = (String) mapTemp.get("MeasureDate"); //鏈�杩戜竴娆℃祴閲忔椂闂�
j.put(id + "", mapTemp);
}
} else {
@@ -62,4 +56,59 @@
}
return Results.succeed(j);
}
+
+ @PreAuthorize("@ss.hasPermi('sy:syCar:getMeasureByEquipName')")
+ @ApiOperation("鑾峰彇鏌愪釜娌逛簳娴嬬偣鍒楄〃")
+ @GetMapping("getMeasureByEquipName")
+ public Results getMeasureByEquipName(String equipNumber){
+ String url = configService.getHealth();
+ JSONObject j = new JSONObject();
+ Map<String, Object> map = new HashMap();
+ String result = ARDSoapUtil.postSoapResult(url, "GetEquipmentList", map);
+ String equipKey = "";
+ if ("".equals(result)) {
+ //杩斿洖缁撴灉涓虹┖
+ return Results.error("娌℃湁璁惧淇℃伅");
+ }
+ Map<String, Object> mapResult = (Map<String, Object>) JSON.parse((String) result);
+ if ((int) mapResult.get("code") == 200) {
+ j.put("code", mapResult.get("code"));
+ List<Map<String, Object>> listResult = (List<Map<String, Object>>) JSON.parse((String) mapResult.get("resdata"));
+ for (int i = 0; i < listResult.size(); i++) {
+ Map<String, Object> mapTemp = listResult.get(i);
+ String equipNumberTemp = (String) mapTemp.get("EquipNumber"); //璁惧鍚嶇О
+ if (equipNumberTemp.equals(equipNumber)) {
+ //鍚嶇О鍖归厤锛屽嵆涓鸿鑾峰彇鐨勮澶囷紱
+ equipKey = (String) mapTemp.get("EquipKey"); //璁惧Key
+ }
+ }
+ if ("".equals(equipKey)) {
+ return Results.error("娌℃湁娴嬬偣淇℃伅");
+ }
+ //鑾峰彇璁惧鐨勬祴鐐瑰垪琛�
+ Map<String, Object> hashMap = new HashMap<String, Object>();
+ hashMap.put("EquipKey", equipKey);
+ String eResult = ARDSoapUtil.postSoapResult(url, "GetMeasureByEquipKey", hashMap);
+ if ("".equals(eResult)) {
+ //杩斿洖缁撴灉涓虹┖
+ return Results.error("娌℃湁娴嬬偣淇℃伅");
+ }
+ Map<String, Object> map1 = (Map<String, Object>) JSON.parse((String) eResult);
+ if ((int) map1.get("code") == 200) {
+ j.put("code", map1.get("code"));
+ List<Map<String, Object>> list = (List<Map<String, Object>>) JSON.parse((String) map1.get("resdata"));
+ j.put("listResult", list);
+ } else {
+ //閿欒鎻愮ず
+ j.put("errmsg", mapResult.get("errmsg"));
+ j.put("code", mapResult.get("code"));
+ }
+ } else {
+ //閿欒鎻愮ず
+ j.put("errmsg", mapResult.get("errmsg"));
+ j.put("code", mapResult.get("code"));
+ }
+ return Results.succeed(j);
+ }
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/utils/soap/ARDSoapUtil.java b/ard-work/src/main/java/com/ruoyi/utils/soap/ARDSoapUtil.java
index bce2914..d586670 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/soap/ARDSoapUtil.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/soap/ARDSoapUtil.java
@@ -38,7 +38,7 @@
call.setEncodingStyle(encodingStyle);//璁剧疆浼犲叆鏈嶅姟绔殑瀛楃闆嗘牸寮忓utf-8绛�
call.setOperationName(new QName(targetNamespace,method));// 鍏蜂綋璋冪敤鐨勬柟娉曞悕锛屽彲浠ョ敱鎺ュ彛鎻愪緵鏂瑰憡璇変綘锛屼篃鍙互鑷繁浠嶹SDL涓壘
call.setUseSOAPAction(true);
-// call.setReturnType(XMLType.XSD_STRING);
+ call.setReturnType(XMLType.XSD_STRING);
Object[] o = new Object[map.size()];
int i=0;
for (String key :map.keySet() ){
--
Gitblit v1.9.3