From d812ded709006660c6eed3769401fda954535713 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期三, 13 九月 2023 17:17:15 +0800
Subject: [PATCH] 设备健康新接口
---
ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
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 b8c777e..4f02ab1 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
@@ -294,7 +294,7 @@
}
@PreAuthorize("@ss.hasPermi('sy:syCar:GetPartsAlertLeve')")
- @ApiOperation("鑾峰彇鐐�")
+ @ApiOperation("鑾峰彇ID鑾峰彇鐐逛綅")
@GetMapping("GetPartsAlertLevel")
public Results GetPartsAlertLevel(Integer id){
List<SysConfig> sysConfigs = configService.getAccPwd();
@@ -318,4 +318,30 @@
Map<String, Object> map = EquipmentsHealthClient.GetPartsAlertLeve(GetPartsAlertLeveUrl, token,id);
return Results.succeed(map);
}
+
+ @PreAuthorize("@ss.hasPermi('sy:syCar:GetEquipmentAlertInfo')")
+ @ApiOperation("鏍规嵁ID鑾峰彇璇︾粏璇存槑")
+ @GetMapping("GetEquipmentAlertInfo")
+ public Results GetEquipmentAlertInfo(Integer id){
+ List<SysConfig> sysConfigs = configService.getAccPwd();
+ String account = null,password = null,url = null;
+ for (int i = 0; i < sysConfigs.size(); i++) {
+ SysConfig sysConfig = sysConfigs.get(i);
+ if("eqHealthUrl".equals(sysConfig.getConfigKey())){
+ url = sysConfig.getConfigValue();
+ }
+ if("eqHealthAccount".equals(sysConfig.getConfigKey())){
+ account = sysConfig.getConfigValue();
+ }
+ if("eqHealthPassword".equals(sysConfig.getConfigKey())){
+ password = sysConfig.getConfigValue();
+ }
+ }
+ String tokenUrl = url+"/RoadFlowApi/Home/ValidLogin";
+ Map<String, Object> loginResult = EquipmentsHealthClient.getToken(tokenUrl, account, password);
+ String token = (String) ((Map<String, Object>) ((Map<String, Object>) loginResult.get("data")).get("data")).get("token");
+ String GetPartsAlertLeveUrl = url + "/RoadFlowApi/ZX/MeasureData/GetEquipmentAlertInfo";
+ Map<String, Object> map = EquipmentsHealthClient.GetPartsAlertLeve(GetPartsAlertLeveUrl, token,id);
+ return Results.succeed(map);
+ }
}
--
Gitblit v1.9.3