1.springboot集成分布式定时任务调度Elastic-Job
1.pom.xml依赖Elastic-Job
<!-- 定时任务 -->
<dependency>
<groupId>com.github.kuhn-he</groupId>
<artifactId>elastic-job-lite-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>
2.application配置
#定时任务
elaticjob.zookeeper.server-lists=172.16.102.11:2181,172.16.102.12:2181,172.16.102.13:2181
elaticjob.zookeeper.namespace=ccsm-bill-job
修改对应zk集群地址
##3.编写定时任务
package com.zhcx.common.job;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.