wangliang hace 4 años
padre
commit
b814a6fb7b

+ 4 - 0
themis-business/src/main/java/com/qmth/themis/business/cache/ExamRecordCacheUtil.java

@@ -6,6 +6,7 @@ import com.qmth.themis.business.cache.bean.ExamCacheBean;
 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 java.util.Objects;
@@ -686,5 +687,8 @@ public class ExamRecordCacheUtil {
         ExamRecordCacheUtil.setInProcessFaceStrangerIgnore(recordId, examCache.getInProcessFaceStrangerIgnore());
         ExamRecordCacheUtil.setInProcessLivenessJudgePolicy(recordId, examCache.getInProcessLivenessJudgePolicy().name());
         ExamRecordCacheUtil.setInProcessLivenessFixedRange(recordId, examCache.getInProcessLivenessFixedRange());
+        ExamRecordCacheUtil.setMonitorVideoSource(recordId, examCache.getMonitorVideoSource());
+        TOeExamRecordService tOeExamRecordService = SpringContextHolder.getBean(TOeExamRecordService.class);
+        tOeExamRecordService.sendExamRecordDataSaveMq(recordId, System.currentTimeMillis());
     }
 }

+ 10 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEExamActivityDto.java

@@ -242,6 +242,16 @@ public class TEExamActivityDto implements Serializable {
                     this.hardwareTest.add(HardwareTestEnum.AUDIOPLAY.name());
                 }
             }
+        } else if ((Objects.nonNull(this.getEntryAuthenticationPolicy()) && (
+                Objects.equals(this.getEntryAuthenticationPolicy(),
+                        EntryAuthenticationPolicyEnum.LIVENESS_VERIFY.name()) || Objects
+                        .equals(this.getEntryAuthenticationPolicy(),
+                                EntryAuthenticationPolicyEnum.FACE_VERIFY_FORCE.name()))) || (
+                Objects.nonNull(this.getCameraPhotoUpload()) && this.getCameraPhotoUpload() == 1)) {
+            if (Objects.isNull(this.hardwareTest)) {
+                this.hardwareTest = new ArrayList<>();
+            }
+            this.hardwareTest.add(HardwareTestEnum.CAMERA.name());
         } else {
             this.setMonitorVideoSource(null);
         }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamActivityServiceImpl.java

@@ -216,6 +216,17 @@ public class TEExamActivityServiceImpl extends ServiceImpl<TEExamActivityMapper,
                 }
                 teExamActivityDto.setHardwareTest(hardwareTest);
             }
+        } else if ((Objects.nonNull(teExamActivityDto.getEntryAuthenticationPolicy()) && (
+                Objects.equals(teExamActivityDto.getEntryAuthenticationPolicy(),
+                        EntryAuthenticationPolicyEnum.LIVENESS_VERIFY.name()) || Objects
+                        .equals(teExamActivityDto.getEntryAuthenticationPolicy(),
+                                EntryAuthenticationPolicyEnum.FACE_VERIFY_FORCE.name()))) || (
+                Objects.nonNull(teExamActivityDto.getCameraPhotoUpload()) && teExamActivityDto.getCameraPhotoUpload() == 1)) {
+            List<String> hardwareTest = teExamActivityDto.getHardwareTest();
+            if (Objects.isNull(hardwareTest)) {
+                hardwareTest = new ArrayList<>();
+            }
+            hardwareTest.add(HardwareTestEnum.CAMERA.name());
         } else {
             teExamActivityDto.setMonitorVideoSource(null);
         }

+ 12 - 4
themis-exam/src/main/java/com/qmth/themis/exam/listener/service/impl/MqOeLogicServiceImpl.java

@@ -27,10 +27,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
@@ -227,6 +224,17 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
                             }
                             break;
                         case "OE_WEBSOCKET_MOBILE_MONITOR_STATUS":
+                            String monitorVideoSource = ExamRecordCacheUtil.getMonitorVideoSource(recordId);
+                            List<String> monitorVideoSourceList = null;
+                            if (Objects.nonNull(monitorVideoSource) && !Objects.equals(monitorVideoSource.trim().replaceAll(" ", ""), "")) {
+                                monitorVideoSourceList = Arrays.asList(monitorVideoSource.trim().toUpperCase().replaceAll(" ", "").split(","));
+                            }
+                            if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.size() > 0 && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())) {
+                                prop.put(MonitorVideoSourceEnum.MOBILE_FIRST.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.MOBILE_FIRST));
+                            }
+                            if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.size() > 0 && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name())) {
+                                prop.put(MonitorVideoSourceEnum.MOBILE_SECOND.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(recordId, MonitorVideoSourceEnum.MOBILE_SECOND));
+                            }
                             websocketDto = new WebsocketDto(WebsocketTypeEnum.MOBILE_MONITOR_STATUS.name(), prop);
                             break;
                         default:

+ 2 - 2
themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketOeServer.java

@@ -108,8 +108,8 @@ public class WebSocketOeServer implements Concurrently {
         MqDtoService mqDtoService = SpringContextHolder.getBean(MqDtoService.class);
         Map mqMap = new HashMap<>();
         mqMap.put(SystemConstant.RECORD_ID, this.recordId);
-        mqMap.put(MonitorVideoSourceEnum.MOBILE_FIRST.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(this.recordId, MonitorVideoSourceEnum.MOBILE_FIRST));
-        mqMap.put(MonitorVideoSourceEnum.MOBILE_SECOND.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(this.recordId, MonitorVideoSourceEnum.MOBILE_SECOND));
+//        mqMap.put(MonitorVideoSourceEnum.MOBILE_FIRST.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(this.recordId, MonitorVideoSourceEnum.MOBILE_FIRST));
+//        mqMap.put(MonitorVideoSourceEnum.MOBILE_SECOND.name().toLowerCase(), ExamRecordCacheUtil.getMonitorStatus(this.recordId, MonitorVideoSourceEnum.MOBILE_SECOND));
         MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.OE_WEBSOCKET_MOBILE_MONITOR_STATUS.name(), recordId, MqTagEnum.OE_WEBSOCKET_MOBILE_MONITOR_STATUS, String.valueOf(recordId), mqMap, String.valueOf(recordId));
         mqDtoService.assembleSendOneOrderMsg(mqDto);
     }