Browse Source

1.05取完成09放完成默认需要反馈,reqWms参数无用

2.httpResponse.body空指针修复,无此参数
master
pangshenghao 1 year ago
parent
commit
8b7fc2fa68
  1. 27
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

27
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -234,8 +234,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return; return;
} }
Object reqWms = device.getExtraValue().get("reqWms"); // Object reqWms = device.getExtraValue().get("reqWms");
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) { // if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
JSONArray req = new JSONArray(); JSONArray req = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("vehicle_code", inst.getVehicle_code()); map.put("vehicle_code", inst.getVehicle_code());
@ -245,19 +245,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
req.add(map); req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("status") == 200) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code()); log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code());
} else { } else {
log.warn("指令号:{},acs反馈wms取货完成成功,wms不允许agv取货完成,未反馈agv取货完成", inst.getInstruction_code()); log.warn("指令号:{},acs反馈wms取货完成成功,wms不允许agv取货完成,未反馈agv取货完成", inst.getInstruction_code());
} }
} else { // } else {
log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code()); // data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} // }
} else {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
}
//到达放货点 //到达放货点
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x07) { } else if (phase == 0x07) {
@ -303,7 +298,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
// HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); // HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
// if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { // if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
// JSONObject resp = JSONObject.parseObject(httpResponse.body()); // JSONObject resp = JSONObject.parseObject(httpResponse.body());
// if (resp.getInteger("status") == 200) { // if (resp.getInteger("status") == 200) {
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); // data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
// log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code()); // log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
// } else { // } else {
@ -349,8 +344,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到编号{}对应的指令", ikey); log.info("未找到编号{}对应的指令", ikey);
return; return;
} }
Object reqWms = device.getExtraValue().get("reqWms"); // Object reqWms = device.getExtraValue().get("reqWms");
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) { // if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
JSONArray req = new JSONArray(); JSONArray req = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("vehicle_code", inst.getVehicle_code()); map.put("vehicle_code", inst.getVehicle_code());
@ -365,9 +360,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} else { } else {
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code()); log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
} }
} else { // } else {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); // data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} // }
} }
//到达位置点 //到达位置点
//(需要WCS反馈) //(需要WCS反馈)

Loading…
Cancel
Save