zhangnaisong
2024-07-27 6bab172dc8767e93c8889c15a146c76e4d38e9c0
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");
@@ -182,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"));
@@ -316,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");
@@ -326,7 +337,7 @@
                }
                j.put("data",listResult);
            }else {
                j.put("data","[]");
                j.put("data",new ArrayList<>());
            }
        }else{
            //错误提示