|
|
@@ -26,8 +26,10 @@ import com.tuoheng.miniprogram.service.IInspectionFileService; |
|
|
|
import com.tuoheng.miniprogram.utils.CurrentUserUtil; |
|
|
|
import com.tuoheng.miniprogram.vo.InspectionFileCountVo; |
|
|
|
import com.tuoheng.miniprogram.vo.InspectionFileInfoVo; |
|
|
|
import com.tuoheng.miniprogram.vo.PlayBackInfoVo; |
|
|
|
import com.tuoheng.miniprogram.vo.SeeQuestionVo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@@ -379,6 +381,44 @@ public class InspectionFileServiceImpl implements IInspectionFileService { |
|
|
|
return JsonResult.success(result); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 观看回放 |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public JsonResult playback(String id) { |
|
|
|
//校验 |
|
|
|
if(StringUtils.isEmpty(id)){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
|
} |
|
|
|
//根据问题id查询对应的任务 |
|
|
|
InspectionFile inspectionFile = inspectionFileMapper.selectById(id); |
|
|
|
if(ObjectUtil.isNull(inspectionFile)){ |
|
|
|
return JsonResult.error(InspectionFileEnum.DATA_IS_NULL.getCode(),InspectionFileEnum.DATA_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
//获取对应的任务id |
|
|
|
String inspectionId = inspectionFile.getInspectionId(); |
|
|
|
if(StringUtils.isEmpty(inspectionId)){ |
|
|
|
return JsonResult.error(InspectionFileEnum.INSPECTION_ID_NULL.getCode(),InspectionFileEnum.INSPECTION_ID_NULL.getMsg()); |
|
|
|
} |
|
|
|
//根据任务id获取任务 |
|
|
|
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getTenantId, 0) |
|
|
|
.eq(Inspection::getMark, 1) |
|
|
|
.eq(Inspection::getId, inspectionId)); |
|
|
|
PlayBackInfoVo vo = new PlayBackInfoVo(); |
|
|
|
BeanUtils.copyProperties(inspection,vo); |
|
|
|
//对视频地址进行处理 |
|
|
|
if(StringUtils.isNotEmpty(inspection.getAiVideoUrl())){ |
|
|
|
vo.setAiVideoUrl(CommonConfig.videoURL+inspection.getVideoUrl()); |
|
|
|
} |
|
|
|
|
|
|
|
return JsonResult.success(vo); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 多个url进行转换,用,号隔开 |
|
|
|
* |