| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.BarcodeUploadHandler; |
| | | import com.zy.asrs.task.handler.ReportToDismantleTheStackHandler; |
| | | 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.07.25 |
| | | * 徐工汉云..............以下.............上饶江铜.............拆垛信息上传 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ReportToDismantleTheStackScheduler { |
| | | |
| | | @Autowired |
| | | private BarcodeUploadHandler barcodeUploadHandler; |
| | | private ReportToDismantleTheStackHandler reportToDismantleTheStackHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){//条码上传中控 |
| | | int[] staNos =new int[]{216,220}; |
| | | // @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){//拆垛信息上传 |
| | | int[] staNos =new int[]{118,119,120,121}; |
| | | for (int staNo : staNos){ |
| | | ReturnT<String> result = barcodeUploadHandler.start(staNo); |
| | | if (result.getCode()==200){ |
| | | break; |
| | | try{ |
| | | ReturnT<String> result = reportToDismantleTheStackHandler.start(staNo); |
| | | if (result.getCode()==200){ |
| | | break; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("站点"+staNo+"拆垛信息上传处理失败,异常信息:"+e); |
| | | } |
| | | } |
| | | } |