package org.ts.ddcs.job;

import org.ts.ddcs.log.LogHelper;
import org.ts.ddcs.worker.DataProcessHolder;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author dylan
 */
@Component
public class RtuOnlineCheckTaskListener {

    /**
     * 在线检测工作任务
     * @throws Exception
     */
   @XxlJob("RtuOnlineCheckJobHandler")
    public void rtuOnlineCheckJobHandler() throws Exception {
        try {
            LogHelper.info("*********** rtu online check task:" + new Date().toString());
            Date dt = new Date();
            DataProcessHolder.newInstance().dataProcess.submitOnlineCheckTask(dt);
        }catch (Exception e){
            LogHelper.error(e);
            throw e;
        }
    }
}
