*/ | */ | ||||
private String name; | private String name; | ||||
/** | |||||
* 无人机直播视频原地址 | |||||
*/ | |||||
private String playUrl; | |||||
/** | /** | ||||
*无人机推流地址 | *无人机推流地址 | ||||
*/ | */ |
/** | /** | ||||
* 直播地址 | * 直播地址 | ||||
*/ | */ | ||||
private String aipullUrl; | |||||
/** | |||||
* 直播地址 | |||||
*/ | |||||
private String pullUrl; | |||||
/** | |||||
* AI识别后视频地址 | |||||
*/ | |||||
private String aiVideoUrl; | |||||
private String playUrl; | |||||
/** | /** | ||||
* 回放视频地址 | * 回放视频地址 |
/** | /** | ||||
* 直播视频url | * 直播视频url | ||||
*/ | */ | ||||
private String pullUrl; | |||||
private String playUrl; | |||||
/** | /** | ||||
* 机场外部监控地址 | * 机场外部监控地址 |
QUERY_IS_FAILED(1230700, "获取数据失败"), | QUERY_IS_FAILED(1230700, "获取数据失败"), | ||||
INSPECTION_ID_IS_NULL(1230701, "任务id为空"), | INSPECTION_ID_IS_NULL(1230701, "任务id为空"), | ||||
LIVE_CHANNEL_IS_NOT_EXIST(1230702, "直播通道为空"), | LIVE_CHANNEL_IS_NOT_EXIST(1230702, "直播通道为空"), | ||||
PULL_URL_IS_NULL(1230703, "直播地址为空"), | |||||
PLAY_URL_IS_NULL(1230703, "直播地址为空"), | |||||
VIDEO_URL_IS_NULL(1230704, "回放地址为空"), | VIDEO_URL_IS_NULL(1230704, "回放地址为空"), | ||||
DRONE_ID_IS_NULL(1230705, "无人机id为空"), | DRONE_ID_IS_NULL(1230705, "无人机id为空"), | ||||
INSPECTION_IS_NOT_EXIST(1230706, "任务不存在"); | INSPECTION_IS_NOT_EXIST(1230706, "任务不存在"); |
import com.tuoheng.admin.entity.vo.airport.AirPortStatusVO; | import com.tuoheng.admin.entity.vo.airport.AirPortStatusVO; | ||||
import com.tuoheng.admin.entity.vo.inspection.InspectionScrollbarVo; | import com.tuoheng.admin.entity.vo.inspection.InspectionScrollbarVo; | ||||
import com.tuoheng.admin.enums.InspectionStatusEnum; | import com.tuoheng.admin.enums.InspectionStatusEnum; | ||||
import com.tuoheng.admin.enums.InspectionTypeEnum; | |||||
import com.tuoheng.admin.enums.MarkEnum; | import com.tuoheng.admin.enums.MarkEnum; | ||||
import com.tuoheng.admin.mapper.InspectionMapper; | import com.tuoheng.admin.mapper.InspectionMapper; | ||||
import com.tuoheng.admin.utils.CurrentUserUtil; | import com.tuoheng.admin.utils.CurrentUserUtil; | ||||
List<Inspection> inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery() | List<Inspection> inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery() | ||||
.eq(Inspection::getTenantId, tenantId) | .eq(Inspection::getTenantId, tenantId) | ||||
.eq(Inspection::getMark, MarkEnum.VALID.getCode()) | .eq(Inspection::getMark, MarkEnum.VALID.getCode()) | ||||
.notIn(Inspection::getInspectionType, InspectionTypeEnum.MABNNEDFLIGHT.getCode()) | |||||
.in(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode(), InspectionStatusEnum.PREPARING.getCode())); | .in(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode(), InspectionStatusEnum.PREPARING.getCode())); | ||||
if(CollectionUtils.isEmpty(inspectionList) || inspectionList.size() == 0){ | if(CollectionUtils.isEmpty(inspectionList) || inspectionList.size() == 0){ | ||||
log.info("任务列表为空"); | log.info("任务列表为空"); |
if (ObjectUtil.isNull(liveChannel)) { | if (ObjectUtil.isNull(liveChannel)) { | ||||
return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg()); | return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg()); | ||||
} | } | ||||
if (StringUtils.isEmpty(liveChannel.getPullUrl())) { | |||||
return JsonResult.error(QueryVideoServiceEnum.PULL_URL_IS_NULL.getCode(), QueryVideoServiceEnum.PULL_URL_IS_NULL.getMsg()); | |||||
if (StringUtils.isEmpty(liveChannel.getPlayUrl())) { | |||||
return JsonResult.error(QueryVideoServiceEnum.PLAY_URL_IS_NULL.getCode(), QueryVideoServiceEnum.PLAY_URL_IS_NULL.getMsg()); | |||||
} | } | ||||
liveChannelVo.setAipullUrl(liveChannel.getAipullUrl()); | |||||
liveChannelVo.setPullUrl(liveChannel.getPullUrl()); | |||||
if(StringUtils.isNotEmpty(liveChannel.getPlayUrl())){ | |||||
liveChannelVo.setPlayUrl(liveChannel.getPlayUrl()); | |||||
} | |||||
} | } | ||||
if (15 == inspection.getStatus()) { | if (15 == inspection.getStatus()) { | ||||
return JsonResult.error(QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getCode(), QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getMsg()); | return JsonResult.error(QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getCode(), QueryVideoServiceEnum.VIDEO_URL_IS_NULL.getMsg()); | ||||
} | } | ||||
liveChannelVo.setVideoUrl(CommonConfig.videoURL + inspection.getVideoUrl()); | liveChannelVo.setVideoUrl(CommonConfig.videoURL + inspection.getVideoUrl()); | ||||
liveChannelVo.setAiVideoUrl(CommonConfig.videoURL + inspection.getAiVideoUrl()); | |||||
} | } | ||||
return JsonResult.success(liveChannelVo); | return JsonResult.success(liveChannelVo); | ||||
} | } | ||||
.eq(LiveChannel::getInspectionId, inspection.getId()) | .eq(LiveChannel::getInspectionId, inspection.getId()) | ||||
.eq(LiveChannel::getStatus, 1)); | .eq(LiveChannel::getStatus, 1)); | ||||
if (ObjectUtil.isNotNull(liveChannel)) { | if (ObjectUtil.isNotNull(liveChannel)) { | ||||
if (StringUtils.isNotEmpty(liveChannel.getPullUrl())) { | |||||
vo.setPullUrl(liveChannel.getPullUrl()); | |||||
if (StringUtils.isNotEmpty(liveChannel.getPlayUrl())) { | |||||
vo.setPlayUrl(liveChannel.getPullUrl()); | |||||
} | } | ||||
} | } | ||||
//获取机场内外部视频 | //获取机场内外部视频 |
if (liveChannelDto == null || org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getCode()) | if (liveChannelDto == null || org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getCode()) | ||||
|| liveChannelDto.getStatus() == null | || liveChannelDto.getStatus() == null | ||||
|| org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getPushUrl()) | || org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getPushUrl()) | ||||
|| org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getPullUrl())) { | |||||
|| org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getPullUrl()) | |||||
|| org.apache.commons.lang3.StringUtils.isEmpty(liveChannelDto.getPullM3u8())) { | |||||
log.error("获取通道状态信息不完整!"); | log.error("获取通道状态信息不完整!"); | ||||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取通道状态信息不完整!"); | throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取通道状态信息不完整!"); | ||||
} | } |
map3.put("ename", "pull_url"); | map3.put("ename", "pull_url"); | ||||
map3.put("evalue", dto.getPullUrl()); | map3.put("evalue", dto.getPullUrl()); | ||||
reqMapList.add(map3); | reqMapList.add(map3); | ||||
Map<String,Object> playUrlMap = new HashMap<>(); | |||||
playUrlMap.put("ename","play_url"); | |||||
playUrlMap.put("evalue",dto.getPullM3u8()); | |||||
reqMapList.add(playUrlMap); | |||||
paramMap.put("serviceInstReqList", reqMapList); | paramMap.put("serviceInstReqList", reqMapList); | ||||
log.info(String.format("DSP入参:%s", paramMap)); | log.info(String.format("DSP入参:%s", paramMap)); | ||||
// 修改通道名 | // 修改通道名 | ||||
liveChannel.setName(dto.getName()); | liveChannel.setName(dto.getName()); | ||||
liveChannel.setTenantId(inspection.getTenantId()); | liveChannel.setTenantId(inspection.getTenantId()); | ||||
liveChannel.setPlayUrl(dspCallbackVo.getPlayUrl()); | |||||
liveChannel.setPushUrl(dspCallbackVo.getPushUrl()); | liveChannel.setPushUrl(dspCallbackVo.getPushUrl()); | ||||
liveChannel.setPullUrl(dspCallbackVo.getPlayUrl()); | liveChannel.setPullUrl(dspCallbackVo.getPlayUrl()); | ||||
liveChannel.setAipushUrl(dspCallbackVo.getAipushUrl()); | liveChannel.setAipushUrl(dspCallbackVo.getAipushUrl()); |