自动化立体仓库 - WCS系统
lsh
2024-07-24 3a93886bb6f34ce1aa9b292dafc5f723a235981e
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -112,6 +112,7 @@
            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());
@@ -124,7 +125,14 @@
                if (barcodeThread == null) {
                    continue;
                }
                if (barcodeThreadMat == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                String barcodeMat = barcodeThreadMat.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
@@ -184,6 +192,18 @@
                        && staProtocol.isPakMk()) {
                    if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
                        News.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        staProtocol.setWorkNo(wrkNo);
                        News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo);
                        wrkNo++;
                        staProtocol.setStaNo(inSta.getBackSta().shortValue());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        log.error("输送线下发1:"+wrkNo+","+inSta.getBackSta());
                        continue;
                    }
                    if(Cools.isEmpty(barcodeMat) || "NG".endsWith(barcodeMat) || "NoRead".equals(barcodeMat) || "00000000".equals(barcodeMat)) {
                        News.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcodeMat(), barcodeMat);
                        staProtocol.setWorkNo(wrkNo);
                        News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo);
@@ -263,6 +283,25 @@
                                throw new CoolException("更新plc站点信息失败");
                            }
                        } else if (jsonObject.getInteger("code").equals(700)) {
                            SearchLocParam param2 = new SearchLocParam();
                            param2.setBarcode(barcode);
                            param2.setBarcodeMat(barcodeMat);
                            param2.setSourceStaNo(inSta.getStaNo());
                            param2.setLocType1(locTypeDto.getLocType1());
                            String response2 = new HttpHandler.Builder()
                                    .setUri(wmsUrl)
                                    .setPath("/rpc/pakin/yk/loc/v33")
                                    .setJson(JSON.toJSONString(param2))
                                    .build()
                                    .doPost();
                            JSONObject jsonObject2 = JSON.parseObject(response2);
                            if (jsonObject2.getInteger("code").equals(200)) {
                                log.info("自动组托成功!!");
                            } else {
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "自动组托失败!!!barcodeMat==>"+barcodeMat));
                                News.error(methodName + "==>组托失败:请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/yk/loc/v33", JSON.toJSONString(param), response);
                            }
                        } else {
                            staProtocol.setWorkNo(wrkNo);
                            wrkNo++;