From 109d5e215fa6f92bb391cb414743badf40bcbec2 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Sat, 13 Jul 2024 09:33:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=BB=9F=E8=AE=A1=E5=AE=9A=E6=97=B6=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=A4=A9=E6=B0=94=E6=9C=8D=E5=8A=A1=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/controller/DeviceStatus.java | 3 +-- .../controller/WeatherForecastController.java | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DeviceStatus.java b/zc-business/src/main/java/com/zc/business/controller/DeviceStatus.java index 48596918..2d3b050c 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DeviceStatus.java +++ b/zc-business/src/main/java/com/zc/business/controller/DeviceStatus.java @@ -100,8 +100,7 @@ public class DeviceStatus { executor.shutdown(); } - @Scheduled(cron = "0 30 23 * * ?") - //@Scheduled(cron = "0 30 * * * ?") + //@Scheduled(cron = "0 30 23 * * ?") public void periodicDataClearing() { StatusService statusService = SpringUtils.getBean(StatusService.class); LocalDateTime startTime = LocalDateTime.now().minusMonths(UniversalEnum.THREE.getNumber()); diff --git a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java index ad47570d..d1e14635 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java +++ b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java @@ -265,13 +265,13 @@ public class WeatherForecastController extends BaseController { String visLevel = jsonObject.getString("visLevel"); - if (Objects.equals(visLevel, UniversalEnum.ONE.getValue()) || Objects.equals(visLevel, UniversalEnum.TWO.getValue())) { + if (Objects.equals(visLevel, UniversalEnum.ONE.getValue())) { jsonObject.put("weatherCondition", UniversalEnum.CLEAR_WEATHER.getValue()); jsonObject.put("weatherConditionCode", UniversalEnum.CLEAR_WEATHER.getNumber()); - } else if (Objects.equals(visLevel, UniversalEnum.THREE.getValue()) || Objects.equals(visLevel, UniversalEnum.FOUR.getValue())) { + } else if (Objects.equals(visLevel, UniversalEnum.TWO.getValue()) || Objects.equals(visLevel, UniversalEnum.THREE.getValue())) { jsonObject.put("weatherCondition", UniversalEnum.CLOUDY.getValue()); jsonObject.put("weatherConditionCode", UniversalEnum.CLOUDY.getNumber()); - } else if (Objects.equals(visLevel, UniversalEnum.FIVE.getValue()) || Objects.equals(visLevel, UniversalEnum.SIX.getValue())) { + } else if (Objects.equals(visLevel, UniversalEnum.FOUR.getValue()) || Objects.equals(visLevel, UniversalEnum.FIVE.getValue()) || Objects.equals(visLevel, UniversalEnum.SIX.getValue())) { jsonObject.put("weatherCondition", UniversalEnum.OVERCAST_SKY.getValue()); jsonObject.put("weatherConditionCode", UniversalEnum.OVERCAST_SKY.getNumber()); } @@ -397,8 +397,9 @@ public class WeatherForecastController extends BaseController { } } - jsonArray.add(i,jsonObject); - }; + jsonArray.add(i, jsonObject); + } + ; if (jsonArray.size() != UniversalEnum.ZERO.getNumber()) { redisCache.deleteObject(UniversalEnum.CURRENT_WEATHER_AND_FORECAST_INFORMATION_SINGLE_WORD.getValue() + numStake); redisCache.setCacheObject(UniversalEnum.CURRENT_WEATHER_AND_FORECAST_INFORMATION_SINGLE_WORD.getValue() + numStake, jsonArray);