// 硬件停止后,停止录制 | // 硬件停止后,停止录制 | ||||
dspService.stopRecord(businessList.get(0).getMsgId()); | dspService.stopRecord(businessList.get(0).getMsgId()); | ||||
// 硬件停止后,查询录屏信息 | |||||
JsonResult jsonResult = dspService.queryRecord(businessList.get(0).getMsgId()); | |||||
if (0 == jsonResult.getCode()) { | |||||
DspCallbackQueryVo dspCallbackQueryVo = (DspCallbackQueryVo) jsonResult.getData(); | |||||
log.info("查询录屏信息,dsp响应体:{}", JacksonUtil.obj2StringPretty(dspCallbackQueryVo)); | |||||
if (ObjectUtil.isNotEmpty(dspCallbackQueryVo)) { | |||||
inspectionUpdate.setVideoUrl(dspCallbackQueryVo.getRecordingVideoUrl()); | |||||
} else { | |||||
log.info("查询录屏信息,录屏视频地址为空"); | |||||
} | |||||
} | |||||
//获取天气信息 | //获取天气信息 | ||||
JsonResult result = this.getWeather(CommonConfig.airportURL, inspection.getAirportId()); | JsonResult result = this.getWeather(CommonConfig.airportURL, inspection.getAirportId()); | ||||
if (0 != result.getCode()) { | if (0 != result.getCode()) { |
@Value("${tuoheng.dsp-domain-url:}") | @Value("${tuoheng.dsp-domain-url:}") | ||||
private String dspDomainUrl; | private String dspDomainUrl; | ||||
@Value("${tuoheng.dsp-callback-url:}") | |||||
private String dspCallbackUrl; | |||||
/** | /** | ||||
* 调用DSP接口 | * 调用DSP接口 | ||||
* | * | ||||
JSONObject jsonObject = new JSONObject(); | JSONObject jsonObject = new JSONObject(); | ||||
jsonObject.put("requestId", request.getRequestId()); | jsonObject.put("requestId", request.getRequestId()); | ||||
jsonObject.put("pullUrl", request.getPullUrl()); | jsonObject.put("pullUrl", request.getPullUrl()); | ||||
jsonObject.put("callbackUrl", dspCallbackUrl); | |||||
log.info("调用dsp平台,开始录制接口,url:{}", url); | log.info("调用dsp平台,开始录制接口,url:{}", url); | ||||
log.info("调用dsp平台,开始录制接口,jsonObject:{}", jsonObject); | log.info("调用dsp平台,开始录制接口,jsonObject:{}", jsonObject); |
log.info("调用dsp平台,停止录制接口,url:{}", url); | log.info("调用dsp平台,停止录制接口,url:{}", url); | ||||
log.info("调用dsp平台,停止录制接口,jsonObject:{}", jsonObject); | log.info("调用dsp平台,停止录制接口,jsonObject:{}", jsonObject); | ||||
ResponseEntity<JsonResult> response; | |||||
ResponseEntity<JsonResult> response = null; | |||||
try { | try { | ||||
response = restTemplate.exchange(url, HttpMethod.PUT, httpEntity, JsonResult.class); | response = restTemplate.exchange(url, HttpMethod.PUT, httpEntity, JsonResult.class); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
log.info("调用dsp平台,停止录制接口异常, e:{}", e); | log.info("调用dsp平台,停止录制接口异常, e:{}", e); | ||||
throw new ServiceException("调用dsp平台,停止录制接口异常"); | |||||
// throw new ServiceException("调用dsp平台,停止录制接口异常"); | |||||
} | } | ||||
if (response == null || !response.hasBody()) { | if (response == null || !response.hasBody()) { | ||||
log.error("调用dsp平台,停止录制接口返回为空!"); | log.error("调用dsp平台,停止录制接口返回为空!"); | ||||
throw new ServiceException("调用dsp平台,停止录制接口返回为空"); | |||||
// throw new ServiceException("调用dsp平台,停止录制接口返回为空"); | |||||
} | } | ||||
JsonResult jsonResult = response.getBody(); | JsonResult jsonResult = response.getBody(); | ||||
if (0 != jsonResult.getCode()) { | if (0 != jsonResult.getCode()) { | ||||
log.info("调用dsp平台,停止录制接口返回失败,jsonResult:{}", jsonResult.getMsg()); | |||||
throw new ServiceException("调用dsp平台,停止录制接口返回失败"); | |||||
log.info("调用dsp平台,停止录制接口返回失败,jsonResult:{}", jsonResult); | |||||
// throw new ServiceException("调用dsp平台,停止录制接口返回失败"); | |||||
} | } | ||||
return jsonResult; | return jsonResult; | ||||
} | } |