package com.zy.asrs.task; import com.zy.asrs.task.core.ReturnT; import com.zy.asrs.task.handler.MatHandler; import com.zy.asrs.task.handler.PlcLogHandler; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; /** * Created by vincent on 2020/7/7 */ @Slf4j @Component public class MatScheduler { @Autowired private MatHandler matHandler; // @Scheduled(cron = "0/3 * * * * ? ") @Scheduled(cron = "0 0 23 * * ? ") private void execute(){ ReturnT returnT = matHandler.start(); if (!returnT.isSuccess()) { log.error(returnT.getMsg()); } } }