| | |
| | | package com.moral.task; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.moral.service.AQIService; |
| | | import com.moral.util.HttpUtils; |
| | | import com.moral.util.WxMappingJackson2HttpMessageConverter; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.util.EntityUtils; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Component |
| | | public class AQIDataInsertTask { |
| | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | @XxlJob("insertData") |
| | | public ReturnT insertData(){ |
| | | public ReturnT insertData(String param){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter()); |