|
|
@@ -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(); |
|
|
|
} |
|
|
|
} |