fxkh-txl-service/src/main/java/com/whdc/component/AutoCallTaskScheduledGS.java

54 lines
1.6 KiB
Java
Raw Normal View History

package com.whdc.component;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whdc.mapper.AutoCallConfigMapper;
import com.whdc.mapper.AutoCallPersonMapper;
import com.whdc.model.autocall.AutoCallPerson;
import com.whdc.model.autocall.AutoCallTask;
import com.whdc.service.autocall.AutoCallTaskService2;
import com.whdc.utils.AutoCallHelper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Profile;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.PreDestroy;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* @author lyf
* @since 2025-06-20
*/
@Component
@Slf4j
@Profile({"gs"})
public class AutoCallTaskScheduledGS {
@Autowired
private AutoCallTaskService2 autoCallTaskService;
@Autowired
private AutoCallPersonMapper personMapper;
@Autowired
private AutoCallConfigMapper configMapper;
@Autowired
private AutoCallHelper autoCallHelper;
private final AtomicBoolean initialized = new AtomicBoolean(false);
//早上10点后晚上24点前每隔15分钟执行一次
@Scheduled(cron = "0 0/15 10-23 * * ?")
public void generateTaskLoop() {
// autoCallTaskService.generateFakeCallLyfOnly();
}
}