Browse Source

Merge branch 'develop' of gitadmin/tuoheng_air_monitor into release

pull/101/head
wanjing 8 months ago
parent
commit
cecfee70d1
1 changed files with 11 additions and 13 deletions
  1. +11
    -13
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java

+ 11
- 13
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java View File

@Autowired @Autowired
private TenantMapper tenantMapper; private TenantMapper tenantMapper;



public JsonResult getVideoById(String id) { public JsonResult getVideoById(String id) {
if (StringUtils.isEmpty(id)) { if (StringUtils.isEmpty(id)) {
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(), QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg()); return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(), QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(liveChannel.getPlayUrl())) { if (StringUtils.isEmpty(liveChannel.getPlayUrl())) {
return JsonResult.error(QueryVideoServiceEnum.PLAY_URL_IS_NULL.getCode(), QueryVideoServiceEnum.PLAY_URL_IS_NULL.getMsg()); return JsonResult.error(QueryVideoServiceEnum.PLAY_URL_IS_NULL.getCode(), QueryVideoServiceEnum.PLAY_URL_IS_NULL.getMsg());
} }
if(StringUtils.isNotEmpty(liveChannel.getPlayUrl())){
if (StringUtils.isNotEmpty(liveChannel.getPlayUrl())) {
liveChannelVo.setPlayUrl(liveChannel.getPlayUrl()); liveChannelVo.setPlayUrl(liveChannel.getPlayUrl());
} }


} }
if (15 == inspection.getStatus()) { if (15 == inspection.getStatus()) {
//任务状态为任务飞行完成15视频回放 //任务状态为任务飞行完成15视频回放
if (StringUtils.isEmpty(inspection.getAiVideoUrl())) {
if (StringUtils.isEmpty(inspection.getVideoUrl())) {
return JsonResult.success(QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getCode(), QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getMsg()); return JsonResult.success(QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getCode(), QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getMsg());
} }
liveChannelVo.setVideoUrl(CommonConfig.videoURL + inspection.getVideoUrl()); liveChannelVo.setVideoUrl(CommonConfig.videoURL + inspection.getVideoUrl());


/** /**
* 根据任务id和无人机id获取直播和机场内外部视频 * 根据任务id和无人机id获取直播和机场内外部视频
*
* @param inspectionId * @param inspectionId
* @param droneId * @param droneId
* @return * @return
String records = dataObject.get("records").toString(); String records = dataObject.get("records").toString();
List<Airport> airportList = JSONObject.parseArray(records, Airport.class); List<Airport> airportList = JSONObject.parseArray(records, Airport.class);
//log.info("获取records中的数据为:airportList={}", airportList); //log.info("获取records中的数据为:airportList={}", airportList);
if(CollectionUtil.isNotEmpty(airportList) || airportList.size() != 0){
if (CollectionUtil.isNotEmpty(airportList) || airportList.size() != 0) {
Airport airport = airportList.get(0); Airport airport = airportList.get(0);
if(ObjectUtil.isNotNull(airport)){
if (ObjectUtil.isNotNull(airport)) {
vo.setInternalMonitorUrl(airport.getInternalMonitorUrl()); vo.setInternalMonitorUrl(airport.getInternalMonitorUrl());
vo.setExternalMonitorUrl(airport.getExternalMonitorUrl()); vo.setExternalMonitorUrl(airport.getExternalMonitorUrl());
vo.setFlvExternalMonitorUrl(airport.getFlvExternalMonitorUrl()); vo.setFlvExternalMonitorUrl(airport.getFlvExternalMonitorUrl());
} }
} }


return JsonResult.success(vo);
}
return JsonResult.success(vo);
}




private JsonResult check(String userId, String tenantId, String inspectionId, Integer droneId) { private JsonResult check(String userId, String tenantId, String inspectionId, Integer droneId) {
if(StringUtils.isEmpty(inspectionId)){
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(),QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg());
if (StringUtils.isEmpty(inspectionId)) {
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(), QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg());
} }
if(null == droneId){
return JsonResult.error(QueryVideoServiceEnum.DRONE_ID_IS_NULL.getCode(),QueryVideoServiceEnum.DRONE_ID_IS_NULL.getMsg());
if (null == droneId) {
return JsonResult.error(QueryVideoServiceEnum.DRONE_ID_IS_NULL.getCode(), QueryVideoServiceEnum.DRONE_ID_IS_NULL.getMsg());
} }
return JsonResult.success(); return JsonResult.success();
} }

Loading…
Cancel
Save