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);