From 511ad95ddd42b1104496f3c357677062cde4bba2 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Fri, 17 May 2024 09:52:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=80=E8=B4=A7=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ConveyorWithScannerWeightDeviceDriver.java | 55 +++++++++++++++++++ .../org/nl/acs/enums/StorageTypeEnum.java | 4 +- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index d3987abac..cac9dadcd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -301,6 +301,12 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } + //申请退货入库 + if (mode == 18 && move == 1 && !requireSucess){ + applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); + + } + //申请入库指令、异常位指令 if (mode == 2 && move == 1 && !requireSucess) { boolean res = instruction_require(); @@ -349,6 +355,55 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv last_barcode = barcode; } + private void applyBoxReturnTask(String type, int mode) { + Date date = new Date(); + if (date.getTime() - this.require_apply_strangulation_time.getTime() + < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return; + } else { + try { + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("vehicle_code", barcode); + param.put("material_barcode", material_barcode); + param.put("type", type); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请退货入库,参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String response = acsToWmsService.applyTwo(param); + JSONObject jo = JSON.parseObject(response); + if (jo.getInteger("status") == 200) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请退货入库,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + List list1 = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_command"); + map.put("value", mode); + list1.add(map); + this.writing(list1); + this.requireSucess = true; + }else { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请退货入库,返回参数:" + jo.getString("body")) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + private void applyErrorTask() { Date date = new Date(); if (date.getTime() - this.require_apply_strangulation_time.getTime() diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java index dcb1cf2dc..0dd843f64 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java @@ -16,7 +16,9 @@ public enum StorageTypeEnum { ERROR("4", "异常处理位"), - BOX_IN("5", "木箱入库"); + BOX_IN("5", "木箱入库"), + + BOX_RETURN("6", "退货入库"); /** * 索引 */