|
@ -297,30 +297,41 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
log.info("未找到关联编号{}对应的指令", ikey); |
|
|
log.info("未找到关联编号{}对应的指令", ikey); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
TaskDto task =taskService.findById(inst.getTask_id()); |
|
|
|
|
|
int start_height= ObjectUtil.isNotEmpty(task.getStart_height())?Integer.parseInt(task.getStart_height()):0; |
|
|
|
|
|
int next_height= ObjectUtil.isNotEmpty(task.getNext_height())?Integer.parseInt(task.getNext_height()):0; |
|
|
// 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();
|
|
|
if(!StrUtil.startWith(task.getTask_code(), '-')){ |
|
|
// JSONObject map = new JSONObject();
|
|
|
// Object reqWms = device.getExtraValue().get("reqWms");
|
|
|
// map.put("vehicle_code", inst.getVehicle_code());
|
|
|
// if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
|
|
// map.put("status", "3");
|
|
|
JSONArray req = new JSONArray(); |
|
|
// map.put("device_code", inst.getNext_point_code());
|
|
|
JSONObject map = new JSONObject(); |
|
|
// map.put("task_code", inst.getTask_code());
|
|
|
map.put("vehicle_code", inst.getVehicle_code()); |
|
|
// req.add(map);
|
|
|
map.put("status", "3"); |
|
|
// HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
|
|
map.put("device_code", inst.getNext_point_code()); |
|
|
// if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
|
|
map.put("task_code", inst.getTask_code()); |
|
|
// JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
|
|
req.add(map); |
|
|
// if (resp.getInteger("status") == 200) {
|
|
|
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); |
|
|
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0);
|
|
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { |
|
|
// log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
|
|
|
JSONObject resp = JSONObject.parseObject(httpResponse.body()).getJSONObject("data"); |
|
|
// } else {
|
|
|
if (resp.getInteger("status") == 200) { |
|
|
// log.warn("指令号:{},acs请求wms放货申请成功,wms不允许agv申请放货,未反馈agv允许放货", inst.getInstruction_code());
|
|
|
start_height=resp.getInteger("start_height"); |
|
|
// }
|
|
|
next_height=resp.getInteger("next_height"); |
|
|
// } else {
|
|
|
task.setStart_height(String.valueOf(start_height)); |
|
|
// log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
|
|
|
task.setNext_height(String.valueOf(next_height)); |
|
|
// }
|
|
|
taskService.update(task); |
|
|
// } else {
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,start_height,next_height); |
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0); |
|
|
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code()); |
|
|
// }
|
|
|
} else { |
|
|
|
|
|
log.warn("指令号:{},acs请求wms放货申请成功,wms不允许agv申请放货,未反馈agv允许放货", inst.getInstruction_code()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,start_height,next_height); |
|
|
|
|
|
} |
|
|
//放货完毕
|
|
|
//放货完毕
|
|
|
//(需要WCS反馈)
|
|
|
//(需要WCS反馈)
|
|
|
} else if (phase == 0x09) { |
|
|
} else if (phase == 0x09) { |
|
@ -422,6 +433,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} else if (phase == 0x74) { |
|
|
} else if (phase == 0x74) { |
|
|
//三色灯状态
|
|
|
//三色灯状态
|
|
|
status = ikey; |
|
|
status = ikey; |
|
|
|
|
|
if(status==4) { |
|
|
|
|
|
order = ""; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if (!ObjectUtil.isEmpty(data)) { |
|
|
if (!ObjectUtil.isEmpty(data)) { |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); |
|
|