pang.jiabao
2024-11-06 6548c75a24d8d0c23c8167980465831128abf579
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -116,9 +116,7 @@
        for (DevpSlave devp : slaveProperties.getDevp()) {
            // 遍历入库口
            for (DevpSlave.Sta inSta : devp.getInSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                BarcodeThread barcodeThreadMat = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcodeMat());
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
@@ -127,15 +125,6 @@
                } else {
                    staProtocol = staProtocol.clone();
                }
                if (barcodeThread == null) {
                    continue;
                }
                if (barcodeThreadMat == null) {
                    continue;
                }
                // 判断是否满足入库条件
                if (staProtocol.stateType == DevpStateType.AUTO //自动
                        && staProtocol.workType == DevpWorkType.BUSY //忙碌
@@ -157,7 +146,6 @@
                            }
                            continue;
                        }
                        barcodeThread.setBarcode("");
                        staProtocol.setWorkNo(wrkMast.getWrkNo());
                        staProtocol.setStaNo(RouteUtils.SouStaEnd(null,wrkMast.getSourceStaNo()));
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -198,7 +186,6 @@
                        JSONObject jsonObject = JSON.parseObject(response);
                        if (jsonObject.getInteger("code").equals(200)) {
                            StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                            barcodeThread.setBarcode("");
                            staProtocol.setWorkNo(dto.getWorkNo());
                            staProtocol.setStaNo(RouteUtils.SouStaEnd(dto.getStaNo(),dto.getSourceStaNo()));
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -214,12 +201,6 @@
                                throw new CoolException("更新plc站点信息失败");
                            }
                        }else {
                            staProtocol.setWorkNo(wrkNo);
                            wrkNo++;
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
//
//                            if (ledThread != null) {
                                String errorMsg = jsonObject.getString("msg");
                                if (!Cools.isEmpty(errorMsg)) {
@@ -427,7 +408,7 @@
                    // 更新站点信息 且 下发plc命令
                    staProtocol.setWorkNo(wrkMast.getWrkNo());
                    staProtocol.setStaNo((short) 161);
                    staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    log.error("输送线下发5:"+wrkMast.getWrkNo()+","+wrkMast.getStaNo());
@@ -2115,7 +2096,7 @@
                } else {
                    staProtocol = staProtocol.clone();
                }
                if (!(staProtocol.stateType == DevpStateType.AUTO && staProtocol.requestType == DevpRequestType.OUT)){
                if (!(staProtocol.stateType == DevpStateType.AUTO)){
                    continue;
                }
                if (staProtocol.getWorkNo() == 0){