Browse Source

根据机场返航

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
d8640389b7
2 changed files with 5 additions and 8 deletions
  1. +0
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/constant/SystemConstant.java
  2. +5
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/ReversalFlightService.java

+ 0
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/constant/SystemConstant.java View File

@@ -39,11 +39,6 @@ public interface SystemConstant {
*/
String API_AIRPORT_POINT_FLIGH = "/api/airportInterface/createPointLine";

/**
* 机场平台:返航飞行
*/
String API_AIRPORT_REVERSAL_FLIGH = "/api/airportInterface/droneCommand";

/**
* 机场平台:获取天气
*/

+ 5
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/ReversalFlightService.java View File

@@ -49,14 +49,16 @@ public class ReversalFlightService {
// .eq(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode()));
request.setZhilin("03");
//调用机场平台让飞机返航
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_REVERSAL_FLIGH;
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_DRONE_CONTROL;
JSONObject jsonObject = new JSONObject();
jsonObject.put("airportId",request.getAirportId());
jsonObject.put("zhilin",request.getZhilin());
jsonObject.put("msg","回仓");
log.info("调用机场平台,无人机执行定点飞行返航:url:{}",url);
log.info("调用机场平台,原无人机执行定点飞行返航,jsonObject:{}",jsonObject);

String airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST");
log.info("调用无人机平台,操作无人机:airPortStr:{}",airPortStr);
if (StringUtils.isEmpty(airPortStr)) {
log.info("原无人机执行定点飞行返航:机场接口返回数据为空,返航失败,jsonObject:{}", jsonObject);
throw new ServiceException("机场接口返回数据为空,返航失败");
@@ -64,9 +66,9 @@ public class ReversalFlightService {
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);
if (0 != jsonResult.getCode()) {
log.info("调用机场平台,无人机执行定点飞行:返航失败,jsonResult:{}", jsonResult.getMsg());
throw new com.tuoheng.common.core.exception.ServiceException("机场平台返回,返航失败");
return JsonResult.error(-1,"机场平台返回失败");
}
log.info("调用无人机平台返航结束");
return JsonResult.success();
}
}

Loading…
Cancel
Save