Browse Source

修改停止录制代码

pull/87/head
wanjing 10 months ago
parent
commit
57d6480ec8
3 changed files with 9 additions and 17 deletions
  1. +0
    -12
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java
  2. +4
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StartRecordService.java
  3. +5
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopRecordService.java

+ 0
- 12
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java View File

// 硬件停止后,停止录制 // 硬件停止后,停止录制
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()) {

+ 4
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StartRecordService.java View File

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

+ 5
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopRecordService.java View File

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;
} }

Loading…
Cancel
Save