From a50c10c03283ef2c32d98f7d36035d91ee7be6e7 Mon Sep 17 00:00:00 2001 From: yanps Date: Mon, 27 May 2024 19:43:14 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20AGV=E5=81=8F=E7=A7=BB=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 84 ++++++++++++------- .../wms/service/impl/AcsToWmsServiceImpl.java | 6 +- 2 files changed, 56 insertions(+), 34 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 426488d94..60132e092 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -311,15 +311,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); String length1 = rangingStationsDeviceDriver.getLength1(); - Float len = 0.0F; - if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) { - len = Float.parseFloat(length1); + String length2 = rangingStationsDeviceDriver.getLength2(); + Float len1 = 0.0F; + Float len2 = 0.0F; + if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) { + len1 = Float.parseFloat(length1); + len2 = Float.parseFloat(length2); } - int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0; - if (roundedNumber == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + if(len1 * len2 < 1 ){ + int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; + if (roundedNumber == 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + } } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -588,15 +593,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); String length1 = rangingStationsDeviceDriver.getLength1(); - Float len = 0.0F; - if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) { - len = Float.parseFloat(length1); + String length2 = rangingStationsDeviceDriver.getLength2(); + Float len1 = 0.0F; + Float len2 = 0.0F; + if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) { + len1 = Float.parseFloat(length1); + len2 = Float.parseFloat(length2); } - int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0; - if (roundedNumber == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + if(len1 * len2 < 1 ){ + int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; + if (roundedNumber == 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + } } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -862,15 +872,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); String length1 = rangingStationsDeviceDriver.getLength1(); - Float len = 0.0F; - if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) { - len = Float.parseFloat(length1); + String length2 = rangingStationsDeviceDriver.getLength2(); + Float len1 = 0.0F; + Float len2 = 0.0F; + if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) { + len1 = Float.parseFloat(length1); + len2 = Float.parseFloat(length2); } - int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0; - if (roundedNumber == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + if(len1 * len2 < 1 ){ + int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; + if (roundedNumber == 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + } } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -1090,15 +1105,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); String length1 = rangingStationsDeviceDriver.getLength1(); - Float len = 0.0F; - if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) { - len = Float.parseFloat(length1); + String length2 = rangingStationsDeviceDriver.getLength2(); + Float len1 = 0.0F; + Float len2 = 0.0F; + if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) { + len1 = Float.parseFloat(length1); + len2 = Float.parseFloat(length2); } - int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0; - if (roundedNumber == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + if(len1 * len2 < 1 ){ + int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; + if (roundedNumber == 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber); + } } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 274ca52a7..ca3012424 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -470,7 +470,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { log.info("ApplyPlugPullSitResponse----返回参数{}", result); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); LuceneLogDto luceneLogDto = new LuceneLogDto(4,"ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getCode()), - JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请套管"); + JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请" + + ("1".equals(param.getType()) ? "套轴": "2".equals(param.getType()) ? "套轴完成": "3".equals(param.getType()) ? "拔轴完成": + "4".equals(param.getType()) ? "拔轴": "缓存线已满,生成行架任务")); luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { JSONObject map = new JSONObject(); @@ -513,7 +515,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class); } LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS向LMS申请套管"); + JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量"); luceneLogService.interfaceExecuteLog(luceneLogDto); } return applyfeedbackSubVolumeWeightResponse;