dubin
2 天以前 2dac51421b0a90277a05188234f6ea954a4e204b
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -24,6 +24,7 @@
import com.zy.common.utils.News;
import com.zy.core.CrnThread;
import com.zy.core.DevpThread;
import com.zy.core.ThreadHandler;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.*;
@@ -453,9 +454,11 @@
                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
                    if (wrkMast == null) {
                        // 无拣料数据
                        log.info("无拣料数据,托盘码:{}",barcode);
                        continue;
                    }
                    if ((wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) || Cools.isEmpty(wrkMast.getStaNo()) || Cools.isEmpty(wrkMast.getSourceStaNo())) {
                        log.info("工作档入出库类型不符合,入出库类型:{},工作档目标站{},工作档源站{}",wrkMast.getIoType(),wrkMast.getStaNo(),wrkMast.getSourceStaNo());
                        continue;
                    }
                    // 获取目标站
@@ -834,6 +837,9 @@
    public synchronized void crnIoExecute(Integer mark) {
        for (CrnSlave crn : slaveProperties.getCrn()) {
            //获取堆垛机出库站的下一站信息
            SiemensDevpThread devpThread =(SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, crn.getId());
            StaProtocol staProtocol = devpThread.getStation().get(1002);
            // 获取堆垛机信息
            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
@@ -903,7 +909,7 @@
                        if (wrkMast.getIoType() >= 100) {
                            WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep1(crn.getId(), wrkMast.getSourceStaNo());
                            if (wrkMast1 != null) {
                                if (Integer.parseInt(wrkMast1.getSourceLocNo().substring(2,5)) == 1){
                                if (Integer.parseInt(wrkMast1.getSourceLocNo().substring(2,5)) == 1 || (staProtocol.isAutoing()&&staProtocol.isLoading())){
                                    this.outPut(crn, crnProtocol, mark);
                                    continue;
                                }
@@ -932,7 +938,7 @@
                        if (wrkMast.getIoType() >= 100) {
                            WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep1(crn.getId(), wrkMast.getSourceStaNo());
                            if (wrkMast1 != null) {
                                if (Integer.parseInt(wrkMast1.getSourceLocNo().substring(2,5)) == 29){
                                if (Integer.parseInt(wrkMast1.getSourceLocNo().substring(2,5)) == 29 || (staProtocol.isAutoing()&&staProtocol.isLoading())){
                                    this.outPut(crn, crnProtocol, mark);
                                    continue;
                                }
@@ -969,16 +975,17 @@
     * @return
     */
    private Integer getCrnStation(String locNo) {
        String bay = locNo.substring(2, 5);
        String bay = locNo.substring(2, 5);//0100203
        if (Integer.parseInt(bay) == 1) {
            return 1;
        } else if (Integer.parseInt(bay) == 29) {
            return 2;
        }
        if (Integer.parseInt(locNo.substring(0, 2)) >= 14) {
            return 1;
        } else {
//        if (Integer.parseInt(locNo.substring(0, 2)) >= 14) {
        if (Integer.parseInt(bay) >= 14) {
            return 2;
        } else {
            return 1;
        }
    }
@@ -1197,6 +1204,8 @@
                // 获取堆垛机出库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId());
                StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo());
                //堆垛机出库站点的下一站
                StaProtocol staProtocol1 = devpThread.getStation().get(1002);
                if (staProtocol == null) {
                    News.infoNoLog("" + mark + " - 2" + " - 3" + " - 堆垛机出库站信息(staProtocol!=null继续执行,否则循环终止):staProtocol=" + staProtocol);
                    break;
@@ -1212,7 +1221,7 @@
                    break;
                }
                // 判断堆垛机出库站状态
                if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
                if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()&&staProtocol1.isAutoing()&&!staProtocol1.isLoading()) {
                    // 命令下发区 --------------------------------------------------------------------------
                    // 堆垛机控制过滤