From 62ccdc7c0ca98f50059808f0ecdf01907b92879d Mon Sep 17 00:00:00 2001 From: zhangnaisong <2434969829@qq.com> Date: 星期三, 10 七月 2024 16:14:16 +0800 Subject: [PATCH] 协助提交 --- ard-work/src/main/java/com/ruoyi/health/controller/HealthController.java | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 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 8e4e345..24aa518 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 @@ -183,13 +183,17 @@ } } } - List<TreeDeptWell> tree = sysDeptService.wellTree(treeDeptWells); - TreeSelectWellJson treeSelectWellJson = new TreeSelectWellJson(); - treeSelectWellJson.setWellList(tree); - treeSelectWellJson.setCount0(count0); - treeSelectWellJson.setCount1(count1); - treeSelectWellJson.setCount2(count2); - return Results.succeed(treeSelectWellJson); + if(treeDeptWells.size()>0){ + List<TreeDeptWell> tree = sysDeptService.wellTree(treeDeptWells); + TreeSelectWellJson treeSelectWellJson = new TreeSelectWellJson(); + treeSelectWellJson.setWellList(tree); + treeSelectWellJson.setCount0(count0); + treeSelectWellJson.setCount1(count1); + treeSelectWellJson.setCount2(count2); + return Results.succeed(treeSelectWellJson); + }else { + return Results.error("鏃犲尮閰嶆暟鎹�"); + } } else { //閿欒鎻愮ず return Results.error((String) mapResult.get("errmsg")); @@ -317,7 +321,13 @@ if(listResult.size()>0){ for(int i = 0 ; i<listResult.size(); i++){ Map<String , Object> mapTemp = listResult.get(i); - BigDecimal value = (BigDecimal)mapTemp.get("Value"); //鏁板�� + //BigDecimal value = (BigDecimal)mapTemp.get("Value"); //鏁板�� + BigDecimal value = null; //鏁板�� + try{ + value = (BigDecimal)mapTemp.get("Value"); + }catch(Exception e){ + value = BigDecimal.valueOf(((Number)mapTemp.get("Value")).floatValue()); + } 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"); -- Gitblit v1.9.3