#
luxiaotao1123
2020-08-11 a853cf5758095db64924c8ccacd43fd61a20d597
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -246,7 +246,7 @@
                StaProtocol staProtocol = devpThread.getStation().get(outSta.getStaNo());
                if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) {
                    // 查询工作档
                    WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(staProtocol.getSiteId());
                    WrkMast wrkMast = wrkMastMapper.selectPakOutStep2(staProtocol.getSiteId());
                    if (wrkMast == null) {
                        continue;
                    }
@@ -304,8 +304,8 @@
            if (basCrnp == null) {
                continue;
            }
            // 只有当堆垛机空闲 或者 无任务时才继续执行
            if (crnProtocol.getStatusType() == CrnStatusType.IDLE || crnProtocol.getTaskNo() == 0) {
            // 只有当堆垛机空闲 并且 无任务时才继续执行
            if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0) {
                // 如果最近一次是入库模式
                if (crnProtocol.getLastIo().equals("I")) {
                    if (basCrnp.getInEnable().equals("Y")) {
@@ -348,23 +348,23 @@
                flag = true;
            }
            if (!flag) {
                return;
                continue;
            }
            // 获取工作状态为2(设备上走)的入库工作档
            WrkMast wrkMast = wrkMastMapper.selectPakInStep2(slave.getId(), staProtocol.getWorkNo());
            if(null == wrkMast) {
                log.error("查询无待入库数据--wrk_sts=2, 工作号={}", staProtocol.getWorkNo());
                return;
                continue;
            }
            // 获取库位信息
            LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
            if (locMast == null) {
                log.error("查询库存无数据--库位号{}", wrkMast.getLocNo());
                return;
                continue;
            }
            if (!locMast.getLocSts().equals("S") && !locMast.getLocSts().equals("Q")) {
                log.error("库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), locMast.getLocSts());
                return;
                continue;
            }
            // 命令下发区 --------------------------------------------------------------------------
@@ -378,7 +378,6 @@
            crnCommand.setDestinationPosZ(locMast.getLev1().shortValue()); // 层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task<>(2, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                throw new CoolException("更新堆垛机信息失败");
            }
        }
    }
@@ -392,6 +391,11 @@
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId());
            StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo());
            // 获取工作状态为11(生成出库ID)的出库工作档
            WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId());
            if (wrkMast == null) {
                continue;
            }
        }