jinpengyong
2020-08-13 c75b4210328b98913de7eeef507e6d88069bcecc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.moral.task;
 
import java.text.ParseException;
 
import javax.annotation.Resource;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
 
import com.moral.service.RealWeatherService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
 
@Component
public class RealWeatherInsertTask {
    private static transient Logger logger = LoggerFactory.getLogger(RealWeatherInsertTask.class);
 
    @Resource
    private RealWeatherService realWeatherService;
 
    @XxlJob("realWeatherHour")
    public ReturnT insertRealWeather(String param) throws ParseException {
        int count = realWeatherService.insertRealWeather();
        if (count > 0) {
            return new ReturnT(200, "插入成功");
        }else {
            return new ReturnT(500, "插入失败");
        }
    }
}