@@ -2,9 +2,7 @@ package com.tuoheng.admin.controller; | |||
import com.tuoheng.admin.dto.InspectionDto; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import com.tuoheng.admin.request.inspection.AddInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.EditInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||
import com.tuoheng.admin.request.inspection.*; | |||
import com.tuoheng.admin.service.inspection.IInspectionService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -157,4 +155,26 @@ public class InspectionController { | |||
return iInspectionService.getNewInspectionList(); | |||
} | |||
/** | |||
* 上传离线视频 | |||
* | |||
* @param request | |||
* @return | |||
*/ | |||
@PostMapping("/uploadFlightUrl") | |||
public JsonResult uploadFlightUrl(@RequestBody UploadFlightUrlRequest request) { | |||
return iInspectionService.uploadFlightUrl(request); | |||
} | |||
/** | |||
* 修改巡检任务 | |||
* | |||
* @param request | |||
* @return | |||
*/ | |||
@PostMapping("/updateTaskByCode") | |||
public JsonResult updateTaskByCode(@RequestBody UpdateTaskByCodeRequest request) { | |||
return iInspectionService.updateTaskByCode(request); | |||
} | |||
} |
@@ -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); | |||
} | |||
} |
@@ -1,13 +1,8 @@ | |||
package com.tuoheng.admin.controller.callback; | |||
import com.tuoheng.admin.request.inspection.UpdateTaskByCodeRequest; | |||
import com.tuoheng.admin.request.inspection.UploadFlightUrlRequest; | |||
import com.tuoheng.admin.service.inspection.IInspectionService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
@@ -26,25 +21,4 @@ public class PilotCallbackController { | |||
@Autowired | |||
private IInspectionService iInspectionService; | |||
/** | |||
* 上传离线视频 | |||
* | |||
* @param request | |||
* @return | |||
*/ | |||
@PostMapping("/uploadFlightUrl") | |||
public JsonResult uploadFlightUrl(@RequestBody UploadFlightUrlRequest request) { | |||
return iInspectionService.uploadFlightUrl(request); | |||
} | |||
/** | |||
* 修改巡检任务 | |||
* | |||
* @param request | |||
* @return | |||
*/ | |||
@PostMapping("/updateTaskByCode") | |||
public JsonResult updateTaskByCode(@RequestBody UpdateTaskByCodeRequest request) { | |||
return iInspectionService.updateTaskByCode(request); | |||
} | |||
} |
@@ -102,13 +102,16 @@ public class ExecuteInspectionService { | |||
* @return | |||
*/ | |||
public JsonResult executeTask(String userId, String tenantId, Inspection inspection) { | |||
log.info("进入调用机场平台方法"); | |||
// 读取不同租户的机场平台url | |||
Tenant tenant = tenantMapper.selectById(inspection.getTenantId()); | |||
if (ObjectUtil.isEmpty(tenant)) { | |||
log.info("进入调用机场平台方法: 租户不存在"); | |||
return JsonResult.error(ExecuteInspectionCodeEnum.TENANT_IS_NOT_EXIST.getCode(), ExecuteInspectionCodeEnum.TENANT_IS_NOT_EXIST.getMsg()); | |||
} | |||
if (StringUtils.isEmpty(tenant.getAirportUrl())) { | |||
log.info("进入调用机场平台方法: 机场平台URL为空"); | |||
return JsonResult.error(ExecuteInspectionCodeEnum.AIRPORT_URL_IS_NULL.getCode(), ExecuteInspectionCodeEnum.AIRPORT_URL_IS_NULL.getMsg()); | |||
} | |||
@@ -119,6 +122,9 @@ public class ExecuteInspectionService { | |||
jsonObject.put("code", "gs"); // 与机场平台约定好的 | |||
jsonObject.put("tenantName", tenant.getName()); | |||
log.info("进入调用机场平台方法: url:{}", url); | |||
log.info("进入调用机场平台方法: jsonObject:{}", jsonObject); | |||
String airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST"); | |||
if (StringUtils.isEmpty(airPortStr)) { | |||
log.info("立即执行任务业务:机场接口返回数据为空,任务id:{},任务名称:{},机场id:{},机场名称:{}, 路线id:{},路线名称:{}", |
@@ -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); | |||
} | |||