dubin
18 小时以前 df407d0f867f5063895be21fde14963b0ae4776e
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -171,11 +171,46 @@
                        News.error("" + mark + " - 4" + " - 工作档中已存在该站状态为( 3.开始执行入库任务 )的数据,工作号={}", wrkMast.getWrkNo());
                        // led 异常显示
                        if (ledThread != null) {
                            String errorMsg = "工作档已存在该条码号===>>" + barcode;
                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
//                        if (ledThread != null) {
//                            String errorMsg = "工作档已存在该条码号===>>" + barcode;
//                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
//                        }
                        LiftProtocol liftProtocol = devpThread.getLiftStatus();
                        if (liftProtocol == null) {
                            continue;
                        }
                        continue;
                        if (liftProtocol.getMode() != 1) {
                            continue;
                        }
                        if (liftProtocol.getDeviceStatus() != 0) {
                            continue;
                        }
                        if (liftProtocol.getWorkNo() > 0) {
                            continue;
                        }
                        Integer staNo = Utils.getStaNoByLocNo(wrkMast.getLocNo());
                        LiftCommand command = new LiftCommand();
                        command.setWorkNo(wrkMast.getWrkNo());
                        command.setSourceStaNo(inSta.getStaNo());
                        command.setTargetStaNo(staNo);
                        barcodeThread.setBarcode("");
                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, command));
                        if (result) {
                            News.info("WCS--->PLC下发任务成功:{}",command.toString());
                        }
                        if (!result) {
                            throw new CoolException("更新plc站点信息失败");
                        }
                        wrkMast.setWrkSts(3L);// 3.设备执行中
                        wrkMast.setCrnStrTime(new Date());
                        wrkMastService.updateById(wrkMast);
                        break;
                    }
                    LiftProtocol liftProtocol = devpThread.getLiftStatus();
@@ -458,6 +493,7 @@
        //检测出库站是否可出
        StaProtocol staProtocol = devpThread.getStation().get(100);
        StaProtocol staProtocol101 = devpThread.getStation().get(101);
        if (staProtocol == null) {
            return;
        }
@@ -467,6 +503,18 @@
        }
        if (staProtocol.isLoading()) {
            return;
        }
        if (staProtocol101 == null){
            return;
        }
        if (staProtocol101.isLoading()){
            return;
        }
        if (!staProtocol101.isAutoing()){
            return;
        }
@@ -821,7 +869,7 @@
                                    , wrkDetl.getKpCstmrName()
                                    , wrkDetl.getOrderNo()
                                    , wrkDetl.getBatch()
//                                , wrkDetl.getCstateid$()
                                    , locNo
                            ));
                        }
                    } else {
@@ -855,7 +903,7 @@
                                        , wrkDetlLog.getKpCstmrName()
                                        , wrkDetlLog.getOrderNo()
                                        , wrkDetlLog.getBatch()
//                                    , wrkDetlLog.getCstateid$()
                                        , locNo
                                ));
                            }
                        }
@@ -925,6 +973,16 @@
                // 获取叉车站点
                StaProtocol staProtocol = devpThread.getStation().get(staNo);
                StaProtocol staProtocol1 = devpThread.getStation().get(122);
                WrkMast wrkMastOut = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 12).eq("sta_no",staNo));
                WrkMast wrkMastIn = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 3).eq("source_sta_no", staNo));
                if (!Cools.isEmpty(wrkMastOut)){
                    reset = false;
                    continue;
                }
                if (!Cools.isEmpty(wrkMastIn)){
                    reset = false;
                    continue;
                }
                if (staProtocol == null) {
                    continue;
                }
@@ -1036,7 +1094,8 @@
                            wrkDetl.getSupp(),
                            wrkDetl.getKpCstmrName(),
                            wrkDetl.getOrderNo(),
                            wrkDetl.getBatch()
                            wrkDetl.getBatch(),
                            locNo
                    ));
                }
            }
@@ -1090,4 +1149,23 @@
            }
        }
    }
    public void deviceRunning(int mark) {
        for (LedSlave led : slaveProperties.getLed()){
            // 命令集合
            List<LedCommand> commands = new ArrayList<>();
            WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 12));
            if (Cools.isEmpty(wrkMast)){
                return;
            }
            // 获取LED线程
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            if (ledThread == null) {
                News.error("未找到LED线程:[id:{}]", led.getId());
                continue;
            }
            MessageQueue.offer(SlaveType.Led, led.getId(), new Task(5, "设备出库任务运行中"));
        }
    }
}