Commit 59520582 authored by caotao's avatar caotao

修改定时任务不生效

parent eab76049
...@@ -20,6 +20,9 @@ import org.slf4j.Logger; ...@@ -20,6 +20,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -45,7 +48,10 @@ import java.util.*; ...@@ -45,7 +48,10 @@ import java.util.*;
* @author duanwei * @author duanwei
* @date 2023-02-01 * @date 2023-02-01
*/ */
@Service @Service
@EnableScheduling
@EnableAsync
public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlCarMileage> public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlCarMileage>
implements IWlCarMileageService { implements IWlCarMileageService {
...@@ -282,6 +288,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC ...@@ -282,6 +288,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
@Override @Override
@Scheduled(cron = "${mileage.segmentation.cron}") @Scheduled(cron = "${mileage.segmentation.cron}")
@Async
public void mileageSegmentation() { public void mileageSegmentation() {
log.info("轨迹切分定时任务开始执行时间.............{}", LocalDateTime.now()); log.info("轨迹切分定时任务开始执行时间.............{}", LocalDateTime.now());
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment