From c3e1f9b9af29647bd157f2ea268bc56b2d3b9df1 Mon Sep 17 00:00:00 2001 From: 于紫祥_1901 <email@yuzixiang_1910> Date: Mon, 31 Aug 2020 14:47:46 +0800 Subject: [PATCH] 风场图update --- src/main/java/com/moral/service/impl/WeatherServiceImpl.java | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/moral/service/impl/WeatherServiceImpl.java b/src/main/java/com/moral/service/impl/WeatherServiceImpl.java index 7125594..667a819 100644 --- a/src/main/java/com/moral/service/impl/WeatherServiceImpl.java +++ b/src/main/java/com/moral/service/impl/WeatherServiceImpl.java @@ -648,10 +648,19 @@ //���4��������������� double value = 160.0 * 8; int nowHour = Integer.valueOf(sdf1.format(now).substring(11, 13)); + int nowMinute = Integer.valueOf(sdf1.format(now).substring(14, 16)); String format = sdf1.format(now).substring(0, 13) + ":00:00"; if (nowHour < 8) { return resultList; } + + if (nowMinute >= 46) { + nowHour = nowHour + 1; + cal.setTime(now); + cal.add(Calendar.HOUR_OF_DAY,1); + format=sdf1.format(cal.getTime()).substring(0, 13) + ":00:00"; + } + for (Map<String, Object> resultMap : resultList) { if (resultMap.get("type").equals("������")) { if (sdf.parse(time).getTime() == sdf.parse(sdf.format(now)).getTime()) { @@ -668,6 +677,7 @@ if (rhour == 0) { rhour = 24; } + if (rhour == nowHour) { Map<String, Object> sumO3Map = hangzhouAqiMapper.getSumO3(hashMap); double v = value - Double.valueOf(sumO3Map.get("O3Sum").toString()); @@ -765,4 +775,5 @@ } } } + } -- Gitblit v1.8.0