From 345a937081333fd7385550b207593570a062b78a Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期五, 19 一月 2024 16:30:03 +0800
Subject: [PATCH] 修复bug
---
ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java | 8 +++++---
1 files changed, 5 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..8e4e345 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
@@ -84,6 +84,7 @@
List<TreeDeptWell> treeDeptWells = new ArrayList<>();
if ((int) mapResult.get("code") == 200) {
List<Map<String, Object>> listResult = (List<Map<String, Object>>) JSON.parse((String) mapResult.get("resdata"));
+// System.out.println(String.valueOf(listResult));
//寰幆寰楀埌鏉冮檺涓嬪尮閰嶆暟鎹�
for (int i = 0; i < listResult.size(); i++) {
String equipNumber = (String) listResult.get(i).get("EquipNumber");
@@ -312,20 +313,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",new ArrayList<>());
}
}else{
//閿欒鎻愮ず
--
Gitblit v1.9.3