package com.zcloud.fire.check.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.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.zcloud.fire.check.api.FireCheckListServiceI;
import com.zcloud.fire.check.domain.enums.ListManagerCheckPeriodEnum;
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 WaitFireCheckLisTenJob implements Job {

     @Autowired
     private FireCheckListServiceI fireCheckListServiceI;

    @Override
    @JobRegister(cron = "0 5 0 1,11,21 * ?", jobDesc = "每旬待排查消息提醒",triggerStatus = 1)
    @XxlJob("com.zcloud.fire.check.plan.WaitFireCheckLisTenJob")
    public ReturnT<String> execute(String param) {

        log.info( "============待排查消息提醒(消防点检)==========开始");
        XxlJobHelper.log( "============待排查消息提醒(消防点检)==========开始");
        fireCheckListServiceI.waitFireCheckList(ListManagerCheckPeriodEnum.TEN_DAYS.getCode());
        log.info( "============待排查消息提醒(消防点检)==========结束");
        return ReturnT.SUCCESS;
    }
}
