|
|
@@ -41,10 +41,11 @@ public class DroneControlServiceImpl implements IDroneControlService { |
|
|
|
try { |
|
|
|
Airport airport = airportService.getById(airportId); |
|
|
|
if (airport==null){ |
|
|
|
return JsonResult.error(ServiceExceptionEnum.HTTP_RETURN_ERROR); |
|
|
|
log.info("机场ID:{}查询为空",airportId); |
|
|
|
return JsonResult.error(ServiceExceptionEnum.FIND_NULL.getCode(),ServiceExceptionEnum.FIND_NULL.getMessage()); |
|
|
|
} |
|
|
|
JSONObject parm = new JSONObject(); |
|
|
|
DroneControlEnum droneControlEnum = DroneControlEnum.findEnumByValue(action); |
|
|
|
DroneControlEnum droneControlEnum = DroneControlEnum.findEnumByRequestCode(action); |
|
|
|
parm.put(droneControlEnum.getCode(), droneControlEnum.getValue()); |
|
|
|
String result = HTTPUtils.requestHTTPContent(airport.getGroundStationUrl(),"post",HTTPUtils.headers,parm); |
|
|
|
return returnResult(result,airport.getGroundStationUrl(),JSONObject.toJSONString(parm)); |
|
|
@@ -65,7 +66,8 @@ public class DroneControlServiceImpl implements IDroneControlService { |
|
|
|
public JsonResult toPiont(Point point, int airportId) { |
|
|
|
Airport airport = airportService.getById(airportId); |
|
|
|
if (airport==null){ |
|
|
|
return JsonResult.error(ServiceExceptionEnum.HTTP_RETURN_ERROR); |
|
|
|
log.info("机场ID:{}查询为空",airportId); |
|
|
|
return JsonResult.error(ServiceExceptionEnum.FIND_NULL.getCode(),ServiceExceptionEnum.FIND_NULL.getMessage()); |
|
|
|
} |
|
|
|
JSONObject parm = (JSONObject)JSONObject.toJSON(point); |
|
|
|
String result = null; |
|
|
@@ -88,7 +90,8 @@ public class DroneControlServiceImpl implements IDroneControlService { |
|
|
|
public JsonResult uploadFlyLine(String url, int airportId) { |
|
|
|
Airport airport = airportService.getById(airportId); |
|
|
|
if (airport==null){ |
|
|
|
return JsonResult.error(ServiceExceptionEnum.HTTP_RETURN_ERROR); |
|
|
|
log.info("机场ID:{}查询为空",airportId); |
|
|
|
return JsonResult.error(ServiceExceptionEnum.FIND_NULL.getCode(),ServiceExceptionEnum.FIND_NULL.getMessage()); |
|
|
|
} |
|
|
|
JSONObject parm = new JSONObject(); |
|
|
|
parm.put("hangdian",url); |