cjl
2024-04-23 65b70cf13a2ec91013d876771be878c165cae3a4
screen-api/src/main/java/com/moral/api/service/impl/CityWeatherServiceImpl.java
@@ -14,6 +14,8 @@
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
@@ -44,7 +46,11 @@
    public Map<String, Object> dressingIndex(Map map) {
        Map<String,Object> resultMap = new HashMap<>();
        int city_code = Integer.parseInt(map.get("regionCode").toString());
        String time = map.get("time").toString();
        String time = "";
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 2);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH");
        time = sdf.format(calendar.getTime())+":00:00";
        QueryWrapper<CityWeather> cityWeatherQueryWrapper = new QueryWrapper<>();
        cityWeatherQueryWrapper.eq("city_code",city_code);
        cityWeatherQueryWrapper.eq("time",time);