package com.zy.asrs.task; import com.zy.asrs.task.core.ReturnT; import com.zy.asrs.task.handler.BarcodeUploadHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * Created by Monkey D. Luffy on 2023.07.25 * 徐工汉云..............以下.............上饶江铜.............条码上传中控 */ @Slf4j @Component public class BarcodeUploadScheduler { @Autowired private BarcodeUploadHandler barcodeUploadHandler; // @Scheduled(cron = "0/3 * * * * ? ") private void execute(){//条码上传中控 int[] staNos =new int[]{215,219}; for (int staNo : staNos){ try{ ReturnT result = barcodeUploadHandler.start(staNo); if (result.getCode()==200){ break; } }catch (Exception e){ log.error("工作档[workNo={}]条码上传中控失败", staNo); log.error("处理失败,异常信息:"+e); } } } }