联调
This commit is contained in:
@@ -159,28 +159,31 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
inst.setAgv_jobno(String.valueOf(index));
|
||||
inst.setSend_status("1");
|
||||
instructionService.update(inst);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||
// if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")
|
||||
// ||StrUtil.startWith(inst.getTask_code(), "-")) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
JSONArray req = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("uuid", IdUtil.simpleUUID());
|
||||
map.put("taskNo", inst.getTask_id());
|
||||
map.put("businessType", "PENDING");
|
||||
req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
if (resp.getInteger("code") == 200) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 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 {
|
||||
// JSONArray req = new JSONArray();
|
||||
// JSONObject map = new JSONObject();
|
||||
// map.put("uuid", IdUtil.simpleUUID());
|
||||
// map.put("taskNo", inst.getTask_code());
|
||||
// map.put("businessType", "PENDING");
|
||||
// map.put("containerNo",inst.getVehicle_code());
|
||||
// map.put("deviceNo",inst.getCarno());
|
||||
// req.add(map);
|
||||
// HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||
// if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
// JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
// if (resp.getInteger("code") == 200) {
|
||||
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 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());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
//任务完毕
|
||||
|
||||
@@ -132,7 +132,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
inst.setCarno(String.valueOf(carno));
|
||||
instructionService.update(inst);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data);
|
||||
|
||||
// JSONArray req = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("uuid", IdUtil.simpleUUID());
|
||||
map.put("taskNo", inst.getTask_code());
|
||||
map.put("businessType", "PENDING");
|
||||
map.put("containerNo",inst.getVehicle_code());
|
||||
map.put("deviceNo",inst.getCarno());
|
||||
// req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(map);
|
||||
//到达取货点
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x03) {
|
||||
@@ -208,16 +216,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")
|
||||
||StrUtil.startWith(inst.getTask_code(), "-")) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
JSONArray req = new JSONArray();
|
||||
// JSONArray req = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("uuid", IdUtil.simpleUUID());
|
||||
map.put("taskNo", inst.getTask_id());
|
||||
map.put("taskNo", inst.getTask_code());
|
||||
map.put("businessType", "LEAVE_FROM_POINT");
|
||||
req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||
map.put("containerNo",inst.getVehicle_code());
|
||||
map.put("deviceNo",inst.getCarno());
|
||||
// req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(map);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
if (resp.getInteger("code") == 200) {
|
||||
@@ -301,16 +312,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info("未找到编号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")
|
||||
||StrUtil.startWith(inst.getTask_code(), "-")) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
} else {
|
||||
JSONArray req = new JSONArray();
|
||||
// JSONArray req = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("uuid", IdUtil.simpleUUID());
|
||||
map.put("taskNo", inst.getTask_id());
|
||||
map.put("taskNo", inst.getTask_code());
|
||||
map.put("businessType", "ARRIVE_TO_POINT");
|
||||
req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||
map.put("containerNo",inst.getVehicle_code());
|
||||
map.put("deviceNo",inst.getCarno());
|
||||
// req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(map);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
if (resp.getInteger("code") == 200) {
|
||||
|
||||
@@ -107,7 +107,7 @@ public class AcsToWmsController {
|
||||
@PostMapping("/feedAgvTaskStatus")
|
||||
@Log(value = "反馈AGV取放货状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("反馈AGV取放货状态")
|
||||
public ResponseEntity<Object> feedAgvTaskStatus(@RequestBody JSONArray from) {
|
||||
public ResponseEntity<Object> feedAgvTaskStatus(@RequestBody JSONObject from) {
|
||||
return new ResponseEntity<>(acstowmsService.feedAgvTaskStatus(from), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public interface AcsToWmsService {
|
||||
* @param from
|
||||
* @return
|
||||
*/
|
||||
HttpResponse feedAgvTaskStatus(JSONArray from);
|
||||
HttpResponse feedAgvTaskStatus(JSONObject from);
|
||||
|
||||
JSONObject test(JSONObject form);
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse feedAgvTaskStatus(JSONArray from) {
|
||||
public HttpResponse feedAgvTaskStatus(JSONObject from) {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
log.info("开始反馈WMS AGV取放货状态,请求参数:{}", from);
|
||||
this.getTokenFromWms();
|
||||
|
||||
@@ -467,7 +467,7 @@ public class JDToAcsServiceImpl implements JDToAcsService {
|
||||
String start_device_code = reqs.getCarryTask().getFromPoint();
|
||||
String next_device_code = reqs.getCarryTask().getToPoint();
|
||||
String priority = reqs.getPriority();
|
||||
String vehicle_code = reqs.getDeviceNo();
|
||||
String vehicle_code = reqs.getCarryTask().getContainerNo();
|
||||
// String vehicle_type = req.getVehicle_type();
|
||||
String task_type = "1";
|
||||
// String remark = req.getRemark();
|
||||
|
||||
Reference in New Issue
Block a user