TQS
2023-12-12 0fb5bde724660f19e83a4de3b7c73d9a988e0274
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1189,6 +1189,7 @@
                        SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                        SteProtocol steProtocol = steThread.getSteProtocol();
                        if (steProtocol == null) { continue; }
                        if (steProtocol.loca==0) continue;
                        if (steProtocol.isIdle()) {
                            // 已经存在吊车执行任务时,则过滤
@@ -1257,10 +1258,21 @@
    public synchronized boolean locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol){
        Collections.shuffle(slave.getCrnOutStn());
        for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) {
            // 获取工作状态为11(生成出库ID)的出库工作档
            // 获取工作状态为11,12,13,14,15, 16(生成出库ID)的出库工作档
            WrkMast wrkMast = wrkMastMapper.selectPakOutStep111215(slave.getId(), crnStn.getStaNo());
            if (wrkMast == null) {
                continue;
            }
            /*
             * 100、200存在进行中的盘点任务,则不执行盘点任务
             * */
            if (wrkMast.getIoType().equals(107)){
                Integer countPan = wrkMastMapper.selectWrkStsAndIoType107Count(wrkMast.getSourceStaNo(),wrkMast.getWrkNo());
                if (countPan > 0){
                    News.error("MainServiceImpl  locToCrnStn 1271行"+"盘点出库跳过,存在进行中可能堵塞任务数{}个",countPan);
                    continue;
                }
            }
            // 获取堆垛机出库站信息
@@ -1286,7 +1298,7 @@
                    Integer sour = wrkMast.getSourceStaNo();
                    List<WrkMast> wrkMasts = wrkMastMapper.selectWrkStsAndIoType0(sour);
                    if (wrkMasts.size() > 0){
                        News.error("MainServiceImpl  1028行"+"存在捡料、盘点未入库货物,2号堆垛机暂时禁止出库!!!");
                        News.error("MainServiceImpl  1300行"+"存在捡料、盘点未入库货物,2号堆垛机暂时禁止出库!!!");
                        return false;
                    }
@@ -1295,7 +1307,7 @@
                            .eq("sta_no",300)
                            .last(" and wrk_sts>11 and io_type in (103,107) "));
                    if(!Cools.isEmpty(one)){
                        News.error("MainServiceImpl  1099行"+"存在捡料、盘点未入库货物,2号堆垛机暂时禁止出库!!!");
                        News.error("MainServiceImpl  1309行"+"存在捡料、盘点未入库货物,2号堆垛机暂时禁止出库!!!");
                        continue;
                    }
                }
@@ -1514,6 +1526,7 @@
                            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                            SteProtocol steProtocol = steThread.getSteProtocol();
                            if (steProtocol == null) { continue; }
                            if (steProtocol.loca==0) continue;
                            if (steProtocol.isIdle()) {
                                //小车只能绑定一笔作业中任务
@@ -2535,6 +2548,7 @@
            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId());
            SteProtocol steProtocol = steThread.getSteProtocol();
            if (steProtocol == null) { continue; }
            if (steProtocol.loca==0) continue;
            if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) {
                return steProtocol.getSteNo().intValue();
            }
@@ -2551,6 +2565,7 @@
            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId());
            SteProtocol steProtocol = steThread.getSteProtocol();
            if (steProtocol == null) { continue; }
            if (steProtocol.loca==0) continue;
            if (steProtocol.isIdle()) {
                if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) {
                    return steProtocol.getSteNo().intValue();
@@ -2969,6 +2984,7 @@
                            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                            SteProtocol steProtocol = steThread.getSteProtocol();
                            if (steProtocol == null) { continue; }
//                            if (steProtocol.loca==0) continue;
                            if (steProtocol.isIdle()) {
                                // 命令下发区 --------------------------------------------------------------------------
                                SteCommand steCommand = new SteCommand();
@@ -3061,6 +3077,7 @@
                        SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                        SteProtocol steProtocol = steThread.getSteProtocol();
                        if (steProtocol == null) { continue; }
//                        if (steProtocol.loca==0) continue;
                        // 穿梭车重新定位排列层
                        if (!steThread.confirmPos()) {
                            News.error("{}号穿梭车重新定位失败!作业工作档任务号:{}", wrkMast.getSteNo(), wrkMast.getWrkNo());
@@ -3133,6 +3150,7 @@
                            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                            SteProtocol steProtocol = steThread.getSteProtocol();
                            if (steProtocol == null) { continue; }
//                            if (steProtocol.loca==0) continue;
                            if (steProtocol.isIdle()) {
                                // 命令下发区 --------------------------------------------------------------------------
                                SteCommand steCommand = new SteCommand();
@@ -3329,6 +3347,7 @@
                            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                            SteProtocol steProtocol = steThread.getSteProtocol();
                            if (steProtocol == null) { continue; }
                            if (steProtocol.loca==0) continue;
                            if (steProtocol.isIdle()) {
                                // 命令下发区 --------------------------------------------------------------------------
                                SteCommand steCommand = new SteCommand();
@@ -3358,6 +3377,7 @@
                        SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                        SteProtocol steProtocol = steThread.getSteProtocol();
                        if (steProtocol == null) { continue; }
                        if (steProtocol.loca==0) continue;
                        // 穿梭车重新定位排列层
                        if (!steThread.confirmPos()) {
                            News.error("{}号穿梭车重新定位失败!作业工作档任务号:{}", wrkMast.getSteNo(), wrkMast.getWrkNo());
@@ -3399,6 +3419,7 @@
            SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId());
            SteProtocol steProtocol = steThread.getSteProtocol();
            if (steProtocol == null) { continue; }
            if (steProtocol.loca==0) continue;
            if (steProtocol.getWaiting() && steProtocol.getTaskNo() == 0){
                News.info("ste[id={}] 收到等待WCS确认信号,但是任务号(地址V824)为0", steProtocol.getSteNo());
            }