package cn.iocoder.yudao.module.crm.job.salesperformance;

import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.crm.service.crmclues.CrmCluesService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class FollowUpCluesJob {

    // TODO: 2024/11/04  - 每天晚上2点 执行一次 判断三天内是否有跟进
    @Resource
    private CrmCluesService cluesService;

    @XxlJob("followUpClues")
    @TenantJob // --- ⚠️ 这个注解 会将租户列表拉出来 完了后逐个租户执行 定时任务需要注意
    public ReturnT<String> execute() {
        log.info("开始 线索跟进任务");
        cluesService.autoConfirmJob();
        log.info("结束 线索跟进任务");
        return ReturnT.SUCCESS;
    }
}
