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; + } /** * 反馈压机残留重量 */