From d34baf0ccee9c7c822bd8357643ba8ac2a3f2a27 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Wed, 22 Nov 2023 13:31:45 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E6=B5=B7=E6=9F=94=E8=BE=93=E9=80=81?= =?UTF-8?q?=E7=BA=BF=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HailiangHrSsxDeviceDriver.java | 5 +- .../WithStationDeviceDriver.java | 97 +++++++++++-------- .../hailiang_old/hailiang_with_station.vue | 42 -------- 3 files changed, 62 insertions(+), 82 deletions(-) diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java index 7bec69bb..ab8377a0 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_hr_ssx/HailiangHrSsxDeviceDriver.java @@ -73,7 +73,7 @@ public class HailiangHrSsxDeviceDriver extends AbstractOpcDeviceDriver implement Boolean isonline = true; String message = null; Boolean iserror = false; - private Date instruction_require_time; + private Date instruction_require_time = new Date(); private int instruction_require_time_out = 30000; boolean requireSucess = false; @@ -100,7 +100,7 @@ public class HailiangHrSsxDeviceDriver extends AbstractOpcDeviceDriver implement if (mode != last_mode) { logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记"); } - if (move != last_move && barcode != last_barcode){ + if (move != last_move){ message = null; requireSucess =false; if (move == 1 && barcode.length() > 0){ @@ -110,6 +110,7 @@ public class HailiangHrSsxDeviceDriver extends AbstractOpcDeviceDriver implement } } + // if(move ==0 && barcode.length()>0 && !requireSucess ){ // ContainerArrivedRequest containerArrivedRequest = new ContainerArrivedRequest(); // NodeStates nodeStates = new NodeStates(); diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_with_station/WithStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_with_station/WithStationDeviceDriver.java index 0496b49a..99acb88f 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_with_station/WithStationDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_old/hailiang_with_station/WithStationDeviceDriver.java @@ -184,57 +184,78 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements } } - //取关联设备 list + //取关联设备 list 要求:先配置外侧的站点 //遍历 List haiRouDeviceCodeList = this.getExtraDeviceCodes("link_device_code"); - for(int i=0;i Integer.parseInt(this.getExtraValue().get("apply_time").toString()) * 1000) { + //否则对接位单独申请任务 + JSONObject reqParam = new JSONObject(); + reqParam.put("type", StatusEnum.HAIROU_LIKU_REQ.getCode()); + reqParam.put("device_code_one", hailiangHrSsxDeviceDriver.getDevice_code()); + reqParam.put("vehicle_code_one", hailiangHrSsxDeviceDriver.getBarcode()); + //联调时加上 +// HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam); +// if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { +// requireSucess = true; +// } + log.info("单工位请求成功"); + requireSucess = true; - reqParam.put("device_code_one", hailiangHrSsxDeviceDriver.getDevice_code()); - reqParam.put("vehicle_code_one", hailiangHrSsxDeviceDriver.getBarcode()); - HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam); - if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { + } else { + //否则判断另一个位置 + Device neiRouDevice = deviceAppservice.findDeviceByCode(haiRouDeviceCodeList.get(i+1)); + if (neiRouDevice.getDeviceDriver() instanceof HailiangHrSsxDeviceDriver) { + hailiangHrSsxDeviceDriver2 = (HailiangHrSsxDeviceDriver) neiRouDevice.getDeviceDriver(); + if (hailiangHrSsxDeviceDriver2.getMode() == 2 && + hailiangHrSsxDeviceDriver2.getMove() == 1 && + ObjectUtil.isNotEmpty(hailiangHrSsxDeviceDriver2.getBarcode()) + ) { + JSONObject reqParam = new JSONObject(); + //半成品库任务 + reqParam.put("type", StatusEnum.HAIROU_LIKU_REQ.getCode()); + //具体海柔出入库任务类型 + reqParam.put("item_type", DeviceEnum.getTypeByCode(hailiangHrSsxDeviceDriver.getDevice_code())); + reqParam.put("device_code_one", hailiangHrSsxDeviceDriver.getDevice_code()); + reqParam.put("vehicle_code_one", hailiangHrSsxDeviceDriver.getBarcode()); + reqParam.put("device_code_two", hailiangHrSsxDeviceDriver2.getDevice_code()); + reqParam.put("vehicle_code_two", hailiangHrSsxDeviceDriver2.getBarcode()); + //向lms请求任务 + // 联调时加上 +// HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam); +// if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { +// requireSucess = true; +// } + log.info("双工位请求成功"); requireSucess = true; } } } + + } else { + //todo 输出不满足的原因 + } } - - } } diff --git a/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_old/hailiang_with_station.vue b/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_old/hailiang_with_station.vue index 9f28adc9..b5c2b336 100644 --- a/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_old/hailiang_with_station.vue +++ b/wcs/nladmin-ui/src/views/acs/device/driver/hailiang_old/hailiang_with_station.vue @@ -1,48 +1,6 @@