| | |
| | | } else {
|
| | | String s = sdf1.format(now).split(" ")[1].split(":")[0];
|
| | | Integer hour = Integer.valueOf(s);
|
| | | if (hour > 7) {
|
| | | hashMap.put("fxTime", (format + " 07:00").substring(5, 16));
|
| | | } else if (hour > 3 && hour < 7) {
|
| | | if (hour > 15) {
|
| | | hashMap.put("fxTime", (format + " 15:00").substring(5, 16));
|
| | | } else if (hour > 7 && hour < 15) {
|
| | | hashMap.put("fxTime", (format + " 07:00").substring(5, 16));
|
| | | }
|
| | | }
|
| | | Map<String, Object> jsonMap = (Map<String, Object>) JSONObject.parse(map.get("json").toString());
|
| | |
| | | beamList = historyHourlyMapper.getBeamByMacs(parameters);
|
| | | }
|
| | |
|
| | |
|
| | | List<Map<String, Object>> realList = realWeatherMapper.getRealWeather(parameters);
|
| | | List<Map<String, Object>> realWeatherList = new ArrayList<>();
|
| | | for (Map<String, Object> realMap : realList) {
|
| | |
| | | for (Map<String, Object> realMap : realWeatherList) {
|
| | | String rtime = realMap.get("time").toString();
|
| | | for (Map<String, Object> beamMap : beamList) {
|
| | | String btime = realMap.get("time").toString();
|
| | | String btime = beamMap.get("time").toString();
|
| | | if (btime.equals(rtime)) {
|
| | | realMap.put("beam", beamMap.get("beam").toString());
|
| | | realMap.put("beam", beamMap.get("beam").toString().split("\\.")[0]);
|
| | | }
|
| | | }
|
| | | Calendar calendar = Calendar.getInstance();
|
| | |
| | | for (Map<String, Object> map : resultList) {
|
| | | String date = map.get("time").toString().substring(0, 16);
|
| | | map.put("time", date);
|
| | | if (map.get("AQI") != null) {
|
| | | String aqi = map.get("AQI").toString().split("\\.")[0];
|
| | | map.put("AQI", aqi);
|
| | | }
|
| | | if (map.get("precip") != null) {
|
| | | String aqi = map.get("precip").toString();
|
| | | if (aqi.equals("0.0")) {
|
| | | map.put("precip", "");
|
| | | }
|
| | | }
|
| | | if (map.get("precip6") != null) {
|
| | | String aqi = map.get("precip6").toString();
|
| | | if (aqi.equals("0.0")) {
|
| | | map.put("precip6", "");
|
| | | }
|
| | | }
|
| | | }
|
| | | return resultList;
|
| | | }
|