rev:科冲接口优化
This commit is contained in:
@@ -23,7 +23,7 @@ public class KeCongAgvController {
|
|||||||
@Log("等待点请求")
|
@Log("等待点请求")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<AgvResponse> waitPointRequest(@RequestBody JSONObject requestParam) {
|
public ResponseEntity<AgvResponse> waitPointRequest(@RequestBody JSONObject requestParam) {
|
||||||
return new ResponseEntity<>(keCongAgvService.xgAGVWaitPointRequest(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(keCongAgvService.agvWaitPointRequest(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,29 +17,29 @@ public interface KeCongAgvService {
|
|||||||
public HttpResponse addTask(Instruction inst) throws Exception;
|
public HttpResponse addTask(Instruction inst) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 查询AGV任务状态
|
// * 查询AGV任务状态
|
||||||
* @param instCode
|
// * @param instCode
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public HttpResponse queryKZAgvInstStatus(String instCode);
|
// public HttpResponse queryKZAgvInstStatus(String instCode);
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 查询AGV状态
|
// * 查询AGV状态
|
||||||
* @param vehicleCode
|
// * @param vehicleCode
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public HttpResponse queryKZAgvStatus(String vehicleCode);
|
// public HttpResponse queryKZAgvStatus(String vehicleCode);
|
||||||
|
|
||||||
AgvResponse xgAGVWaitPointRequest(JSONObject requestParam);
|
AgvResponse agvWaitPointRequest(JSONObject requestParam);
|
||||||
|
|
||||||
public AgvResponse updateKZAgvInst(JSONObject requestParam);
|
// public AgvResponse updateKZAgvInst(JSONObject requestParam);
|
||||||
|
|
||||||
AgvResponse requestResource(JSONObject requestParam);
|
AgvResponse requestResource(JSONObject requestParam);
|
||||||
|
|
||||||
AgvResponse releaseResource(JSONObject requestParam);
|
AgvResponse releaseResource(JSONObject requestParam);
|
||||||
|
|
||||||
HttpResponse getRobotInfo(String robotCode);
|
// HttpResponse getRobotInfo(String robotCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新任务状态
|
* 更新任务状态
|
||||||
|
|||||||
@@ -122,53 +122,58 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public HttpResponse queryKZAgvStatus(String vehicleCode) {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public HttpResponse queryKZAgvInstStatus(String instCode) {
|
||||||
|
//
|
||||||
|
// if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
|
||||||
|
// String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||||
|
// String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||||
|
//
|
||||||
|
// agvurl = agvurl + ":" + agvport + "/api/fms/taskStatus/" + instCode;
|
||||||
|
//
|
||||||
|
// HttpResponse result = HttpRequest.get(agvurl)
|
||||||
|
// //超时,毫秒
|
||||||
|
// .timeout(20000)
|
||||||
|
// .execute();
|
||||||
|
// System.out.println("查询agv指令数据:" + result.body());
|
||||||
|
//
|
||||||
|
// return result;
|
||||||
|
// } else {
|
||||||
|
//
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public HttpResponse queryKZAgvStatus(String vehicleCode) {
|
||||||
|
//
|
||||||
|
// if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
|
||||||
|
// String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||||
|
// String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||||
|
//
|
||||||
|
// agvurl = agvurl + ":" + agvport + "/api/fms/vehicleStatus/" + vehicleCode;
|
||||||
|
//
|
||||||
|
// HttpResponse result = HttpRequest.get(agvurl)
|
||||||
|
// //超时,毫秒
|
||||||
|
// .timeout(20000)
|
||||||
|
// .execute();
|
||||||
|
// System.out.println("查询agv数据:" + result.body());
|
||||||
|
//
|
||||||
|
// return result;
|
||||||
|
// } else {
|
||||||
|
//
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse queryKZAgvInstStatus(String instCode) {
|
public AgvResponse agvWaitPointRequest(JSONObject requestParam) {
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
|
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
|
||||||
|
|
||||||
agvurl = agvurl + ":" + agvport + "/api/fms/taskStatus/" + instCode;
|
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.get(agvurl)
|
|
||||||
//超时,毫秒
|
|
||||||
.timeout(20000)
|
|
||||||
.execute();
|
|
||||||
System.out.println("查询agv指令数据:" + result.body());
|
|
||||||
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpResponse queryKZAgvStatus(String vehicleCode) {
|
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
|
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
|
||||||
|
|
||||||
agvurl = agvurl + ":" + agvport + "/api/fms/vehicleStatus/" + vehicleCode;
|
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.get(agvurl)
|
|
||||||
//超时,毫秒
|
|
||||||
.timeout(20000)
|
|
||||||
.execute();
|
|
||||||
System.out.println("查询agv数据:" + result.body());
|
|
||||||
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AgvResponse xgAGVWaitPointRequest(JSONObject requestParam) {
|
|
||||||
System.out.println("请求kc参数:" + requestParam);
|
System.out.println("请求kc参数:" + requestParam);
|
||||||
String taskId = requestParam.getString("TaskId");
|
String taskId = requestParam.getString("TaskId");
|
||||||
String type = requestParam.getString("type"); // 1 取货点等待 2 放货点等待
|
String type = requestParam.getString("type"); // 1 取货点等待 2 放货点等待
|
||||||
@@ -273,17 +278,17 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public AgvResponse updateKZAgvInst(JSONObject requestParam) {
|
// public AgvResponse updateKZAgvInst(JSONObject requestParam) {
|
||||||
// JSONObject ja = new JSONObject();
|
//// JSONObject ja = new JSONObject();
|
||||||
// ja.put("Key","Result");
|
//// ja.put("Key","Result");
|
||||||
// ja.put("Value","true");
|
//// ja.put("Value","true");
|
||||||
|
//
|
||||||
AgvResponse agvResponse = new AgvResponse();
|
// AgvResponse agvResponse = new AgvResponse();
|
||||||
agvResponse.setResult("true");
|
// agvResponse.setResult("true");
|
||||||
agvResponse.setErrMsg("");
|
// agvResponse.setErrMsg("");
|
||||||
return agvResponse;
|
// return agvResponse;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AgvResponse requestResource(JSONObject requestParam) {
|
public AgvResponse requestResource(JSONObject requestParam) {
|
||||||
@@ -302,26 +307,26 @@ public class KeCongAgvServiceImpl implements KeCongAgvService {
|
|||||||
return agvResponse;
|
return agvResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public HttpResponse getRobotInfo(String robotCode) {
|
// public HttpResponse getRobotInfo(String robotCode) {
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
// if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
// String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
// String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||||
|
//
|
||||||
agvurl = agvurl + ":" + agvport + "/" + "robotsStatus?vehicles=" + robotCode;
|
// agvurl = agvurl + ":" + agvport + "/" + "robotsStatus?vehicles=" + robotCode;
|
||||||
log.info("根据指定机器人查询状态的请求:{}", agvurl);
|
// log.info("根据指定机器人查询状态的请求:{}", agvurl);
|
||||||
JSONObject param = new JSONObject();
|
// JSONObject param = new JSONObject();
|
||||||
param.put("VehicleNo", robotCode);
|
// param.put("VehicleNo", robotCode);
|
||||||
HttpResponse result = HttpRequest.get(agvurl)
|
// HttpResponse result = HttpRequest.get(agvurl)
|
||||||
.body(String.valueOf(param))
|
// .body(String.valueOf(param))
|
||||||
.timeout(20000)//超时,毫秒
|
// .timeout(20000)//超时,毫秒
|
||||||
.execute();
|
// .execute();
|
||||||
log.info("根据指定机器人查询状态的请求反馈:{}", result);
|
// log.info("根据指定机器人查询状态的请求反馈:{}", result);
|
||||||
return result;
|
// return result;
|
||||||
} else {
|
// } else {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public JSONObject updateKZAgvInstStatus(String instCode) {
|
// public JSONObject updateKZAgvInstStatus(String instCode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user