目录添加 @EnableScheduling 注解定义定时任务类和方法通过配置项控制定时任务是否开启方法一 @ConditionalOnProperty方法二 Boolean 标志位使用"-"使 cron 定时任务关闭参考资料添加 @EnableScheduling 注