|
|
@ -106,9 +106,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
boolean link_flag = false; |
|
|
|
if (ikey != 0) { |
|
|
|
inst = instructionService.findByCodeFromCache(String.valueOf(ikey)); |
|
|
|
// if (ObjectUtil.isEmpty(inst)) {
|
|
|
|
// inst = instructionService.findByCode(String.valueOf(ikey));
|
|
|
|
// }
|
|
|
|
// if (ObjectUtil.isEmpty(inst)) {
|
|
|
|
// inst = instructionService.findByCode(String.valueOf(ikey));
|
|
|
|
// }
|
|
|
|
} |
|
|
|
if (!ObjectUtil.isEmpty(link_inst)) { |
|
|
|
link_flag = true; |
|
|
@ -169,10 +169,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
StandardOrdinarySiteDeviceDriver driver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if ("true".equals(device.getExtraValue().get("wait")) |
|
|
|
&& !inst.getTask_code().startsWith("-") |
|
|
|
&& "1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())) { |
|
|
@ -181,13 +179,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
form.put("status", 1); |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,开始反馈wcs..."); |
|
|
|
JSONObject result = acsToWmsService.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (20000 == result.getIntValue("code")) { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,反馈wcs成功,运行取货"); |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,反馈wcs返回异常,不允许取货,返回信息:"+result); |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV取货。"; |
|
|
@ -206,13 +206,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
form.put("status", 1); |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,开始反馈wcs..."); |
|
|
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (20000 == result.getIntValue("code")) { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,反馈wcs成功,运行取货"); |
|
|
|
wmsFlag = true; |
|
|
|
} else { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,反馈wcs返回异常,不允许取货,返回信息:"+result); |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV取货。"; |
|
|
@ -245,12 +248,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
add(form);} |
|
|
|
}); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,开始反馈wcs..."); |
|
|
|
if (20000 == result.getIntValue("code")) { |
|
|
|
flag = true; |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,反馈wcs成功,运行取货"); |
|
|
|
} else { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达取货点,反馈wcs返回异常,不允许取货,返回信息:"+result); |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV取货。"; |
|
|
@ -384,48 +389,50 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
form.put("status", 2); |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv取货完成,开始反馈wcs..."); |
|
|
|
JSONObject result = acsToWmsService.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (20000 == result.getIntValue("code")) { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv取货完成,反馈wcs成功"); |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv取货完成,反馈wcs返回异常,不允许离开,返回信息:"+result); |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV取货后离开。"; |
|
|
|
log.info("agv到达取货点,不允许AGV取货后离开。"); |
|
|
|
driver.setMessage(message); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
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); |
|
|
|
this.message = ""; |
|
|
@ -436,47 +443,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); |
|
|
|
this.message = ""; |
|
|
@ -490,29 +495,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) { |
|
|
@ -548,6 +553,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
if (agvaddr < 1) { |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
log.info(this.device_code+"agv地址参数有误,phase:" + phase); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr != 0) { |
|
|
@ -584,48 +590,48 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
form.put("status", 3); |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达放货点,开始反馈wcs..."); |
|
|
|
JSONObject result = acsToWmsService.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (20000 == result.getIntValue("code")) { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达放货点,反馈wcs成功,运行放货"); |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV放货。"; |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv到达放货点,反馈wcs返回异常,不允许放货,返回信息:"+result); |
|
|
|
driver.setMessage(message); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
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); |
|
|
|
this.message = ""; |
|
|
@ -636,40 +642,40 @@ 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", 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 (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 {
|
|
|
|
flag = true; |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} else { |
|
|
|
String message = ""; |
|
|
|
if (driver.getMode() == 0) { |
|
|
|
message += "站点未联机,"; |
|
|
|
log.info(device_code+":站点未联机,不允许AGV放货。"); |
|
|
|
} else { |
|
|
|
if (driver.getMove() != 0) { |
|
|
|
message += "站点有货,"; |
|
|
|
log.info(device_code+":站点有货,不允许AGV放货。"); |
|
|
|
} |
|
|
|
} |
|
|
|
message += "不允许AGV放货。"; |
|
|
@ -688,29 +694,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) { |
|
|
@ -776,48 +782,49 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
form.put("status", 4); |
|
|
|
form.put("device_code", device_code); |
|
|
|
form.put("task_code", inst.getTask_code()); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv放货完成,开始反馈wcs..."); |
|
|
|
JSONObject result = acsToWmsService.feedWcsAgvTaskStatus(new JSONArray() {{ |
|
|
|
add(form); |
|
|
|
}}); |
|
|
|
|
|
|
|
if (20000 == result.getIntValue("code")) { |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv放货完成,反馈wcs成功,运行离开"); |
|
|
|
wcsFlag = true; |
|
|
|
} else { |
|
|
|
String resultMessage = result.getString("message"); |
|
|
|
this.message = resultMessage; |
|
|
|
String message = resultMessage + "不允许AGV放货后离开。"; |
|
|
|
driver.setMessage(message); |
|
|
|
log.info(device_code+":feedWcsAgvTaskStatus - agv放货完成,反馈wcs返回异常,不允许离开,返回信息:"+result); |
|
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
|
} |
|
|
|
} else { |
|
|
|
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); |
|
|
|
this.message = ""; |
|
|
@ -828,33 +835,32 @@ 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", 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")) {
|
|
|
|
// 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", 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")) {
|
|
|
|
// 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) { |
|
|
@ -882,29 +888,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", 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")) {
|
|
|
|
// 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", 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")) {
|
|
|
|
// 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) { |
|
|
@ -931,7 +937,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
wcsFlag = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (flag) { |
|
|
|
this.device_status = "IDLE"; |
|
|
|
this.inst = null; |
|
|
|