package com.fs.app.task;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.app.service.CallTaskService;
import com.fs.company.domain.CompanyVoiceRobotic;
import com.fs.company.mapper.CompanyVoiceRoboticMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 企业微信SOP定时任务管理类
 * 负责处理各种定时任务，包括SOP规则检查、消息发送、数据清理等
 *
 * @author 系统
 * @version 1.0
 */
@Component
@Slf4j
@AllArgsConstructor
public class Task {

    private final CompanyVoiceRoboticMapper roboticMapper;

    private CallTaskService taskService;
    /**
     * 定时拉人进群
     */
//    @Scheduled(cron = "0 * * * * ?")
//    public void runTask(){
//        List<CompanyVoiceRobotic> list = roboticMapper.selectList(new QueryWrapper<CompanyVoiceRobotic>().eq("task_status", 1));
//        list.forEach(e -> {
//
//        });
//    }


    @Scheduled(cron = "0 0/1 * * * ?")
    public void cidWorkflowRun(){
        taskService.cidWorkflowCallRun();
    }
}
