cjl
9 hours ago bcc076d63c5c2ff473adb5ac15ea242559086000
screen-job/src/main/java/com/moral/api/task/WeatherTask.java
@@ -1,8 +1,10 @@
package com.moral.api.task;
import com.moral.api.service.RadarHourlySummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.moral.api.service.CityWeatherForecastService;
import com.moral.api.service.CityWeatherService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
@@ -14,9 +16,15 @@
    @Autowired
    private CityWeatherService cityWeatherService;
    //城市气象实测数据insert
    @Autowired
    private CityWeatherForecastService cityWeatherForecastService;
    @Autowired
    private RadarHourlySummaryService hourlySummaryService;
    //城市逐小时气象实测数据insert
    @XxlJob("insertCityWeather")
    public ReturnT insertCityWeather(){
    public ReturnT insertCityWeather() {
        try {
            cityWeatherService.insertCityWeather();
        } catch (Exception e) {
@@ -25,4 +33,27 @@
        }
        return ReturnT.SUCCESS;
    }
    //城市明日逐小时预测气象预测数据insert
    @XxlJob("insertCityWeatherForecast")
    public ReturnT insertCityWeatherForecast() {
        try {
            cityWeatherForecastService.insertCityWeatherForecast();
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
        }
        return ReturnT.SUCCESS;
    }
    @XxlJob("processLastHour")
    public ReturnT processLastHour() {
        try {
            hourlySummaryService.processLastHour();
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
        }
        return ReturnT.SUCCESS;
    }
}