|
@@ -45,6 +45,8 @@ import javax.validation.constraints.Min;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 系统信息 前端控制器
|
|
@@ -493,7 +495,6 @@ public class SysController {
|
|
|
@Transactional
|
|
|
public Result getTencentVideo(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId) {
|
|
|
List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.findExamRecordByNotVideoUrl(examId);
|
|
|
-
|
|
|
if (!CollectionUtils.isEmpty(tOeExamRecordList)) {
|
|
|
for (TOeExamRecord t : tOeExamRecordList) {
|
|
|
Map<String, Object> resultMap = tencentYunUtil.callTencentVideo(t.getId());
|
|
@@ -551,12 +552,12 @@ public class SysController {
|
|
|
@ApiOperation(value = "视频存储查询接口")
|
|
|
@RequestMapping(value = "/video/select", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "超管视频存储查询接口", response = VideoQueryResult.class)})
|
|
|
- public Result videoSelect(@ApiParam(value = "机构代码") @RequestParam(required = false) String orgCode,
|
|
|
+ public Result videoSelect(@ApiParam(value = "考试批次名称") @RequestParam(required = false) String examName,
|
|
|
@ApiParam(value = "机构名称") @RequestParam(required = false) String orgName,
|
|
|
@ApiParam(value = "状态,ALL:全部,TRUE:已删除,FALSE:有效") @RequestParam(required = false) VideoTypeEnum type,
|
|
|
@ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) int pageNumber,
|
|
|
@ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.SELECT_PAGE_SIZE_MAX) int pageSize) {
|
|
|
- return ResultUtil.ok(teExamService.videoQuery(new Page<>(pageNumber, pageSize), orgCode, orgName, type));
|
|
|
+ return ResultUtil.ok(teExamService.videoQuery(new Page<>(pageNumber, pageSize), examName, orgName, type));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "视频删除状态重置接口")
|
|
@@ -586,8 +587,14 @@ public class SysController {
|
|
|
if (lock) {
|
|
|
try {
|
|
|
Set<Long> tencentVideoMessageIds = new HashSet<>(tmTencentVideoMessageList.size());
|
|
|
+ QueryWrapper<TOeExamRecord> tOeExamRecordQueryWrapper = new QueryWrapper<>();
|
|
|
+ tOeExamRecordQueryWrapper.lambda().eq(TOeExamRecord::getExamId, examId);
|
|
|
+ List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.list(tOeExamRecordQueryWrapper);
|
|
|
+ Map<Long, TOeExamRecord> tOeExamRecordMap = tOeExamRecordList.stream().collect(
|
|
|
+ Collectors.toMap(TOeExamRecord::getId, Function.identity(), (dto1, dto2) -> dto1));
|
|
|
for (TMTencentVideoMessage t : tmTencentVideoMessageList) {
|
|
|
tencentVideoMessageIds.add(t.getId());
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getExamRecordId());
|
|
|
if (Objects.nonNull(t.getObject()) && !Objects.equals(t.getObject().trim(), "")) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(t.getObject());
|
|
|
if (Objects.nonNull(jsonObject.get("mediaInfoSet")) && !Objects.equals(jsonObject.getString("mediaInfoSet").trim(), "")) {
|
|
@@ -601,6 +608,9 @@ public class SysController {
|
|
|
"",
|
|
|
tencentYunUtil.getVodAppId(),
|
|
|
object.getString("fileId"));
|
|
|
+ if (Objects.nonNull(tOeExamRecord)) {
|
|
|
+ tOeExamRecord.setVideoStatus(true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (Objects.nonNull(jsonObject.get("file_id")) && !Objects.equals(jsonObject.getString("file_id").trim(), "")) {
|
|
@@ -610,10 +620,14 @@ public class SysController {
|
|
|
"",
|
|
|
tencentYunUtil.getVodAppId(),
|
|
|
jsonObject.getString("file_id"));
|
|
|
+ if (Objects.nonNull(tOeExamRecord)) {
|
|
|
+ tOeExamRecord.setVideoStatus(true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
tmTencentVideoMessageService.removeByIds(tencentVideoMessageIds);
|
|
|
+ tOeExamRecordService.updateBatchById(tOeExamRecordMap.values());
|
|
|
} finally {
|
|
|
redisUtil.releaseLock(SystemConstant.REDIS_LOCK_TENCENT_VIDEO_DELETE_PREFIX + examId);
|
|
|
}
|