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 3c296314..53794d82 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 @@ -267,15 +267,22 @@ public class WeatherForecastController extends BaseController { String visLevel = jsonObject.getString("visLevel"); - 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.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.FOUR.getValue()) || Objects.equals(visLevel, UniversalEnum.FIVE.getValue()) || Objects.equals(visLevel, UniversalEnum.SIX.getValue())) { + Double rhu = jsonObject.getDouble("rhu"); + + if (rhu > UniversalEnum.SIXTY.getNumber()) { jsonObject.put("weatherCondition", UniversalEnum.OVERCAST_SKY.getValue()); jsonObject.put("weatherConditionCode", UniversalEnum.OVERCAST_SKY.getNumber()); + } else { + 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.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.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()); + } } } else {