package com.zy.asrs.task; import com.zy.asrs.task.core.ReturnT; import com.zy.asrs.task.handler.MesPakoutHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; /** * 轮询MES接口,生成出库单据 */ @Slf4j @Component public class MesPakoutScheduler { @Autowired MesPakoutHandler handler; @Scheduled(cron = "0/30 * * * * ?") private void execute() { ReturnT result = null; result = handler.start(); if (!result.isSuccess()) { log.error(""); } } }