自动化立体仓库 - WCS系统
lty
2025-03-24 de9702be46355443acf6522bcd7c6adc01547091
#优化输送线循环逻辑
2个文件已修改
39 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -39,6 +39,7 @@
import com.zy.core.thread.SiemensDevpThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -113,7 +114,8 @@
    @Autowired
    private SiteController siteController;
    //出库站点至112循环站点
    public synchronized void shiftTargetToCyclePoint() throws IOException, InterruptedException{
    @Synchronized
    public void shiftTargetToCyclePoint() throws IOException, InterruptedException{
        try{
            for (DevpSlave devp : slaveProperties.getDevp()) {
                for (DevpSlave.Sta outSta : devp.getOutSta()) {
@@ -123,6 +125,7 @@
                    StaProtocol staProtocol2 = devpThread.getStation().get(1002);
                    StaProtocol staProtocol3 = devpThread.getStation().get(1003);
                    StaProtocol staProtocol4 = devpThread.getStation().get(1004);
                    StaProtocol staProtocol6 = devpThread.getStation().get(111);
                    if (staProtocol == null) {
                        continue;
                    } else {
@@ -148,9 +151,14 @@
                    } else {
                        staProtocol4 = staProtocol4.clone();
                    }
                    if (staProtocol6 == null) {
                        continue;
                    } else {
                        staProtocol6 = staProtocol6.clone();
                    }
                    boolean result = false;
                    switch(outSta.getStaNo()){
                        case 105: if (staProtocol1.isLoading()){
                        case 105: if (staProtocol1.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 105){
                            result = true;
                        }
                        case 107: if (staProtocol2.isLoading()){
@@ -159,15 +167,28 @@
                        case 109: if (staProtocol3.isLoading()){
                            result = true;
                        }
                        case 110: if (staProtocol4.isLoading()){
                        case 110: if ((staProtocol4.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 110) || ((staProtocol6.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 111))){
                            result = true;
                        }
                        default: break;
                    }
                    if(result){
                        staProtocol.setStaNo((short) 112);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        if(staProtocol.getSiteId() == 107 || staProtocol.getSiteId() == 109){
                            StaProtocol staProtocol5 = devpThread.getStation().get(staProtocol.getSiteId() - 1);
                            if (staProtocol5== null) {
                                continue;
                            } else {
                                staProtocol5 = staProtocol5.clone();
                            }
                            if((staProtocol5.isLoading() && staProtocol5.getStaNo() == 107) || ((staProtocol5.isLoading() && staProtocol5.getStaNo() == 109))){
                                staProtocol5.setStaNo((short) 112);
                                MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol5));
                            }
                        }else{
                            staProtocol.setStaNo((short) 112);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        }
                    }
                }
            }
@@ -188,9 +209,9 @@
                } else {
                    staProtocol = staProtocol.clone();
                }
                WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo());
                if(wrkMast != null &&  wrkMast.getWrkNo() < 9000 && wrkMast.getWrkNo() > 7000){
                    staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
                TaskWrk taskWrk = taskWrkMapper.selectById(staProtocol.getWorkNo());
                if(taskWrk != null &&  taskWrk.getWrkNo() < 9001 && taskWrk.getWrkNo() > 6000){
                    staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint()));
                    MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                }
            }
src/main/resources/application.yml
@@ -45,7 +45,7 @@
wms:
  #堆垛机任务暂存数
  count: 4
  count: 5
  # 是否开启上报
  start: true
  # WMS系统ip