|
|
@ -193,6 +193,32 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(inst)){ |
|
|
|
JSONArray req = new JSONArray(); |
|
|
|
JSONObject map = new JSONObject(); |
|
|
|
map.put("device_code", inst.getStart_point_code()); |
|
|
|
map.put("device_status",inst.getExecute_status()); |
|
|
|
map.put("energyLevel",electric_qty); |
|
|
|
map.put("transportOrder",inst.getTask_code()); |
|
|
|
map.put("positionX",x); |
|
|
|
map.put("positionY",y); |
|
|
|
map.put("positionAngle",angle); |
|
|
|
HttpResponse httpResponse = acsToWmsService.feedbackAgv(req); |
|
|
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { |
|
|
|
JSONObject resp = JSONObject.parseObject(httpResponse.body()); |
|
|
|
if (resp.getInteger("status") == 200) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
log.info("指令号:{},acs向wms反馈AGV设备信息,已反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息,未反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息失败,连接被拒绝,未反馈agv设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
|
|
|
|
//取货完毕
|
|
|
|
//(需要WCS反馈)
|
|
|
|
} else if (phase == 0x05) { |
|
|
@ -254,6 +280,32 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(inst)){ |
|
|
|
JSONArray req = new JSONArray(); |
|
|
|
JSONObject map = new JSONObject(); |
|
|
|
map.put("device_code", inst.getStart_point_code()); |
|
|
|
map.put("device_status",inst.getExecute_status()); |
|
|
|
map.put("energyLevel",electric_qty); |
|
|
|
map.put("transportOrder",inst.getTask_code()); |
|
|
|
map.put("positionX",x); |
|
|
|
map.put("positionY",y); |
|
|
|
map.put("positionAngle",angle); |
|
|
|
HttpResponse httpResponse = acsToWmsService.feedbackAgv(req); |
|
|
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { |
|
|
|
JSONObject resp = JSONObject.parseObject(httpResponse.body()); |
|
|
|
if (resp.getInteger("status") == 200) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
log.info("指令号:{},acs向wms反馈AGV设备信息,已反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息,未反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息失败,连接被拒绝,未反馈agv设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
//到达放货点
|
|
|
|
//(需要WCS反馈)
|
|
|
|
} else if (phase == 0x07) { |
|
|
@ -311,6 +363,32 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(inst)){ |
|
|
|
JSONArray req = new JSONArray(); |
|
|
|
JSONObject map = new JSONObject(); |
|
|
|
map.put("device_code", inst.getStart_point_code()); |
|
|
|
map.put("device_status",inst.getExecute_status()); |
|
|
|
map.put("energyLevel",electric_qty); |
|
|
|
map.put("transportOrder",inst.getTask_code()); |
|
|
|
map.put("positionX",x); |
|
|
|
map.put("positionY",y); |
|
|
|
map.put("positionAngle",angle); |
|
|
|
HttpResponse httpResponse = acsToWmsService.feedbackAgv(req); |
|
|
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { |
|
|
|
JSONObject resp = JSONObject.parseObject(httpResponse.body()); |
|
|
|
if (resp.getInteger("status") == 200) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
log.info("指令号:{},acs向wms反馈AGV设备信息,已反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息,未反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息失败,连接被拒绝,未反馈agv设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
//放货完毕
|
|
|
|
//(需要WCS反馈)
|
|
|
|
} else if (phase == 0x09) { |
|
|
@ -364,6 +442,31 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(inst)){ |
|
|
|
JSONArray req = new JSONArray(); |
|
|
|
JSONObject map = new JSONObject(); |
|
|
|
map.put("device_code", inst.getStart_point_code()); |
|
|
|
map.put("device_status",inst.getExecute_status()); |
|
|
|
map.put("energyLevel",electric_qty); |
|
|
|
map.put("transportOrder",inst.getTask_code()); |
|
|
|
map.put("positionX",x); |
|
|
|
map.put("positionY",y); |
|
|
|
map.put("positionAngle",angle); |
|
|
|
HttpResponse httpResponse = acsToWmsService.feedbackAgv(req); |
|
|
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { |
|
|
|
JSONObject resp = JSONObject.parseObject(httpResponse.body()); |
|
|
|
if (resp.getInteger("status") == 200) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
log.info("指令号:{},acs向wms反馈AGV设备信息,已反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息,未反馈AGV设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.warn("指令号:{},acs向wms反馈AGV设备信息失败,连接被拒绝,未反馈agv设备信息", inst.getInstruction_code()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
//到达位置点
|
|
|
|
//(需要WCS反馈)
|
|
|
@ -379,7 +482,22 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} else if (phase == 0x51) {//离开交通灯区域
|
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); |
|
|
|
} |
|
|
|
} else if (phase == 0x70) { |
|
|
|
//x坐标
|
|
|
|
x = ikey; |
|
|
|
} else if (phase == 0x71) { |
|
|
|
//y坐标
|
|
|
|
y = ikey; |
|
|
|
} else if (phase == 0x72) { |
|
|
|
//车辆角度
|
|
|
|
angle = ikey; |
|
|
|
} else if (phase == 0x73) { |
|
|
|
//agv电量
|
|
|
|
electric_qty = ikey; |
|
|
|
} else if (phase == 0x74) { |
|
|
|
//三色灯状态
|
|
|
|
status = ikey; |
|
|
|
} |
|
|
|
if (!ObjectUtil.isEmpty(data)) { |
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); |
|
|
|
OneNDCSocketConnectionAutoRun.write(data); |
|
|
|