1.
import com.chint.ziam.library.utils.TimeSpan;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.DisplayName;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Slf4j
@EnableScheduling
@Component
public class AccessBarOutJob {
@Autowired
private IAccessBarService accessBarService;
@XxlJob("AccessBarOutJob")
@DisplayName("电子围栏出栏")
@Transactional(rollbackFor = Exception.class)
public ReturnT execute() throws Exception {
ReturnT result = ReturnT.SUCCESS;
TimeSpan span = TimeSpan.begin();
log.info("AccessBarOutJob start...");
try {
//引入需要触发定时任务的方法
定时任务xjob使用
于 2022-12-28 10:08:40 首次发布