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