From 0a1b51f38e6ddccb1a9664b9d1bd4671b2cac32b Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 14 九月 2023 09:56:41 +0800
Subject: [PATCH] 设备健康信息
---
ard-work/src/main/java/com/ruoyi/health/param/GetEquipmentAlertInfoParam.java | 9 +++++++++
ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java | 19 +++++++++++++++++--
2 files changed, 26 insertions(+), 2 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 b4f8d2f..b1385a1 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
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.entity.SysConfig;
import com.ruoyi.health.client.EquipmentsHealthClient;
+import com.ruoyi.health.param.GetEquipmentAlertInfoParam;
import com.ruoyi.health.param.GetFMTrendParam;
import com.ruoyi.health.param.GetTrendParam;
import com.ruoyi.system.service.ISysConfigService;
@@ -19,6 +20,7 @@
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -322,7 +324,9 @@
@PreAuthorize("@ss.hasPermi('sy:syCar:GetEquipmentAlertInfo')")
@ApiOperation("鏍规嵁ID鑾峰彇璇︾粏璇存槑")
@GetMapping("GetEquipmentAlertInfo")
- public Results GetEquipmentAlertInfo(Integer id){
+ public Results GetEquipmentAlertInfo(GetEquipmentAlertInfoParam param){
+ Integer id = param.getId();
+ String key = param.getPosition();
List<SysConfig> sysConfigs = configService.getAccPwd();
String account = null,password = null,url = null;
for (int i = 0; i < sysConfigs.size(); i++) {
@@ -342,6 +346,17 @@
String token = (String) ((Map<String, Object>) ((Map<String, Object>) loginResult.get("data")).get("data")).get("token");
String GetEquipmentAlertInfoUrl = url + "/RoadFlowApi/ZX/MeasureData/GetEquipmentAlertInfo";
Map<String, Object> map = EquipmentsHealthClient.GetEquipmentAlertInfo(GetEquipmentAlertInfoUrl, token,id);
- return Results.succeed(map);
+ List<Object> list = (List<Object>) ((Map<String, Object>) map.get("data")).get("rows");
+ List<Map<String,Object>> rList = new ArrayList<>();
+ if(list.size()>0){
+ for (int i = 0; i < list.size(); i++) {
+ Map<String,Object> listMap = (Map<String, Object>) list.get(i);
+ String position = (String) listMap.get("position");
+ if(key.equals(position)){
+ rList.add(listMap);
+ }
+ }
+ }
+ return Results.succeed(rList);
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/health/param/GetEquipmentAlertInfoParam.java b/ard-work/src/main/java/com/ruoyi/health/param/GetEquipmentAlertInfoParam.java
new file mode 100644
index 0000000..d7e4522
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/health/param/GetEquipmentAlertInfoParam.java
@@ -0,0 +1,9 @@
+package com.ruoyi.health.param;
+
+import lombok.Data;
+
+@Data
+public class GetEquipmentAlertInfoParam {
+ private Integer id;
+ private String position;
+}
--
Gitblit v1.9.3