package com.zcloud.fire.check.plan;

import com.jjb.saas.framework.job.Job;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.zcloud.fire.check.api.FireDeviceServiceI;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@RequiredArgsConstructor
@Component
@Slf4j
public class FireDeviceOverTimeJob implements Job {

     @Autowired
     private FireDeviceServiceI fireDeviceServiceI;

    @Override
//    @JobRegister(cron = "0 30 0 * * ?", jobDesc = "消防设备到期提请",triggerStatus = 1)
//    @XxlJob("com.zcloud.fire.check.plan.FireDeviceOverTimeJob")
    public ReturnT<String> execute(String param) {

        log.info( "============消防设备到期提请(消防点检)==========开始");
        XxlJobHelper.log( "============消防设备到期提请(消防点检)==========");

        fireDeviceServiceI.deviceOverTimeMessage();

        log.info( "============消防设备到期提请(消防点检)==========结束");
        return ReturnT.SUCCESS;
    }
}
