| | |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.RailwayPlatformHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Created by Monkey D. Luffy on 2023.09.17 |
| | | * 徐工汉云..............以下.............上饶江铜.............自动补空板 |
| | | * 徐工汉云..............以下.............上饶江铜.............上报月台 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class RailwayPlatformScheduler { |
| | | |
| | | @Autowired |
| | | private RailwayPlatformHandler railwayPlatformHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | // @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){//上报月台 |
| | | int[] staNos =new int[]{144}; |
| | | for (int staNo : staNos){ |
| | | ReturnT<String> result = railwayPlatformHandler.start(staNo); |
| | | if (result.getCode()==200){ |
| | | break; |
| | | try{ |
| | | ReturnT<String> result = railwayPlatformHandler.start(staNo); |
| | | if (result.getCode()==200){ |
| | | break; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("站点"+staNo+"上报月台处理失败,异常信息:"+e); |
| | | } |
| | | } |
| | | } |