|
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonProperty;
|
|
|
import com.qmth.themis.business.bean.admin.CountStopBean;
|
|
|
+import com.qmth.themis.business.cache.ExamingDataCacheUtil;
|
|
|
+import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
|
import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
@@ -735,4 +737,34 @@ public class TEExamController {
|
|
|
}
|
|
|
return ResultUtil.ok(true);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "清除考试缓存")
|
|
|
+ @RequestMapping(value = "/clean_exam_first_prepare_cache", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "考试信息")})
|
|
|
+ public Result cleanExamFirstPrepareCache(@ApiParam(value = "考试批次ids") @RequestParam(required = false) Set<Long> examIds) {
|
|
|
+ if (!CollectionUtils.isEmpty(examIds)) {
|
|
|
+ List<Map> list = tOeExamRecordService.cleanExamFirstPrepareCache(examIds);
|
|
|
+ if (!CollectionUtils.isEmpty(list)) {
|
|
|
+ Set<Long> examRecordIds = new HashSet<>();
|
|
|
+ for (Map map : list) {
|
|
|
+ try {
|
|
|
+ Long recordId = Long.parseLong(String.valueOf(map.get("examRecordId")));
|
|
|
+ Long studentId = Long.parseLong(String.valueOf(map.get("studentId")));
|
|
|
+ examRecordIds.add(recordId);
|
|
|
+ ExamingDataCacheUtil.deleteUnFinishedRecordId(studentId);
|
|
|
+ ExamingDataCacheUtil.deleteExamingRecordId(studentId);
|
|
|
+ redisUtil.delete(RedisKeyHelper.examRecordCacheKey(recordId));
|
|
|
+ redisUtil.delete(RedisKeyHelper.examAnswerKey(recordId));
|
|
|
+ redisUtil.delete(RedisKeyHelper.audioLeftPlayCountKey(recordId));
|
|
|
+ redisUtil.delete(RedisKeyHelper.livenessVerifyCacheKey(recordId));
|
|
|
+ redisUtil.delete(RedisKeyHelper.faceVerifyCacheKey(recordId));
|
|
|
+ redisUtil.delete(RedisKeyHelper.studentPaperStructKey(recordId));
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tOeExamRecordService.removeByIds(examRecordIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultUtil.ok(true);
|
|
|
+ }
|
|
|
}
|