Răsfoiți Sursa

视频存储管理修改

wangliang 2 ani în urmă
părinte
comite
823c86ddab

+ 10 - 10
themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java

@@ -550,7 +550,7 @@ public class SysController {
     @ApiResponses({@ApiResponse(code = 200, message = "超管视频存储查询接口", response = VideoQueryResult.class)})
     public Result videoSelect(@ApiParam(value = "机构代码") @RequestParam(required = false) String orgCode,
                               @ApiParam(value = "机构名称") @RequestParam(required = false) String orgName,
-                              @ApiParam(value = "状态,ALL:全部,TRUE:有效,FALSE:已删除") @RequestParam(required = false) VideoTypeEnum type,
+                              @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));
@@ -595,15 +595,6 @@ public class SysController {
                         }
                     }
                     tmTencentVideoMessageService.removeByIds(tencentVideoMessageIds);
-                    TEExam teExam = teExamService.getById(examId);
-                    Optional.ofNullable(teExam).orElseThrow(() -> new BusinessException(ExceptionResultEnum.EXAM_NO));
-
-                    Long time = System.currentTimeMillis();
-                    teExam.setVideoDelete(true);
-                    teExam.setVideoDeleteTime(time);
-                    teExam.setUpdateTime(time);
-                    teExamService.updateById(teExam);
-                    teExamService.updateExamCacheBean(examId);
                 } finally {
                     redisUtil.releaseLock(SystemConstant.REDIS_LOCK_TENCENT_VIDEO_DELETE_PREFIX + examId);
                 }
@@ -611,6 +602,15 @@ public class SysController {
                 throw new BusinessException("该考试批次正在删除视频,请稍候再试");
             }
         }
+        TEExam teExam = teExamService.getById(examId);
+        Optional.ofNullable(teExam).orElseThrow(() -> new BusinessException(ExceptionResultEnum.EXAM_NO));
+
+        Long time = System.currentTimeMillis();
+        teExam.setVideoDelete(true);
+        teExam.setVideoDeleteTime(time);
+        teExam.setUpdateTime(time);
+        teExamService.updateById(teExam);
+        teExamService.updateExamCacheBean(examId);
         return ResultUtil.ok(true);
     }
 }

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/enums/VideoTypeEnum.java

@@ -13,9 +13,9 @@ public enum VideoTypeEnum {
 
     ALL("全部"),
 
-    TRUE("有效"),
+    TRUE("已删除"),
 
-    FALSE("已删除");
+    FALSE("有效");
 
     VideoTypeEnum(String title) {
         this.title = title;

+ 1 - 1
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -301,7 +301,7 @@
                 tbo.id = tee.org_id
         <where> 1 = 1
             <if test="orgCode != null and orgCode !=''">
-                and tbo.code = #{orgCode}
+                and tbo.code like concat('%', #{orgCode}, '%')
             </if>
             <if test="orgName != null and orgName !=''">
                 and tbo.name like concat('%', #{orgName}, '%')