New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.PlcLogHandler; |
| | | 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 |
| | | */ |
| | | @Component |
| | | public class PlcLogScheduler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(PlcLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private PlcLogHandler plcLogHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | ReturnT<String> returnT = plcLogHandler.start(); |
| | | if (!returnT.isSuccess()) { |
| | | log.error(returnT.getMsg()); |
| | | } |
| | | } |
| | | |
| | | } |