| | |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.time.Duration; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.OptionalDouble; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.DoubleStream; |
| | | |
| | |
| | | CityAqiMonthly cityAqiMonthly = cityAqiMonthlyMapper.selectOne(cityAqiMonthlyQueryWrapper); |
| | | Double compositeIndex = null; |
| | | String compositeIndexYearOnYear = null; |
| | | Integer pm25 = null; |
| | | Double pm25 = null; |
| | | String pm25YearOnYear = null; |
| | | if (cityAqiMonthly != null) { |
| | | Map<String, Object> aqiMap = JSONObject.parseObject(cityAqiMonthly.getValue(), Map.class); |
| | |
| | | |
| | | //3.PM2.5浓度 |
| | | if (aqiMap.get("PM2_5") != null) { |
| | | pm25 = Integer.parseInt(aqiMap.get("PM2_5").toString()); |
| | | pm25 = Objects.nonNull(aqiMap.get("PM2_5"))?Double.parseDouble(aqiMap.get("PM2_5").toString()):0d; |
| | | } |
| | | currentRankingResult.put("PM2_5", pm25 + "ug/m³"); |
| | | |
| | |
| | | Map<Integer, Map<String, Object>> monthlyCumulativeResult = null; |
| | | Double cityCompositeIndex = null; |
| | | String cityCompositeIndexYearOnYear = null; |
| | | Integer cityPM25 = null; |
| | | Double cityPM25 = null; |
| | | String cityPM25YearOnYear = null; |
| | | if (!"1".equals(month)) { |
| | | Map<String, Object> cumulativeRankingResult = new HashMap<>(); |
| | |
| | | cityCompositeIndexYearOnYear = cityMap.get("compositeIndex_yearOnYear").toString(); |
| | | } |
| | | //地级市PM2.5 |
| | | cityPM25 = (int) Double.parseDouble(cityMap.get("PM2_5").toString()); |
| | | cityPM25 = Double.parseDouble(cityMap.get("PM2_5").toString()); |
| | | if (cityMap.get("PM2_5_yearOnYear") != null) { |
| | | cityPM25YearOnYear = cityMap.get("PM2_5_yearOnYear").toString(); |
| | | } |
| | |
| | | * @param pm25YearOnYear 中心城区(地级市)pm2.5同比 |
| | | * @description 获取本期所有县市区与中心城区(地级市)因子对比情况 |
| | | */ |
| | | private Map<String, Object> getAreaCurrentMonthResult(Map<Integer, String> areasMap, List<CityAqiMonthly> areaData, Double compositeIndex, String compositeIndexYearOnYear, Integer pm25, String pm25YearOnYear) { |
| | | private Map<String, Object> getAreaCurrentMonthResult(Map<Integer, String> areasMap, List<CityAqiMonthly> areaData, Double compositeIndex, String compositeIndexYearOnYear, Double pm25, String pm25YearOnYear) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("compositeIndex", compositeIndex); |
| | | result.put("compositeIndexYearOnYear", compositeIndexYearOnYear); |