jinpengyong
2021-12-29 caf0e22cb16cc01d3775db11b82787d5ba22c402
screen-api/src/main/java/com/moral/api/service/impl/ProfessionServiceImpl.java
@@ -230,7 +230,7 @@
                //判断城市aqi是否有该因子数据
                String sensorName = senorMap.get(sensorCode);
                if (sensorName != null) {
                    cityValue = (Double) dataValue.get(sensorName);
                    cityValue = Double.parseDouble(dataValue.get(sensorName).toString());
                }
            }
            resultMap.put("cityValue", cityValue);
@@ -277,7 +277,7 @@
                    //行业贡献率计算
                    NumberFormat numberFormat = NumberFormat.getInstance();
                    numberFormat.setMaximumFractionDigits(2);
                    if (allDeviceSum != null) {
                    if (allDeviceSum != null && (Double) allDeviceSum != 0d) {
                        contributionRate = numberFormat.format(professionSum / ((Double) allDeviceSum) * 100) + "%";
                    }
                }
@@ -349,7 +349,7 @@
                //判断城市aqi是否有该因子数据
                String sensorName = senorMap.get(sensorCode);
                if (sensorName != null) {
                    cityValue = (Double) dataValue.get(sensorName);
                    cityValue = Double.parseDouble(dataValue.get(sensorName).toString());
                }
            }
            resultMap.put("cityValue", cityValue);
@@ -394,7 +394,7 @@
                    //行业贡献率计算
                    NumberFormat numberFormat = NumberFormat.getInstance();
                    numberFormat.setMaximumFractionDigits(2);
                    if (allDeviceSum != null) {
                    if (allDeviceSum != null && (Double) allDeviceSum != 0d) {
                        contributionRate = numberFormat.format(professionSum / ((Double) allDeviceSum) * 100) + "%";
                    }
                }
@@ -421,8 +421,12 @@
        QueryWrapper<Sensor> sensorQueryWrapper = new QueryWrapper<>();
        sensorQueryWrapper.select("lower", "upper").eq("code", sensorCode);
        Sensor sensor = sensorService.getOne(sensorQueryWrapper);
        Double sensorLower = sensor.getLower();
        Double sensorUpper = sensor.getUpper();
        Double sensorLower = null;
        Double sensorUpper = null;
        if (sensor != null) {
            sensorLower = sensor.getLower();
            sensorUpper = sensor.getUpper();
        }
        //该组织所有设备信息
        List<String> allMacs = deviceService.getMacsByOrganizationId(orgId);
@@ -473,7 +477,7 @@
                //判断城市aqi是否有该因子数据
                String sensorName = senorMap.get(sensorCode);
                if (sensorName != null) {
                    cityValue = (Double) dataValue.get(sensorName);
                    cityValue = Double.parseDouble(dataValue.get(sensorName).toString());
                }
            }
            resultMap.put("cityValue", cityValue);
@@ -518,7 +522,7 @@
                    //行业贡献率计算
                    NumberFormat numberFormat = NumberFormat.getInstance();
                    numberFormat.setMaximumFractionDigits(2);
                    if (allDeviceSum != null) {
                    if (allDeviceSum != null && (Double) allDeviceSum != 0d) {
                        contributionRate = numberFormat.format(professionSum / ((Double) allDeviceSum) * 100) + "%";
                    }
                }