#
Junjie
2023-11-24 0017b42552d3d12dfa460b6c98b5fa6672f45309
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -918,6 +918,14 @@
                return false;//存在入库任务,禁止出库
            }
            //同库位组校验
            List<String> outerLoc = Utils.getGroupOuterLoc(wrkMast.getSourceLocNo());
            List<LocMast> outerLocMasts = locMastService.selectNotEmptyLocNos(outerLoc);
            if (!outerLocMasts.isEmpty()) {
                News.info("{}任务,浅库位存在货物,系统等待中", wrkMast.getWrkNo());
                return false;//浅库位存在未执行任务
            }
            //获取源站
            LiftStaProtocol liftStaProtocol = NyLiftUtils.getLiftStaByLev(basDevp.getLiftNo(), Utils.getLev(wrkMast.getSourceLocNo()));
            if (liftStaProtocol == null) {
@@ -1132,7 +1140,7 @@
                //搜索是否有其他任务占用了提升机,如果占用提升机的任务和当前任务相同,则运行执行
                WrkMast wrkMast1 = wrkMastMapper.selectLiftWrkMast(liftProtocol.getLiftNo().intValue());
                if (wrkMast1 != null && wrkMast1.getWrkNo().intValue() != wrkMast.getWrkNo().intValue()) {
                    News.info("{0}号提升机,被其他任务{1}占用且和当前任务{2}不相同,禁止派发", liftSlave.getId(), wrkMast1.getWrkNo(), wrkMast.getWrkNo());
                    News.info("{}号提升机,被其他任务{}占用且和当前任务{}不相同,禁止派发", liftSlave.getId(), wrkMast1.getWrkNo(), wrkMast.getWrkNo());
                    continue;
                }
@@ -2311,6 +2319,7 @@
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            log.info("悬挂线,wms返回结果:" + jsonObject);
            Integer code = jsonObject.getInteger("code");
            if (code.equals(200)) {//呼叫AGV
                return true;
@@ -2496,6 +2505,7 @@
                        Utils.wapperSetCondition(wrapper,"batch",locDetl.getBatch());
                        Utils.wapperSetCondition(wrapper,"three_code",locDetl.getThreeCode());
                        Utils.wapperSetCondition(wrapper,"dead_time",locDetl.getDeadTime());
                        Utils.wapperSetCondition(wrapper,"supp_code",locDetl.getSuppCode());//料箱码
                        WrkDetl detl = wrkDetlService.selectOne(wrapper);
                        if (Cools.isEmpty(detl)) {
                            String suppCode = "";
@@ -2594,8 +2604,10 @@
            for (Integer staNo : led.getStaArr()) {
                // 获取叉车站点
                StaProtocol staProtocol = devpThread.getStation().get(staNo);
                if (staProtocol == null) { continue; }
                if (staProtocol.getWorkNo() != 0) {
                if (staProtocol == null) {
                    continue;
                }
                if (staProtocol.isLoading()) {
                    reset = false;
                    break;
                }
@@ -2604,13 +2616,9 @@
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            // led显示默认内容
            if (reset && !ledThread.isLedMk()) {
                ledThread.setLedMk(false);
                ledThread.setLedMk(true);
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
                    News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                }else {
//                    News.error("{}号LED命令下发成功!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                    MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()));
                    ledThread.setLedMk(false);
                    log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                }
            }
        }