From 03bdf8738729b6055b0c5594628b261a3ebaaced Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 21 九月 2023 16:50:20 +0800
Subject: [PATCH] 设备健康
---
ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java | 7 ++++---
1 files changed, 4 insertions(+), 3 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 4783e76..1f7911f 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
@@ -312,20 +312,21 @@
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"));
+
if(listResult.size()>0){
for(int i = 0 ; i<listResult.size(); i++){
Map<String , Object> mapTemp = listResult.get(i);
- int id = (Integer)mapTemp.get("id"); //涓婚敭id
BigDecimal value = (BigDecimal)mapTemp.get("Value"); //鏁板��
String measureStr = (String)mapTemp.get("MeasureDate"); //娴嬮噺鏃堕棿
measureStr = measureStr.substring(measureStr.indexOf("(")+1, measureStr.indexOf(")",2));
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String measureDate = f.format(Long.valueOf(measureStr));
mapTemp.put("MeasureDate", measureDate);
- j.put(id +"" , mapTemp);
+ mapTemp.put("Value", value.setScale(2, BigDecimal.ROUND_HALF_UP));
}
+ j.put("data",listResult);
}else {
- j.put("msg","鏃犳暟鎹�");
+ j.put("data","[]");
}
}else{
//閿欒鎻愮ず
--
Gitblit v1.9.3