|
|
@ -172,8 +172,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
StandardOrdinarySiteDeviceDriver driver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait"))) { |
|
|
|
// todo 请求wcs是否允许取货
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait")) |
|
|
|
&& !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", 1); |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
JSONObject result = acsToWmsService.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (HttpStatus.HTTP_OK == result.getIntValue("status")) { |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV取货。"; |
|
|
|
driver.setMessage(message); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wcsFlag = true; |
|
|
|
} |
|
|
@ -350,8 +369,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
StandardOrdinarySiteDeviceDriver driver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait"))) { |
|
|
|
// todo 请求wcs是否允许取货
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait")) |
|
|
|
&& !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.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (HttpStatus.HTTP_OK == result.getIntValue("status")) { |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV取货后离开。"; |
|
|
|
driver.setMessage(message); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wcsFlag = true; |
|
|
|
} |
|
|
@ -525,8 +563,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
StandardOrdinarySiteDeviceDriver driver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait"))) { |
|
|
|
// todo 请求wcs是否允许取货
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait")) |
|
|
|
&& !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.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (HttpStatus.HTTP_OK == result.getIntValue("status")) { |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV放货。"; |
|
|
|
driver.setMessage(message); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wcsFlag = true; |
|
|
|
} |
|
|
@ -692,8 +749,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
StandardOrdinarySiteDeviceDriver driver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait"))) { |
|
|
|
// todo 请求wcs是否允许取货
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait")) |
|
|
|
&& !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.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (HttpStatus.HTTP_OK == result.getIntValue("status")) { |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV放货后离开。"; |
|
|
|
driver.setMessage(message); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wcsFlag = true; |
|
|
|
} |
|
|
|