package com.zy.nc.task; import com.zy.asrs.task.core.ReturnT; import com.zy.nc.task.handler.PlanOrderHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @Slf4j @Component public class PlanOrderTask { @Autowired private PlanOrderHandler planOrderHandler; @Scheduled(cron = "0/3 * * * * ? ") public void execute() { ReturnT returnT = planOrderHandler.start(); if (!returnT.isSuccess()) { log.error(returnT.getMsg()); } } }