|
@@ -1,10 +1,16 @@
|
|
|
package com.qmth.themis.business.cache;
|
|
|
|
|
|
+import com.qmth.themis.business.bean.status.ClientWebsocketStatusBean;
|
|
|
+import com.qmth.themis.business.bean.status.ExamStatusBean;
|
|
|
+import com.qmth.themis.business.bean.status.MonitorCallStatusBean;
|
|
|
+import com.qmth.themis.business.bean.status.MonitorStatusBean;
|
|
|
import com.qmth.themis.business.constant.SpringContextHolder;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.enums.*;
|
|
|
import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
+import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.themis.common.exception.BusinessException;
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
@@ -16,8 +22,6 @@ import java.util.Objects;
|
|
|
* @Date: 2020-07-29
|
|
|
*/
|
|
|
public class ExamRecordCacheUtil {
|
|
|
-
|
|
|
- private static TOeExamRecordService examRecordService = SpringContextHolder.getBean(TOeExamRecordService.class);
|
|
|
private static RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
|
|
|
|
public static Long getId(Long recordId) {
|
|
@@ -32,24 +36,50 @@ public class ExamRecordCacheUtil {
|
|
|
return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.paper_id.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setFirstStartTime(Long recordId, Long date, boolean update) {
|
|
|
+ public static void setFirstStartTime(Long recordId, Long date) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.first_start_time.getCode(), date);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.first_start_time.name(), date);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setStatus(Long recordId, ExamRecordStatusEnum status, boolean update) {
|
|
|
- redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode(), status);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.status.name(), status);
|
|
|
- }
|
|
|
+ public static void setFirstPrepareTime(Long recordId, Long date) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.first_prepare_time.getCode(), date);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setLastPrepareTime(Long recordId, Long date) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_prepare_time.getCode(), date);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setStatus(Long recordId, ExamRecordStatusEnum status, Long timestamp) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode(), new ExamStatusBean(status, timestamp));
|
|
|
}
|
|
|
|
|
|
public static Long getFirstStartTime(Long recordId) {
|
|
|
return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.first_start_time.getCode());
|
|
|
}
|
|
|
|
|
|
+ public static Long getFirstPrepareTime(Long recordId) {
|
|
|
+ return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.first_prepare_time.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Long getLastPrepareTime(Long recordId) {
|
|
|
+ return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_prepare_time.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String getClientCurrentIp(Long recordId) {
|
|
|
+ return (String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_current_ip.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Double getAnswerProgress(Long recordId) {
|
|
|
+ return (Double) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.answer_progress.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static ReviewResultEnum getReviewResult(Long recordId) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.review_result.getCode())) ? ReviewResultEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.review_result.getCode())) : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static ScoreStatusEnum getScoreStatus(Long recordId) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.score_status.getCode())) ? ScoreStatusEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.score_status.getCode())) : null;
|
|
|
+ }
|
|
|
+
|
|
|
public static Integer getDurationSeconds(Long recordId) {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.duration_seconds.getCode());
|
|
|
}
|
|
@@ -62,36 +92,64 @@ public class ExamRecordCacheUtil {
|
|
|
return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.exam_id.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setObjectiveScore(Long recordId, Double objectiveScore, boolean update) {
|
|
|
+ public static String getPaperStructPath(Long recordId) {
|
|
|
+ return (String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.paper_struct_path.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Integer getPaperStructUpload(Long recordId) {
|
|
|
+ return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.paper_struct_upload.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Integer getSerialNumber(Long recordId) {
|
|
|
+ return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.serial_number.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static VerifyExceptionEnum getEntryAuthenticationResult(Long recordId) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_result.getCode())) ? VerifyExceptionEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_result.getCode())) : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setReviewResult(Long recordId, ReviewResultEnum reviewResultEnum) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.review_result.getCode(), reviewResultEnum);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setScoreStatus(Long recordId, ScoreStatusEnum scoreStatusEnum) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.score_status.getCode(), scoreStatusEnum);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setPaperStructPath(Long recordId, String paperStructPath) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.paper_struct_path.getCode(), paperStructPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setPaperStructUpload(Long recordId, Integer paperStructUpload) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.paper_struct_upload.getCode(), paperStructUpload);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setSerialNumber(Long recordId, Integer serialNumber) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.serial_number.getCode(), serialNumber);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setEntryAuthenticationResult(Long recordId, VerifyExceptionEnum entryAuthenticationResult) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_result.getCode(), entryAuthenticationResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setObjectiveScore(Long recordId, Double objectiveScore) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.objective_score.getCode(), objectiveScore);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.objective_score.name(), objectiveScore);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setFinishTime(Long recordId, Long finishTime, boolean update) {
|
|
|
+ public static void setFinishTime(Long recordId, Long finishTime) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.finish_time.getCode(), finishTime);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.finish_time.name(), finishTime);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Long getFinishTime(Long recordId) {
|
|
|
return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.finish_time.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setDurationSeconds(Long recordId, Integer durationSeconds, boolean update) {
|
|
|
+ public static void setDurationSeconds(Long recordId, Integer durationSeconds) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.duration_seconds.getCode(), durationSeconds);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.duration_seconds.name(), durationSeconds);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setFinishType(Long recordId, FinishTypeEnum finishType, boolean update) {
|
|
|
+ public static void setFinishType(Long recordId, FinishTypeEnum finishType) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.finish_type.getCode(), finishType);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.finish_type.name(), finishType);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static FinishTypeEnum getFinishType(Long recordId) {
|
|
@@ -106,15 +164,20 @@ public class ExamRecordCacheUtil {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.already_break_count.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setAlreadyBreakCount(Long recordId, Integer alreadyBreakCount, boolean update) {
|
|
|
+ public static void setAlreadyBreakCount(Long recordId, Integer alreadyBreakCount) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.already_break_count.getCode(), alreadyBreakCount);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.already_break_count.name(), alreadyBreakCount);
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static ExamStatusBean getStatusBean(Long recordId) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode())) ? (ExamStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode()) : null;
|
|
|
}
|
|
|
|
|
|
public static ExamRecordStatusEnum getStatus(Long recordId) {
|
|
|
- return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode())) ? ExamRecordStatusEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode())) : null;
|
|
|
+ ExamStatusBean examStatusBean = getStatusBean(recordId);
|
|
|
+ if (Objects.isNull(examStatusBean) || Objects.isNull(examStatusBean.getExamRecordStatusEnum())) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.EXAM_STATUS_NOT_NULL);
|
|
|
+ }
|
|
|
+ return examStatusBean.getExamRecordStatusEnum();
|
|
|
}
|
|
|
|
|
|
public static Long getLastBreakId(Long recordId) {
|
|
@@ -125,159 +188,134 @@ public class ExamRecordCacheUtil {
|
|
|
return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_break_time.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setEntryAuthenticationResult(Long recordId, VerifyExceptionEnum entryAuthenticationResult, boolean update) {
|
|
|
- redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_result.getCode(), entryAuthenticationResult);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.entry_authentication_result.name(), entryAuthenticationResult);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static void setEntryAuthenticationId(Long recordId, Long entryAuthenticationId, boolean update) {
|
|
|
+ public static void setEntryAuthenticationId(Long recordId, Long entryAuthenticationId) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_id.getCode(), entryAuthenticationId);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.entry_authentication_id.name(), entryAuthenticationId);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Long getExamActivityId(Long recordId) {
|
|
|
return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.exam_activity_id.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setWarningCount(Long recordId, Integer warningCount, boolean update) {
|
|
|
+ public static void setWarningCount(Long recordId, Integer warningCount) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_count.getCode(), warningCount);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.warning_count.name(), warningCount);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Integer getWarningCount(Long recordId) {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_count.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setBreachStatus(Long recordId, Integer breachStatus, boolean update) {
|
|
|
+ public static void setBreachStatus(Long recordId, Integer breachStatus) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.breach_status.getCode(), breachStatus);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.breach_status.name(), breachStatus);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Integer getBreachStatus(Long recordId) {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.breach_status.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessLivenessVerifyCount(Long recordId, Integer inProcessLivenessVerifyCount, boolean update) {
|
|
|
+ public static void setInProcessLivenessVerifyCount(Long recordId, Integer inProcessLivenessVerifyCount) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_verify_count.getCode(), inProcessLivenessVerifyCount);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_liveness_verify_count.name(), inProcessLivenessVerifyCount);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Integer getInProcessLivenessVerifyCount(Long recordId) {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_verify_count.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setMonitorKey(Long recordId, String monitorKey, boolean update) {
|
|
|
+ public static void setMonitorKey(Long recordId, String monitorKey) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.monitor_key.getCode(), monitorKey);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.monitor_key.name(), monitorKey);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static String getMonitorKey(Long recordId) {
|
|
|
if (Objects.isNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.monitor_key.getCode()))) {
|
|
|
- setMonitorKey(recordId, String.valueOf(redisUtil.getRedisSequence()), true);
|
|
|
+ setMonitorKey(recordId, String.valueOf(redisUtil.getRedisSequence()));
|
|
|
}
|
|
|
return (String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.monitor_key.getCode());
|
|
|
}
|
|
|
|
|
|
public static MonitorStatusSourceEnum getMonitorStatus(Long recordId, MonitorVideoSourceEnum source) {
|
|
|
- return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name())) ? MonitorStatusSourceEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name())) : null;
|
|
|
+ MonitorStatusBean monitorStatusBean = getMonitorStatusBean(recordId, source);
|
|
|
+ if (Objects.isNull(monitorStatusBean)) {
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ return monitorStatusBean.getMonitorStatusSourceEnum();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- public static void setMonitorStatus(Long recordId, MonitorVideoSourceEnum source, MonitorStatusSourceEnum statusSourceEnum, boolean update) {
|
|
|
- redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name(), statusSourceEnum);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.monitor_status_source.name(), statusSourceEnum);
|
|
|
- }
|
|
|
+ public static MonitorStatusBean getMonitorStatusBean(Long recordId, MonitorVideoSourceEnum source) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name())) ? (MonitorStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name()) : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setMonitorStatus(Long recordId, MonitorVideoSourceEnum source, MonitorStatusSourceEnum statusSourceEnum, Long timestamp) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name(), new MonitorStatusBean(statusSourceEnum, timestamp));
|
|
|
}
|
|
|
|
|
|
public static MonitorCallStatusSourceEnum getMonitorCallStatus(Long recordId, MonitorVideoSourceEnum source) {
|
|
|
- return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name())) ? MonitorCallStatusSourceEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name())) : null;
|
|
|
+ MonitorCallStatusBean monitorCallStatusBean = getMonitorCallStatusBean(recordId, source);
|
|
|
+ if (Objects.isNull(monitorCallStatusBean)) {
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ return monitorCallStatusBean.getMonitorCallStatusSourceEnum();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static MonitorCallStatusBean getMonitorCallStatusBean(Long recordId, MonitorVideoSourceEnum source) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name())) ? (MonitorCallStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name()) : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setMonitorCallStatus(Long recordId, MonitorVideoSourceEnum source, MonitorCallStatusSourceEnum callStatusSourceEnum, Long timestamp) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name(), new MonitorCallStatusBean(callStatusSourceEnum, timestamp));
|
|
|
}
|
|
|
|
|
|
- public static void setMonitorCallStatus(Long recordId, MonitorVideoSourceEnum source, MonitorCallStatusSourceEnum callStatusSourceEnum) {
|
|
|
- redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name(), callStatusSourceEnum);
|
|
|
+ public static ClientWebsocketStatusBean getClientWebsocketStatusBean(Long recordId) {
|
|
|
+ return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode())) ? (ClientWebsocketStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode()) : null;
|
|
|
}
|
|
|
|
|
|
public static WebsocketStatusEnum getClientWebsocketStatus(Long recordId) {
|
|
|
- return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode())) ? WebsocketStatusEnum.valueOf((String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode())) : null;
|
|
|
+ ClientWebsocketStatusBean clientWebsocketStatusBean = getClientWebsocketStatusBean(recordId);
|
|
|
+ if (Objects.isNull(clientWebsocketStatusBean)) {
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ return clientWebsocketStatusBean.getWebsocketStatusEnum();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static String getClientWebsocketId(Long recordId) {
|
|
|
return (String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_id.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setClientWebsocketStatus(Long recordId, WebsocketStatusEnum websocketStatusEnum, boolean update) {
|
|
|
- redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode(), websocketStatusEnum);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.client_websocket_status.name(), websocketStatusEnum);
|
|
|
- }
|
|
|
+ public static void setClientWebsocketStatus(Long recordId, WebsocketStatusEnum websocketStatusEnum, Long timestamp) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode(), new ClientWebsocketStatusBean(websocketStatusEnum, timestamp));
|
|
|
}
|
|
|
|
|
|
- public static void setClientCurrentIp(Long recordId, String ip, boolean update) {
|
|
|
+ public static void setClientCurrentIp(Long recordId, String ip) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_current_ip.getCode(), ip);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.client_current_ip.name(), ip);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setClientWebsocketId(Long recordId, String id, boolean update) {
|
|
|
+ public static void setClientWebsocketId(Long recordId, String id) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_id.getCode(), id);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.client_websocket_id.name(), id);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setClientLastSyncTime(Long recordId, Long date, boolean update) {
|
|
|
+ public static void setClientLastSyncTime(Long recordId, Long date) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_last_sync_time.getCode(), date);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.client_last_sync_time.name(), date);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setPaperDownload(Long recordId, Integer paperDownload, boolean update) {
|
|
|
+ public static void setPaperDownload(Long recordId, Integer paperDownload) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.paper_download.getCode(), paperDownload);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.paper_download.name(), paperDownload);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setAnswerProgress(Long recordId, Double progress, boolean update) {
|
|
|
+ public static void setAnswerProgress(Long recordId, Double progress) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.answer_progress.getCode(), progress);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.answer_progress.name(), progress);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setLastBreakId(Long recordId, Long breakId, boolean update) {
|
|
|
+ public static void setLastBreakId(Long recordId, Long breakId) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_break_id.getCode(), breakId);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.last_break_id.name(), breakId);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setLastBreakTime(Long recordId, Long date, boolean update) {
|
|
|
+ public static void setLastBreakTime(Long recordId, Long date) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_break_time.getCode(), date);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.last_break_time.name(), date);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setLastStartTime(Long recordId, Long date, boolean update) {
|
|
|
+ public static void setLastStartTime(Long recordId, Long date) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_start_time.getCode(), date);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.last_start_time.name(), date);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Long getLastStartTime(Long recordId) {
|
|
@@ -312,53 +350,32 @@ public class ExamRecordCacheUtil {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.force_finish.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setStartTime(Long recordId, Long startTime, boolean update) {
|
|
|
+ public static void setStartTime(Long recordId, Long startTime) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.start_time.getCode(), startTime);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.start_time.name(), startTime);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setEndTime(Long recordId, Long endTime, boolean update) {
|
|
|
+ public static void setEndTime(Long recordId, Long endTime) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.end_time.getCode(), endTime);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.end_time.name(), endTime);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setOpeningSeconds(Long recordId, Integer openingSeconds, boolean update) {
|
|
|
+ public static void setOpeningSeconds(Long recordId, Integer openingSeconds) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.opening_seconds.getCode(), openingSeconds);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.opening_seconds.name(), openingSeconds);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setMinDurationSeconds(Long recordId, Integer minDurationSeconds, boolean update) {
|
|
|
+ public static void setMinDurationSeconds(Long recordId, Integer minDurationSeconds) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.min_duration_seconds.getCode(), minDurationSeconds);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.min_duration_seconds.name(), minDurationSeconds);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setMaxDurationSeconds(Long recordId, Integer maxDurationSeconds, boolean update) {
|
|
|
+ public static void setMaxDurationSeconds(Long recordId, Integer maxDurationSeconds) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.max_duration_seconds.getCode(), maxDurationSeconds);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.max_duration_seconds.name(), maxDurationSeconds);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setForceFinish(Long recordId, Integer forceFinish, boolean update) {
|
|
|
+ public static void setForceFinish(Long recordId, Integer forceFinish) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.force_finish.getCode(), forceFinish);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.force_finish.name(), forceFinish);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setLastPrepareTime(Long recordId, Long date, boolean update) {
|
|
|
- redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.last_prepare_time.getCode(), date);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.last_prepare_time.name(), date);
|
|
|
- }
|
|
|
+ public static void setLastPrepareTime(Long recordId, ScoreStatusEnum scoreStatusEnum) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.score_status.getCode(), scoreStatusEnum);
|
|
|
}
|
|
|
|
|
|
public static void setExamFinalFinishTime(Long recordId, Long date) {
|
|
@@ -453,74 +470,44 @@ public class ExamRecordCacheUtil {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.has_answer_file.getCode());
|
|
|
}
|
|
|
|
|
|
- public static void setCameraPhotoUpload(Long recordId, Integer cameraPhotoUpload, boolean update) {
|
|
|
+ public static void setCameraPhotoUpload(Long recordId, Integer cameraPhotoUpload) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.camera_photo_upload.getCode(), cameraPhotoUpload);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.camera_photo_upload.name(), cameraPhotoUpload);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setMobilePhotoUpload(Long recordId, Integer mobilePhotoUpload, boolean update) {
|
|
|
+ public static void setMobilePhotoUpload(Long recordId, Integer mobilePhotoUpload) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.mobile_photo_upload.getCode(), mobilePhotoUpload);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.mobile_photo_upload.name(), mobilePhotoUpload);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setEntryAuthenticationPolicy(Long recordId, String entryAuthenticationPolicy, boolean update) {
|
|
|
+ public static void setEntryAuthenticationPolicy(Long recordId, String entryAuthenticationPolicy) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_policy.getCode(), entryAuthenticationPolicy);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.entry_authentication_policy.name(), entryAuthenticationPolicy);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessFaceStrangerIgnore(Long recordId, Integer inProcessFaceStrangerIgnore, boolean update) {
|
|
|
+ public static void setInProcessFaceStrangerIgnore(Long recordId, Integer inProcessFaceStrangerIgnore) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_face_stranger_ignore.getCode(), inProcessFaceStrangerIgnore);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_face_stranger_ignore.name(), inProcessFaceStrangerIgnore);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessLivenessFixedRange(Long recordId, String inProcessLivenessFixedRange, boolean update) {
|
|
|
+ public static void setInProcessLivenessFixedRange(Long recordId, String inProcessLivenessFixedRange) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_fixed_range.getCode(), inProcessLivenessFixedRange);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_liveness_fixed_range.name(), inProcessLivenessFixedRange);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessLivenessJudgePolicy(Long recordId, String inProcessLivenessJudgePolicy, boolean update) {
|
|
|
+ public static void setInProcessLivenessJudgePolicy(Long recordId, String inProcessLivenessJudgePolicy) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_judge_policy.getCode(), inProcessLivenessJudgePolicy);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_liveness_judge_policy.name(), inProcessLivenessJudgePolicy);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setMonitorVideoSource(Long recordId, String monitorVideoSource, boolean update) {
|
|
|
+ public static void setMonitorVideoSource(Long recordId, String monitorVideoSource) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.monitor_video_source.getCode(), monitorVideoSource);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.monitor_video_source.name(), monitorVideoSource);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessRealnessVerifyStatus(Long recordId, Integer inProcessRealnessVerifyStatus, boolean update) {
|
|
|
+ public static void setInProcessRealnessVerifyStatus(Long recordId, Integer inProcessRealnessVerifyStatus) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_realness_verify_status.getCode(), inProcessRealnessVerifyStatus);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_realness_verify_status.name(), inProcessRealnessVerifyStatus);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessLivenessVerifyStatus(Long recordId, Integer inProcessLivenessVerifyStatus, boolean update) {
|
|
|
+ public static void setInProcessLivenessVerifyStatus(Long recordId, Integer inProcessLivenessVerifyStatus) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_verify_status.getCode(), inProcessLivenessVerifyStatus);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_liveness_verify_status.name(), inProcessLivenessVerifyStatus);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- public static void setInProcessFaceVerifyStatus(Long recordId, Integer inProcessFaceVerifyStatus, boolean update) {
|
|
|
+ public static void setInProcessFaceVerifyStatus(Long recordId, Integer inProcessFaceVerifyStatus) {
|
|
|
redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_face_verify_status.getCode(), inProcessFaceVerifyStatus);
|
|
|
- if (update) {
|
|
|
- examRecordService.dataUpdateMq(recordId, ExamRecordFieldEnum.in_process_face_verify_status.name(), inProcessFaceVerifyStatus);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static Integer getCameraPhotoUpload(Long recordId) {
|
|
@@ -531,6 +518,10 @@ public class ExamRecordCacheUtil {
|
|
|
return (Integer) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.mobile_photo_upload.getCode());
|
|
|
}
|
|
|
|
|
|
+ public static Long getEntryAuthenticationId(Long recordId) {
|
|
|
+ return (Long) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_id.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
public static String getEntryAuthenticationPolicy(Long recordId) {
|
|
|
return (String) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.entry_authentication_policy.getCode());
|
|
|
}
|