From 86b407361619bddd45b4ba8ee88046b9c6503c74 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Tue, 29 Aug 2023 19:58:30 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=E5=8E=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=AB=E6=96=99=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/device_driver/RequestMethodEnum.java | 5 +++- .../device_driver/StandardRequestMethod.java | 7 ++++++ .../lnsh_press/LnshPressDeviceDriver.java | 24 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java index 33260ca..dbea2ab 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java @@ -44,7 +44,10 @@ public enum RequestMethodEnum { apply_feedback_weight(17, "apply_feedback_weight", "反馈压机残留重量","0"), - apply_get_put_station(18, "apply_get_put_station", "反馈当前抓取放置位","0"); + apply_get_put_station(18, "apply_get_put_station", "反馈当前抓取放置位","0"), + + press_request_material(19, "pressRequestMaterial", "压机叫料","0"); + //驱动索引 diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java index 4c805f0..9a3b4ac 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java @@ -99,5 +99,12 @@ public interface StandardRequestMethod { throw new RuntimeException("未实现"); }; + /** + * 压机叫料 + * @return + */ + public default boolean press_request_material() { + throw new RuntimeException("未实现"); + }; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java index f1b9f78..33790a6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java @@ -339,6 +339,30 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De return true; } + /** + * 压机叫料 + * @return + */ + public synchronized boolean press_request_material(){ + ApplyTaskRequest request = new ApplyTaskRequest(); + request.setDevice_code(this.getDevice_code()); + request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); + request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); + request.setOrder_code(String.valueOf(order_No)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplyTaskResponse.class); + message = RequestMethodEnum.getName("pressRequestMaterial") + "pressRequestMaterial 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("pressRequestMaterial") + "pressRequestMaterial 接口请求失败" + resp.getMessage(); + this.setRequireSucess(true); + } + return true; + } /** * 反馈压机残留重量 */