#
taisheng
2025-05-24 53ae8e478f6034579303c51bdf881ffa526c942c
src/main/java/com/zy/core/MainProcess.java
@@ -1,11 +1,15 @@
package com.zy.core;
import com.zy.asrs.service.impl.MainServiceImpl;
import com.zy.core.properties.SystemProperties;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PreDestroy;
import java.util.ArrayList;
/**
 * WCS主流程
@@ -16,8 +20,12 @@
@Component
public class MainProcess {
    @Autowired
    private MainServiceImpl mainService;
    // 所属线程
    private Thread thread;
    // 频率
    private int i = 0;
    /**
     * =====>>  开始工作
@@ -26,25 +34,30 @@
        thread = new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    // 间隔
                    Thread.sleep(1000);
                    // 系统运行状态判断
                    if (SystemProperties.WCS_RUNNING_STATUS.get()) {
                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                        continue;
                    }
                    // 入出库  ===>>  调用RCS进行入出库
                    mainService.crnIoExecute();
                    // 出库  ===>>  堆垛机出库站到出库站
                    mainService.crnStnToOutStn();
                    //演示模式
                    mainService.demo();
                    //自动派发任务
   //                 mainService.autoDistribute();
                    //自动完成任务
//                    mainService.autoCompleteTask();
                    //agv取放货完成
//                    mainService.autoCompleteAGV();
                    // 间隔
                    Thread.sleep(1500);
                    log.info("WCS 工作中 .....................");
                } catch (Exception e) {
                    e.printStackTrace();
                }