Browse Source

代码修改

liubing 4 years ago
parent
commit
7e3675a6e4

+ 16 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -1155,6 +1155,19 @@ public class MonitorPlatformService  {
                    if ("0".equals(showLevel)){
                        obj.put("device_name","单体征测量仪");
                        obj.put("Subdivision",true);//是否可查看下一层次
                        StringBuffer sqlTmp = new StringBuffer("select code from xmiot.iot_system_dict where dict_name='DEVICE_TYPE' and `code` in ('");
                        sqlTmp.append(deviceType.replace(",","','")).append("') ");
                        sqlTmp.append("and del=1 and parent_code \n" +
                                "in(select id from xmiot.iot_system_dict where dict_name='DEVICE' and `value`='单体征测量仪' and del=1)");
                        List<String> list = jdbcTemplate.queryForList(sqlTmp.toString(),String.class);
                        sqlTmp = new StringBuffer();
                        for (String s:list){
                            sqlTmp.append(","+s);
                        }
                        if (list.size()!=0){
                            sqlTmp.deleteCharAt(0);
                        }
                        obj.put("type",sqlTmp.toString());
                    }
                    else if("1".equals(showLevel)){
                        String temp = obj.getString("type");
@ -1168,6 +1181,7 @@ public class MonitorPlatformService  {
                    else{
                        obj.put("Subdivision",false);
                    }
                    obj.put("showLevel",Integer.parseInt(showLevel));
                }
                result.put("deviceInfo",arr);//设备信息统计
                //统计物联率设备,失联设备
@ -1208,6 +1222,7 @@ public class MonitorPlatformService  {
                    tmp.put("device_name","健康小屋");
                    tmp.put("Subdivision",false);
                }
                tmp.put("showLevel",Integer.parseInt(showLevel));
                result.getJSONArray("deviceInfo").add(tmp);
                result.put("grantCount",result.getInteger("grantCount")+count);
                //统计健康小屋数据/ 小屋全部统计为正常使用
@ -1242,7 +1257,7 @@ public class MonitorPlatformService  {
        float size = (float) (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
        return filesize + "%";
        return filesize;
    }
    /**