cjl
2024-01-25 9cac94cd48fde9c9cb1b8f37cd652d974ca8d349
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
package com.moral.api.task;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import com.moral.api.service.DeviceService;
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 JudgeOffLineDeviceTask {
 
    @Autowired
    private DeviceService deviceService;
 
    //判断设备是否离线
    @XxlJob("judgeOffLineDevice")
    public ReturnT judgeOffLineDevice() {
        try {
            deviceService.judgeOffLineDevice();
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
        }
        return ReturnT.SUCCESS;
    }
}