自动化立体仓库 - WMS系统
pang.jiabao
2024-09-03 587fee18e22ed0ceee502ca12025a40e9d63989f
src/main/java/com/zy/asrs/task/RailwayPlatformScheduler.java
@@ -2,27 +2,33 @@
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);
            }
        }
    }