|
@@ -14,6 +14,8 @@ import com.qmth.themis.business.cache.bean.LivenessVerifyCacheBean;
|
|
|
import com.qmth.themis.business.dao.TOeLivenessVerifyHistoryMapper;
|
|
|
import com.qmth.themis.business.entity.TOeLivenessVerifyHistory;
|
|
|
import com.qmth.themis.business.enums.LivenessTypeEnum;
|
|
|
+import com.qmth.themis.business.enums.VerifyExceptionEnum;
|
|
|
+import com.qmth.themis.business.service.TOeExamBreakHistoryService;
|
|
|
import com.qmth.themis.business.service.TOeLivenessVerifyHistoryService;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
import com.qmth.themis.common.contanst.Constants;
|
|
@@ -31,9 +33,13 @@ public class TOeLivenessVerifyHistoryServiceImpl extends ServiceImpl<TOeLiveness
|
|
|
@Resource
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TOeExamBreakHistoryService examBreakHistoryService;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public LivenessVerifyBean verify(Long recordId, String type, String actions, Integer retry, Long startTime,
|
|
|
- Long finishTime, Boolean pass) {
|
|
|
+ Long finishTime, String exception) {
|
|
|
LivenessVerifyCacheBean cache=new LivenessVerifyCacheBean();
|
|
|
cache.setId(Constants.idGen.next());
|
|
|
cache.setExamRecordId(recordId);
|
|
@@ -42,11 +48,14 @@ public class TOeLivenessVerifyHistoryServiceImpl extends ServiceImpl<TOeLiveness
|
|
|
cache.setRetry(retry);
|
|
|
cache.setStartTime(new Date(startTime));
|
|
|
cache.setFinishTime(new Date(finishTime));
|
|
|
- cache.setPass((pass?1:0));
|
|
|
+ cache.setException(VerifyExceptionEnum.valueOf(exception));
|
|
|
redisUtil.set(RedisKeyHelper.livenessVerifyCacheKey(cache.getId()), cache);
|
|
|
LivenessVerifyBean ret=new LivenessVerifyBean();
|
|
|
ret.setId(cache.getId());
|
|
|
ret.setUpdateTime(new Date().getTime());
|
|
|
+ if(LivenessTypeEnum.RESUME_START.equals(cache.getType())) {
|
|
|
+ examBreakHistoryService.saveAuthenticationResult(recordId, cache.getId(), cache.getException());
|
|
|
+ }
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -54,7 +63,7 @@ public class TOeLivenessVerifyHistoryServiceImpl extends ServiceImpl<TOeLiveness
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public void save(Long id,Long recordId, String type, String actions, Integer retry, Long startTime,
|
|
|
- Long finishTime, Boolean pass) {
|
|
|
+ Long finishTime, String exception) {
|
|
|
TOeLivenessVerifyHistory entity=new TOeLivenessVerifyHistory();
|
|
|
entity.setId(id);
|
|
|
entity.setExamRecordId(recordId);
|
|
@@ -63,7 +72,9 @@ public class TOeLivenessVerifyHistoryServiceImpl extends ServiceImpl<TOeLiveness
|
|
|
entity.setRetry(retry);
|
|
|
entity.setStartTime(new Date(startTime));
|
|
|
entity.setFinishTime(new Date(finishTime));
|
|
|
+ entity.setException(VerifyExceptionEnum.valueOf(exception));
|
|
|
saveOrUpdate(entity);
|
|
|
}
|
|
|
+
|
|
|
|
|
|
}
|