|  |  | 
 |  |  |         parameters.put("start", sdf.parse(time));
 | 
 |  |  |         parameters.put("end", sdf.parse(nextDay));
 | 
 |  |  |         MonitorPoint monitorPoint = monitorPointMapper.selectByPrimaryKey(Integer.valueOf(monitorPointId));
 | 
 |  |  | 
 | 
 |  |  |         //List<Map<String, Object>> forecastList = forecastWeatherMapper.getForecastHour(parameters);
 | 
 |  |  | 
 | 
 |  |  |         if (monitorPoint.getAreaCode() == null) {
 | 
 |  |  |             parameters.put("cityCode", monitorPoint.getCityCode());
 | 
 |  |  |         } else {
 | 
 |  |  | 
 |  |  |         parameters.put("typeFormat", "%Y-%m-%d %H:%i:%s");
 | 
 |  |  |         String cityName = parameters.get("city").toString();
 | 
 |  |  |         Area area = areaMapper.getAreaByName(cityName);
 | 
 |  |  |         MonitorPoint monitorPoint;
 | 
 |  |  |         Integer parentCode = 0;
 | 
 |  |  |         Integer code = 0;
 | 
 |  |  |         String name = "";
 | 
 |  |  |         if (area == null) {
 | 
 |  |  | 
 |  |  |                 name = province.getProvinceName();
 | 
 |  |  |             } else {
 | 
 |  |  |                 code = city.getCityCode();
 | 
 |  |  |                 parentCode = city.getProvinceCode();
 | 
 |  |  |                 name = city.getCityName();
 | 
 |  |  |             }
 | 
 |  |  |         } else {
 | 
 |  |  |             code = area.getAreaCode();
 | 
 |  |  |             parentCode = area.getCityCode();
 | 
 |  |  |             name = area.getAreaName();
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         parameters.put("cityCode", code);
 | 
 |  |  |         parameters.put("name", name);
 | 
 |  |  |         parameters.put("areaCode", code);
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  |         String time = parameters.get("time").toString();
 | 
 |  |  |         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 | 
 |  |  |         SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 | 
 |  |  | 
 |  |  |         String beforeDay = sdf.format(cal.getTime());
 | 
 |  |  |         parameters.put("start", selectTime);
 | 
 |  |  |         parameters.put("end", end);
 | 
 |  |  |         Integer fcode=0;
 | 
 |  |  |         List<Map<String, Object>> forecastList = forecastWeatherMapper.getForecast(parameters);
 | 
 |  |  |         if (forecastList.size() == 0) {
 | 
 |  |  |             parameters.put("cityCode", parentCode);
 | 
 |  |  |             forecastList = forecastWeatherMapper.getForecast(parameters);
 | 
 |  |  |             if (forecastList.size() == 0) {
 | 
 |  |  |                 List<Area> areaList = areaMapper.getAreaByCityCode(code);
 | 
 |  |  |                 for (Area area1 : areaList) {
 | 
 |  |  |                 if (area1 != null) {
 | 
 |  |  |                     parameters.put("cityCode", area1.getAreaCode());
 | 
 |  |  |                     fcode=area1.getAreaCode();
 | 
 |  |  |                     forecastList = forecastWeatherMapper.getForecast(parameters);
 | 
 |  |  |                     if (forecastList.size() != 0) {
 | 
 |  |  |                         break;
 | 
 |  |  |                     }
 | 
 |  |  |                 }
 | 
 |  |  |             }
 | 
 |  |  |         }else {
 | 
 |  |  |             fcode= Integer.valueOf(parameters.get("cityCode").toString());
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         List<Map<String, Object>> foreList = new ArrayList<>();
 | 
 |  |  | 
 |  |  |             hashMap.put("PM25C", "");
 | 
 |  |  |             hashMap.put("PM10C", "");
 | 
 |  |  |             hashMap.put("city", parameters.get("name").toString());
 | 
 |  |  |             hashMap.put("code",fcode);
 | 
 |  |  |             if (sdf.parse(time).getTime() <= now.getTime()) {
 | 
 |  |  |                 hashMap.put("fxTime", (beforeDay + " 15:00").substring(5, 16));
 | 
 |  |  |             } else {
 | 
 |  |  | 
 |  |  |             }
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         String ac = parameters.get("cityCode").toString();
 | 
 |  |  |         List<Map<String, Object>> aqiList = hangzhouAqiMapper.getAqi(parameters);
 | 
 |  |  |         if (aqiList.size() == 0) {
 | 
 |  |  |             parameters.put("areaCode", parentCode);
 | 
 |  |  |             parameters.put("cityCode", code);//320500
 | 
 |  |  |             aqiList = hangzhouAqiMapper.getAqi(parameters);
 | 
 |  |  |             if (aqiList.size() == 0) {
 | 
 |  |  |                 List<Area> areaList = areaMapper.getAreaByCityCode(code);
 | 
 |  |  |                 for (Area area1 : areaList) {
 | 
 |  |  |                     if (area1 != null) {
 | 
 |  |  |                         parameters.put("cityCode", area1.getAreaCode());
 | 
 |  |  |                         aqiList = hangzhouAqiMapper.getAqi(parameters);
 | 
 |  |  |                         if (aqiList.size() != 0) {
 | 
 |  |  |                             break;
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |                     }
 | 
 |  |  |                 }
 | 
 |  |  |             }
 | 
 |  |  |         }
 | 
 |  |  |         List<Map<String, Object>> realAqilist = new ArrayList<>();
 | 
 |  |  |         for (Map<String, Object> aqiMap : aqiList) {
 | 
 |  |  |             Map<String, Object> hashMap = new HashMap<>();
 | 
 |  |  | 
 |  |  |             hashMap.put("city", parameters.get("name").toString());
 | 
 |  |  |             realAqilist.add(hashMap);
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         for (Map<String, Object> map : realAqilist) {
 | 
 |  |  |             Date endTime = sdf1.parse(map.get("time").toString());
 | 
 |  |  |             cal.setTime(endTime);
 | 
 |  |  |             cal.add(Calendar.HOUR, -8);
 | 
 |  |  |             Date startTime = cal.getTime();
 | 
 |  |  |             Map<String, Object> hashMap = new HashMap<>();
 | 
 |  |  |             hashMap.put("areaCode", Integer.valueOf(parameters.get("areaCode").toString()));
 | 
 |  |  |             hashMap.put("cityCode", Integer.valueOf(parameters.get("cityCode").toString()));
 | 
 |  |  |             hashMap.put("start", startTime);
 | 
 |  |  |             hashMap.put("end", endTime);
 | 
 |  |  |             Map<String, Object> O3Map = hangzhouAqiMapper.getAvgO3EightHours(hashMap);
 | 
 |  |  |             map.put("O3_8H", O3Map.get("O3_8H").toString());
 | 
 |  |  |             if (O3Map.get("O3C_8H") != null) {
 | 
 |  |  |                 map.put("O3C_8H", O3Map.get("O3C_8H").toString());
 | 
 |  |  |             }
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         //光照
 | 
 |  |  |         String ac = parameters.get("areaCode").toString();
 | 
 |  |  | 
 | 
 |  |  |         Map<String, Object> params = new HashMap<>();
 | 
 |  |  |         if (ac.endsWith("00")) {
 | 
 |  |  |             params.put("cityCode", Integer.valueOf(ac));
 | 
 |  |  | 
 |  |  |             Integer pointId = point.getId();
 | 
 |  |  |             pointList.add(pointId);
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         List<Device> deviceList = deviceMapper.getDeviceListByMonitorPointIds(pointList);
 | 
 |  |  |         List<String> macList = new ArrayList<>();
 | 
 |  |  |         List<Map<String, Object>> beamList = new ArrayList<>();
 | 
 |  |  | 
 |  |  |             cal.add(Calendar.HOUR, -6);
 | 
 |  |  |             Date startTime = cal.getTime();
 | 
 |  |  |             Map<String, Object> hashMap = new HashMap<>();
 | 
 |  |  |             hashMap.put("cityCode", Integer.valueOf(parameters.get("areaCode").toString()));
 | 
 |  |  |             hashMap.put("cityCode", Integer.valueOf(parameters.get("cityCode").toString()));
 | 
 |  |  |             hashMap.put("start", startTime);
 | 
 |  |  |             hashMap.put("end", endTime);
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |                     map.put("precip6", "");
 | 
 |  |  |                 }
 | 
 |  |  |             }
 | 
 |  |  |             if ((!map.containsKey("SO2C")) && map.containsKey("SO2")) {
 | 
 |  |  |                 map.put("SO2C", map.get("SO2").toString());
 | 
 |  |  |             }
 | 
 |  |  |             if ((!map.containsKey("NO2C")) && map.containsKey("NO2")) {
 | 
 |  |  |                 map.put("SO2C", map.get("SO2").toString());
 | 
 |  |  |             }
 | 
 |  |  |             if ((!map.containsKey("O3C")) && map.containsKey("O3")) {
 | 
 |  |  |                 map.put("O3C", map.get("O3").toString());
 | 
 |  |  |             }
 | 
 |  |  |             if ((!map.containsKey("COC")) && map.containsKey("CO")) {
 | 
 |  |  |                 map.put("COC", map.get("CO").toString());
 | 
 |  |  |             }
 | 
 |  |  |             if ((!map.containsKey("PM25C")) && map.containsKey("PM25")) {
 | 
 |  |  |                 map.put("PM25C", map.get("PM25").toString());
 | 
 |  |  |             }
 | 
 |  |  |             if ((!map.containsKey("PM10C")) && map.containsKey("PM10")) {
 | 
 |  |  |                 map.put("PM10C", map.get("PM10").toString());
 | 
 |  |  |             }
 | 
 |  |  | 
 | 
 |  |  |         }
 | 
 |  |  |         return resultList;
 | 
 |  |  |     }
 | 
 |  |  | 
 |  |  |                 String time = map.get("time").toString() + ":00";
 | 
 |  |  |                 Map<String, Object> hashMap = new HashMap<>();
 | 
 |  |  |                 hashMap.put("time", time);
 | 
 |  |  |                 String cityName = map.get("city").toString();
 | 
 |  |  |                 Area area = areaMapper.getAreaByName(cityName);
 | 
 |  |  |                 if (area == null) {
 | 
 |  |  |                     City city = cityMapper.getCityByName(cityName);
 | 
 |  |  |                     if (city == null) {
 | 
 |  |  |                         Province province = provinceMapper.getProvinceByName(cityName);
 | 
 |  |  |                         if (province == null) {
 | 
 |  |  |                             return;
 | 
 |  |  |                         } else {
 | 
 |  |  |                             hashMap.put("cityCode", province.getProvinceCode());
 | 
 |  |  |                         }
 | 
 |  |  |                     } else {
 | 
 |  |  |                         Integer cityCode = city.getCityCode();
 | 
 |  |  |                         hashMap.put("cityCode", cityCode);
 | 
 |  |  |                     }
 | 
 |  |  |                 } else {
 | 
 |  |  |                     Integer areaCode = area.getAreaCode();
 | 
 |  |  |                     hashMap.put("cityCode", areaCode);
 | 
 |  |  |                 }
 | 
 |  |  | 
 | 
 |  |  |                 hashMap.put("cityCode",Integer.valueOf(map.get("code").toString()));
 | 
 |  |  |                 Map<String, Object> jsonMap = new HashMap<>();
 | 
 |  |  |                 for (String key : map.keySet()) {
 | 
 |  |  |                     if (!key.equals("city") && !key.equals("time") && !key.equals("type") && !key.equals("fxTime")) {
 |