@@ -3,7 +3,6 @@ package com.tuoheng.admin.controller.callback; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.tuoheng.admin.request.inspection.InspectionRequest; | |||
import com.tuoheng.admin.request.inspection.MissionStatusRequest; | |||
import com.tuoheng.admin.service.airport.AirportService; | |||
import com.tuoheng.admin.service.inspection.IInspectionService; | |||
import com.tuoheng.common.core.common.OperationEnum; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
@@ -22,7 +21,7 @@ import javax.validation.Valid; | |||
*/ | |||
@Slf4j | |||
@RestController | |||
@RequestMapping("/airport/callback") | |||
@RequestMapping("/airport/inspection") | |||
public class AirPortCallbackController { | |||
@Autowired | |||
@@ -37,7 +36,6 @@ public class AirPortCallbackController { | |||
return iInspectionService.updateStatus(missionStatusRequest); | |||
} | |||
/** | |||
* 被硬件调用,存飞行轨迹 | |||
*/ | |||
@@ -47,5 +45,4 @@ public class AirPortCallbackController { | |||
return iInspectionService.track(inspectionRequest); | |||
} | |||
} |
@@ -77,8 +77,14 @@ public class UpdateFlightStatusService { | |||
return JsonResult.success(); | |||
} | |||
/** | |||
* 调用DSP接口 | |||
* | |||
* @param missionStatusRequest | |||
* @return | |||
*/ | |||
private JsonResult startAI(MissionStatusRequest missionStatusRequest) { | |||
//调用DSP接口 | |||
log.info("进入调用DSP接口方法"); | |||
JSONObject request = new JSONObject(); | |||
JSONArray configList = new JSONArray(); | |||
JSONObject instConfigMode = new JSONObject(); | |||
@@ -108,7 +114,6 @@ public class UpdateFlightStatusService { | |||
if (responseJson.getIntValue("code") == 0) { | |||
String requestId = responseJson.getJSONObject("data").getString("requestId"); | |||
log.info("dsp实时调用响应requestId:{}", requestId); | |||
} else { | |||
log.error("dsp实时调用失败:{}", responseJson); | |||
return JsonResult.error(EditInspectionStatusCodeEnum.TASK_ANALYSIS_FAILED.getCode(), EditInspectionStatusCodeEnum.TASK_ANALYSIS_FAILED.getMsg()); | |||
@@ -116,7 +121,14 @@ public class UpdateFlightStatusService { | |||
return JsonResult.success(responseJson); | |||
} | |||
/** | |||
* 处理通道数据 | |||
* | |||
* @param inspection | |||
* @param dspCallbackVo | |||
*/ | |||
private void liveChannelHandle(Inspection inspection, DspCallbackVo dspCallbackVo) { | |||
log.info("进入处理通道数据方法"); | |||
// 通道表新增 | |||
LiveChannel liveChannel = this.buildLiveChannel(inspection, dspCallbackVo); | |||
// 查验是否存在 |
@@ -55,7 +55,7 @@ public class UpdateInspectionStatusService { | |||
* @return | |||
*/ | |||
public JsonResult updateStatus(MissionStatusRequest missionStatusRequest) { | |||
log.info("进入修改任务状态业务接口"); | |||
log.info("进入修改任务状态业务接口, missionStatusRequest:{}", missionStatusRequest); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
JsonResult result = this.check(tenantId, missionStatusRequest); | |||
if (0 != result.getCode()) { | |||
@@ -66,12 +66,15 @@ public class UpdateInspectionStatusService { | |||
Inspection inspection = (Inspection) result.getData(); | |||
if (AirPortTaskStatusEnum.FLIGHT.getCode() != missionStatusRequest.getStatus() && AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { | |||
log.info("修改任务状态业务接口:飞行状态出错!"); | |||
return JsonResult.error(EditInspectionStatusCodeEnum.TASK_NOT_STATUS.getCode(), EditInspectionStatusCodeEnum.TASK_NOT_STATUS.getMsg()); | |||
} | |||
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) { | |||
log.info("修改任务状态业务接口:修改执行中状态"); | |||
updateFlightStatusService.updateFlightStatus(inspection, missionStatusRequest); | |||
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { | |||
log.info("修改任务状态业务接口:修改待执行状态"); | |||
updateWaittStatusService.updateWaittStatus(inspection); | |||
} | |||