File was renamed from screen-job/src/main/java/com/moral/api/task/HistoryAqiInsertTask.java |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.moral.api.service.HistoryAqiService; |
| | | import com.moral.api.service.CityConfigService; |
| | | import com.moral.api.service.CityWeatherService; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.context.XxlJobHelper; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | |
| | | @Component |
| | | public class HistoryAqiInsertTask { |
| | | public class WeatherTask { |
| | | |
| | | @Autowired |
| | | private HistoryAqiService historyAqiService; |
| | | private CityWeatherService cityWeatherService; |
| | | |
| | | //墨迹小时aqi数据接入 |
| | | @XxlJob("insertHistoryAqi") |
| | | public ReturnT insertHistoryAqi() { |
| | | //城市气象实测数据insert |
| | | @XxlJob("insertCityWeather") |
| | | public ReturnT insertCityWeather(){ |
| | | try { |
| | | historyAqiService.insertHistoryAqi(); |
| | | cityWeatherService.insertCityWeather(); |
| | | } catch (Exception e) { |
| | | XxlJobHelper.log(e.getMessage()); |
| | | return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); |