Browse Source

权限管理类

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
a6820cb6af
4 changed files with 54 additions and 1 deletions
  1. +10
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/InspectionFileController.java
  2. +2
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/enums/InspectionFileEnum.java
  3. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/IInspectionFileService.java
  4. +40
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java

+ 10
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/InspectionFileController.java View File

@@ -112,6 +112,16 @@ public class InspectionFileController {
return iInspectionFileService.handleCount();
}

/**
* 观看回放
* @param id
* @return
*/
@GetMapping("/playback/{id}")
public JsonResult playback(@PathVariable("id") String id){
return iInspectionFileService.playback(id);
}



}

+ 2
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/enums/InspectionFileEnum.java View File

@@ -13,7 +13,8 @@ public enum InspectionFileEnum {
WORK_ORDER_ID_NULL(1210404, "登录用户名为空"),
USER_IS_NOT_EXIST(1210405, "用户为空"),
DEPT_ID_IS_NULL(1210406, "部门id为空"),
DATA_IS_NULL(1210407, "数据为空");
DATA_IS_NULL(1210407, "数据为空"),
INSPECTION_ID_NULL(1210408, "任务id为空");


/**

+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/IInspectionFileService.java View File

@@ -27,4 +27,6 @@ public interface IInspectionFileService {
JsonResult navigation(String id);

JsonResult handleCount();

JsonResult playback(String id);
}

+ 40
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java View File

@@ -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进行转换,用,号隔开
*

Loading…
Cancel
Save