| | |
| | | package com.moral.task; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Collection; |
| | |
| | | |
| | | @Component |
| | | public class AQIDataInsertTask { |
| | | |
| | | @Resource |
| | | private AQIService aqiService; |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @XxlJob("insertData") |
| | | public ReturnT insertData(String param){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | return returnT; |
| | | } |
| | | |
| | | @XxlJob("insertStationData") |
| | | public ReturnT insertStationData(String param) { |
| | | int state = aqiService.insertStationData(); |
| | | if (state == 200) { |
| | | return new ReturnT(200, "插入成功"); |
| | | } else { |
| | | return new ReturnT(500, "无国控数据,插入失败,请查看接口"); |
| | | } |
| | | } |
| | | } |