| | |
| | | import com.moral.entity.Area; |
| | | import com.moral.entity.City; |
| | | import com.moral.entity.MonitorPoint; |
| | | import com.moral.entity.Province; |
| | | import com.moral.mapper.AQIMapper; |
| | | import com.moral.mapper.AreaMapper; |
| | | import com.moral.mapper.CityMapper; |
| | |
| | | String parentName = ""; |
| | | String name1 = ""; |
| | | Integer code = 0; |
| | | Integer parentCode = 0; |
| | | if (areaCode != null) { |
| | | Area area = areaMapper.getAreaByAreaCode(areaCode); |
| | | City city = cityMapper.getCityByCityCode(cityCode); |
| | | name1 = area.getAreaName(); |
| | | parentName = city.getCityName(); |
| | | parentCode = city.getCityCode(); |
| | | code = areaCode; |
| | | if ("市辖区".equals(name1)) { |
| | | name1 = parentName; |
| | | parentName = provinceMapper.getProvinceByProvinceCode(provinceCode).getProvinceName(); |
| | | Province province = provinceMapper.getProvinceByProvinceCode(provinceCode); |
| | | parentName = province.getProvinceName(); |
| | | parentCode = province.getProvinceCode(); |
| | | code = cityCode; |
| | | } |
| | | } else { |
| | | City city = cityMapper.getCityByCityCode(cityCode); |
| | | name1 = city.getCityName(); |
| | | parentName = provinceMapper.getProvinceByProvinceCode(provinceCode).getProvinceName(); |
| | | Province province = provinceMapper.getProvinceByProvinceCode(provinceCode); |
| | | parentName = province.getProvinceName(); |
| | | code = cityCode; |
| | | parentCode = province.getProvinceCode(); |
| | | if ("市辖区".equals(name1)) { |
| | | name1 = parentName; |
| | | parentName = ""; |
| | |
| | | hashMap.put("name1", name1); |
| | | hashMap.put("parentName", parentName); |
| | | hashMap.put("cityCode", code); |
| | | hashMap.put("parentCode", parentCode); |
| | | hashSet.add(hashMap); |
| | | } |
| | | List<Element> elements = Dom4jUtils.readDocument(); |
| | |
| | | Date startTime = sdf.parse(sdf.format(c.getTime())); |
| | | |
| | | for (Map<String, Object> hashmap : hashSet) { |
| | | hashmap.put("typeFormat", "%Y-%m-%d %H:%i:%s"); |
| | | hashmap.put("startTime", startTime); |
| | | hashmap.put("endTime", endTime); |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("typeFormat", "%Y-%m-%d %H:%i:%s"); |
| | | map1.put("startTime", startTime); |
| | | map1.put("endTime", endTime); |
| | | map1.put("cityCode", Integer.valueOf(hashmap.get("cityCode").toString())); |
| | | List<List<Map<String, Object>>> list1 = new ArrayList<>(); |
| | | List<List<Map<String, Object>>> list2 = new ArrayList<>(); |
| | | |
| | |
| | | List<Map<String, Object>> list3 = new ArrayList<>(); |
| | | List<Map<String, Object>> list4 = new ArrayList<>(); |
| | | if (i < 10) { |
| | | hashmap.put("time", "0" + i + ":00:00"); |
| | | map1.put("time", "0" + i + ":00:00"); |
| | | } else { |
| | | hashmap.put("time", i + ":00:00"); |
| | | map1.put("time", i + ":00:00"); |
| | | } |
| | | List<Map<String, Object>> tempList = realWeatherMapper.getTemp(hashmap); |
| | | List<Map<String, Object>> O3List = aqiMapper.getO3(hashmap); |
| | | List<Map<String, Object>> tempList = realWeatherMapper.getTemp(map1); |
| | | List<Map<String, Object>> O3List = aqiMapper.getO3(map1); |
| | | if (O3List.size() == 0) { |
| | | map1.put("cityCode", Integer.valueOf(hashmap.get("parentCode").toString())); |
| | | O3List = aqiMapper.getO3(map1); |
| | | } |
| | | list3.addAll(tempList); |
| | | list4.addAll(O3List); |
| | | list1.add(list3); |
| | | list2.add(list4); |
| | | } |
| | | |
| | | List<List<Map<String, Object>>> list = new ArrayList<>(); |
| | | if (list2.get(0).size() == 0) { |
| | | list = list1; |
| | |
| | | list.add(list3); |
| | | } |
| | | } |
| | | |
| | | if (list.get(0).size()!=0) { |
| | | |
| | | if (list.get(0).get(0).size() > 2) { |
| | | List<Map<String, Object>> constantList = new ArrayList<>(); |
| | |
| | | hashmap.put("constants", constantList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | int count = 0; |
| | | for (Map<String, Object> map : hashSet) { |
| | |
| | | if (hour1.equals(nextNextDay)) { |
| | | nextDayList.add(hourlyMap); |
| | | } |
| | | |
| | | map.put("data", nextDayList); |
| | | } |
| | | } |