dubin
21 小时以前 28c1186f7e00f24c21a0abc79684e58ac1245ae4
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.*;
@@ -738,6 +739,12 @@
                    if (crnProtocol.modeType == CrnModeType.AUTO && crnProtocol.getTaskNo().equals(wrkMast.getWrkNo().shortValue()) && crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.forkPosType == CrnForkPosType.HOME) {
                        log.info("堆垛机出库完成 - 开始执行");
                        Date date = new Date();
                        long diffInMillis = date.getTime() - wrkMast.getCrnStrTime().getTime();
                        if (!(diffInMillis >= 30000)){
                            continue;
                        }
                        // 命令下发区 --------------------------------------------------------------------------
                        // 下发站点信息
@@ -836,6 +843,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();
@@ -905,7 +915,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;
                                }
@@ -934,7 +944,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;
                                }
@@ -1200,6 +1210,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;
@@ -1215,7 +1227,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()) {
                    // 命令下发区 --------------------------------------------------------------------------
                    // 堆垛机控制过滤
@@ -2092,6 +2104,11 @@
                    News.error("" + mark + " - 1" + " - 堆垛机处于等待确认且任务完成状态,但未找到工作档。堆垛机号={},工作号={}", crn.getId(), crnProtocol.getTaskNo());
                    continue;
                }
                Date date = new Date();
                long diffInMillis = date.getTime() - wrkMast.getCrnStrTime().getTime();
                if (!(diffInMillis >= 30000)){
                    continue;
                }
                // 入库 + 库位转移  ==> 4.入库完成
                if (wrkMast.getWrkSts() == 3) {
                    wrkMast.setWrkSts(4L);