kimi42345
2020-03-02 2411eadd4ad4bef5c08c6ba2ea5898ea72136e29
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.highdatas.mdm.job;
 
import com.highdatas.mdm.entity.SysAssemble;
import com.highdatas.mdm.service.ISysAssembleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.session.StandardSession;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.web.context.request.RequestContextHolder;
 
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionContext;
import java.util.Enumeration;
 
/**
 * @author kimi
 * @description
 * @date 2020-03-02 9:35
 */
@Slf4j
@Component
public class XxlJobHandler {
    @Autowired
    ISysAssembleService assembleService;
 
    @XxlJob("assembleJob")
    public ReturnT<String> demoJobHandler(String assembleId) throws Exception {
        XxlJobLogger.log("assemble Job start");
        if (StringUtils.isEmpty(assembleId)) {
            XxlJobLogger.log("params: assembleId is null");
        }
        SysAssemble assemble = assembleService.selectById(assembleId);
        if (assemble == null) {
            XxlJobLogger.log("params: assemble is not found");
        }
 
//        assembleService.run()
 
        return ReturnT.SUCCESS;
    }
 
}