From 587c3fb0663a3e1d52bfe6db3ff1200ca1012143 Mon Sep 17 00:00:00 2001 From: psh Date: Wed, 3 Jan 2024 09:05:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=8E=B0=E5=9C=BA=E6=B2=9F?= =?UTF-8?q?=E9=80=9A=E5=8E=BB=E6=8E=89579=E7=9A=84wms=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 348 +++++++++--------- 1 file changed, 174 insertions(+), 174 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 7af05fb..817b1d4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -394,30 +394,30 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic wcsFlag = true; } - if ("true".equals(device.getExtraValue().get("reqWms")) - && !inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 2); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - - if (20000 == result.getIntValue("code")) { - wmsFlag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV取货后离开。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if ("true".equals(device.getExtraValue().get("reqWms")) +// && !inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 2); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// +// if (20000 == result.getIntValue("code")) { +// wmsFlag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV取货后离开。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { wmsFlag = true; - } +// } if (wcsFlag && wmsFlag) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); @@ -428,45 +428,45 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { StandardInspectSiteDeviceDriver driver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - if (driver.getMode() != 0 - && driver.getMove() == 0) { - if (!inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) - && "true".equals(device.getExtraValue().get("reqWms"))) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 2); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - - if (20000 == result.getIntValue("code")) { - flag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV取货后离开。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if (driver.getMode() != 0 +// && driver.getMove() == 0) { +// if (!inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) +// && "true".equals(device.getExtraValue().get("reqWms"))) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 2); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// +// if (20000 == result.getIntValue("code")) { +// flag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV取货后离开。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { flag = true; - } - } else { - String message = ""; - if (driver.getMode() == 0) { - message += "站点未联机,"; - } else { - if (driver.getMove() != 0) { - message += "站点有货,"; - } - } - message += "不允许AGV取货后离开。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } +// } +// } else { +// String message = ""; +// if (driver.getMode() == 0) { +// message += "站点未联机,"; +// } else { +// if (driver.getMove() != 0) { +// message += "站点有货,"; +// } +// } +// message += "不允许AGV取货后离开。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } if (flag) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); @@ -479,29 +479,29 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (driver.getMode() != 0 && driver.getMove() == 0 && driver.getNumber() == 0) { - if (!inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) - && "true".equals(device.getExtraValue().get("reqWms"))) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 2); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - if (20000 == result.getIntValue("code")) { - flag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV取货后离开。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if (!inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) +// && "true".equals(device.getExtraValue().get("reqWms"))) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 2); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// if (20000 == result.getIntValue("code")) { +// flag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV取货后离开。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { flag = true; - } +// } } else { String message = ""; if (driver.getMode() == 0) { @@ -588,30 +588,30 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic wcsFlag = true; } - if ("true".equals(device.getExtraValue().get("reqWms")) - && !inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 3); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - - if (20000 == result.getIntValue("code")) { - wmsFlag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV放货。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if ("true".equals(device.getExtraValue().get("reqWms")) +// && !inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 3); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// +// if (20000 == result.getIntValue("code")) { +// wmsFlag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV放货。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { wmsFlag = true; - } +// } if (wcsFlag && wmsFlag) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); @@ -624,30 +624,30 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (driver.getMode() != 0 && driver.getMove() == 0) { - if (!inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) - && "true".equals(device.getExtraValue().get("reqWms"))) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 3); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - - if (20000 == result.getIntValue("code")) { - flag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV放货。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if (!inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) +// && "true".equals(device.getExtraValue().get("reqWms"))) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 3); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// +// if (20000 == result.getIntValue("code")) { +// flag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV放货。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { flag = true; - } +// } } else { String message = ""; if (driver.getMode() == 0) { @@ -671,29 +671,29 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } else if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) { FoldDiscSiteDeviceDriver driver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver(); if (driver.getMode() != 0) { - if (!inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) - && "true".equals(device.getExtraValue().get("reqWms"))) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 3); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - if (20000 == result.getIntValue("code")) { - flag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV放货。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if (!inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue()) +// && "true".equals(device.getExtraValue().get("reqWms"))) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 3); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// if (20000 == result.getIntValue("code")) { +// flag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV放货。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { flag = true; - } +// } } else { String message = ""; if (driver.getMode() == 0) { @@ -774,30 +774,30 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic wcsFlag = true; } - if ("true".equals(device.getExtraValue().get("reqWms")) - && !inst.getTask_code().startsWith("-") - && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { - JSONObject form = new JSONObject(); - form.put("vehicle_code", inst.getVehicle_code()); - form.put("status", 4); - form.put("device_code", device_code); - form.put("task_code", inst.getTask_code()); - JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ - add(form); - }}); - - if (20000 == result.getIntValue("code")) { - wmsFlag = true; - } else { - String resultMessage = result.getString("message"); - this.message = resultMessage; - String message = resultMessage + "不允许AGV放货后离开。"; - driver.setMessage(message); - logServer.deviceExecuteLog(device_code, "", "", message); - } - } else { +// if ("true".equals(device.getExtraValue().get("reqWms")) +// && !inst.getTask_code().startsWith("-") +// && "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { +// JSONObject form = new JSONObject(); +// form.put("vehicle_code", inst.getVehicle_code()); +// form.put("status", 4); +// form.put("device_code", device_code); +// form.put("task_code", inst.getTask_code()); +// JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ +// add(form); +// }}); +// +// if (20000 == result.getIntValue("code")) { +// wmsFlag = true; +// } else { +// String resultMessage = result.getString("message"); +// this.message = resultMessage; +// String message = resultMessage + "不允许AGV放货后离开。"; +// driver.setMessage(message); +// logServer.deviceExecuteLog(device_code, "", "", message); +// } +// } else { wmsFlag = true; - } +// } if (wcsFlag && wmsFlag) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);