| | |
| | | String percent = null; |
| | | if(cityPollutionLevelCompare!=null){ |
| | | Integer compareFineDays = cityPollutionLevelCompare.getExcellentWeatherDays() + cityPollutionLevelCompare.getGoodWeatherDays(); |
| | | percent = (fineDays - compareFineDays) + " 天"; |
| | | Integer percentInt = fineDays - compareFineDays; |
| | | if (percentInt > 0) { |
| | | percent = "+" + percentInt + " 天"; |
| | | } else { |
| | | percent = percentInt + " 天"; |
| | | } |
| | | |
| | | } |
| | | //计算省内排名 |
| | | Integer provinceRange = null; |
| | |
| | | |
| | | Double pm2_5 = calculateSensorYOY(dataMap, compareDataMap, "PM2_5"); |
| | | if (pm2_5 != null) |
| | | result.put("PM2_5", pm2_5.intValue() + " μg/m³"); |
| | | result.put("PM2_5", pm2_5.intValue() > 0 ? "+" + pm2_5.intValue() + " μg/m³" : pm2_5.intValue() + " μg/m³"); |
| | | |
| | | Double pm10 = calculateSensorYOY(dataMap, compareDataMap, "PM10"); |
| | | if (pm10 != null) |
| | | result.put("PM10", pm10.intValue() + " μg/m³"); |
| | | result.put("PM10", pm10.intValue() > 0 ? "+" + pm10.intValue() + " μg/m³" : pm10.intValue() + " μg/m³"); |
| | | |
| | | Double so2 = calculateSensorYOY(dataMap, compareDataMap, "SO2"); |
| | | if (so2 != null) |
| | | result.put("SO2", so2.intValue() + " μg/m³"); |
| | | result.put("SO2", so2.intValue() > 0 ? "+" + so2.intValue() + " μg/m³" : so2.intValue() + " μg/m³"); |
| | | |
| | | |
| | | Double no2 = calculateSensorYOY(dataMap, compareDataMap, "NO2"); |
| | | if (no2 != null) |
| | | result.put("NO2", no2.intValue() + " μg/m³"); |
| | | result.put("NO2", no2.intValue() > 0 ? "+" + no2.intValue() + " μg/m³" : no2.intValue() + " μg/m³"); |
| | | |
| | | |
| | | Double o3 = calculateSensorYOY(dataMap, compareDataMap, "O3"); |
| | | if (o3 != null) |
| | | result.put("O3", o3.intValue() + " μg/m³"); |
| | | result.put("O3", o3.intValue() > 0 ? "+" + o3.intValue() + " μg/m³" : o3.intValue() + " μg/m³"); |
| | | |
| | | |
| | | Double co = calculateSensorYOY(dataMap, compareDataMap, "CO"); |
| | | if (co != null) { |
| | | co = AmendUtils.sciCal(co, 1); |
| | | result.put("CO", co + " mg/m³"); |
| | | result.put("CO", co.intValue() > 0 ? "+" + co.intValue() + " mg/m³" : co.intValue() + " mg/m³"); |
| | | } |
| | | |
| | | //计算综合指数同比数据 |
| | |
| | | if (compositeIndex != null && compareCompositeIndex != null) { |
| | | Double compareResult = MathUtils.division(compositeIndex - compareCompositeIndex, compareCompositeIndex, 3); |
| | | compareResult = MathUtils.mul(compareResult, 100); |
| | | result.put("compositeIndex", compareResult + "%"); |
| | | result.put("compositeIndex", compareResult > 0 ? "+" + compareResult + " %" : compareResult + " %"); |
| | | } |
| | | if (result.size() != 7) |
| | | return null; |