package com.ruoyi.system.util;
|
|
import com.ruoyi.system.service.ICarService;
|
import com.ruoyi.system.service.IDriverService;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2025/3/17 11:01
|
*/
|
@Component
|
public class TaskUtil {
|
|
@Resource
|
private ICarService carService;
|
|
@Resource
|
private IDriverService driverService;
|
|
|
/**
|
* 定时任务获取新车辆数据
|
*/
|
@Scheduled(fixedRate = 1000 * 60)
|
public void taskSaveNewCar() {
|
carService.taskSaveNewCar();
|
}
|
|
|
/**
|
* 定时任务获取新驾驶员数据
|
*/
|
@Scheduled(fixedRate = 1000 * 60)
|
public void taskSaveNewDriver() {
|
driverService.taskSaveNewDriver();
|
}
|
}
|