From 9c4da646aaefcd8476eb7a23a889b6af6cffab4e Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期三, 09 十月 2024 10:45:06 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java | 38 +++++++++++++++++++++++++++----------- 1 files changed, 27 insertions(+), 11 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java index b84fccf..e0f0670 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java @@ -99,6 +99,11 @@ BasConveyor basConveyor = basConveyorService.getOne(new LambdaQueryWrapper<BasConveyor>().eq(BasConveyor::getDeviceId, devp.getId()).eq(BasConveyor::getHostId, devp.getHostId())); // 閬嶅巻鍏ュ簱鍙� for (StaDto inSta : JSON.parseArray(basConveyor.getInSta(), StaDto.class)) { + BasConveyorSta basConveyorSta = basConveyorStaService.selectBySiteNo(inSta.getStaNo().toString()); + if(basConveyorSta == null) { + continue; + } + // 鑾峰彇鍏ュ簱绔欎俊鎭� DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, devp.getId().intValue()); StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); @@ -156,13 +161,18 @@ ) { // 鑾峰彇鏉$爜鎵弿浠俊鎭� - BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); + DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId()); + if(deviceBarcode == null) { + continue; + } + BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId())); if (barcodeThread == null) { continue; } String barcode = barcodeThread.getBarcode(); if (!Cools.isEmpty(barcode)) { - News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode); + News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", deviceBarcode.getId(), barcode); + if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode) || "00000000".equals(barcode)) { staProtocol.setWorkNo((short) 32002); staProtocol.setStaNo(inSta.getBackSta().shortValue()); @@ -208,10 +218,10 @@ param.setBarcode(barcode); param.setIoType(1); param.setSourceStaNo(inSta.getStaNo()); - param.setLocType1(staProtocol.getLocType1().shortValue()); + param.setLocType1((short)1); String response = new HttpHandler.Builder() .setUri(wmsUrl) - .setPath("/rpc/pakin/loc/v2") + .setPath("/rpc/pakin/loc/v1") .setJson(JSON.toJSONString(param)) .build() .doPost(); @@ -439,15 +449,21 @@ if (basConveyor == null) { continue; } - DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId()); - if (deviceBarcode == null) { +// DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId()); +// if (deviceBarcode == null) { +// continue; +// } +// BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId())); +// if (barcodeThread == null) { +// continue; +// } +// if (!barcodeThread.getBarcode().equals(task.getZpallet())) { +// continue; +// } + if (Cools.isEmpty(basConveyorSta.getTaskNo())){ continue; } - BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId())); - if (barcodeThread == null) { - continue; - } - if (!barcodeThread.getBarcode().equals(task.getZpallet())) { + if (!basConveyorSta.getTaskNo().toString().equals(task.getWmsTaskNo())){ continue; } DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, basConveyor.getDeviceId().intValue()); -- Gitblit v1.9.1