package com.zcloud.primeport.plan;

import com.jjb.saas.framework.job.Job;
import com.jjb.saas.framework.job.annotation.JobRegister;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.zcloud.primeport.plan.mjDevice.TwoCarUtil;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class TwoLevelCarXxlJob implements Job {

    @Resource
    private TwoCarUtil twoCarUtil;

    @Override
    @JobRegister(cron = "0 25 0 * * ?", jobDesc = "闭区定时任务，每日00:25进行当日二级门禁可进门车辆推送", triggerStatus = 1)
    @XxlJob("com.zcloud.plan.TwoLevelCarDockXxlJob")
    public ReturnT<String> execute(String param) {
        try {
            // 二级门禁车辆定时对接（含同步一级门禁）
            twoCarUtil.scheduledCarCompany();
        } catch (Exception e) {
            e.printStackTrace();
            return ReturnT.FAIL;
        }
        return ReturnT.SUCCESS;
    }
}
