wangliang 4 vuotta sitten
vanhempi
commit
b325290ad4

+ 8 - 2
themis-business/src/main/java/com/qmth/themis/business/dto/request/TEExamDto.java

@@ -215,7 +215,11 @@ public class TEExamDto extends BaseEntity {
                 Long l = Long.valueOf(longs[i].trim().replaceAll(" ", ""));
                 inProcessLivenessFixedRange.add(l);
             }
-            setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
+            if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ",""), "")) {
+                setInProcessLivenessFixedRange(null);
+            } else {
+                setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
+            }
         }
         this.inProcessLivenessJudgePolicy = teExam.getInProcessLivenessJudgePolicy();
         this.recordSelectStrategy = teExam.getRecordSelectStrategy();
@@ -223,8 +227,10 @@ public class TEExamDto extends BaseEntity {
         this.ipAllow = teExam.getIpAllow();
         this.scoreStatus = teExam.getScoreStatus();
         this.objectiveScorePolicy = teExam.getObjectiveScorePolicy();
-        if (Objects.nonNull(teExam.getMonitorVideoSource())) {
+        if (Objects.nonNull(teExam.getMonitorVideoSource()) && !Objects.equals(teExam.getMonitorVideoSource().trim().replaceAll(" ", ""), "")) {
             setMonitorVideoSource(Arrays.asList(teExam.getMonitorVideoSource().trim().replaceAll(" ", "").split(",")));
+        } else {
+            setMonitorVideoSource(null);
         }
         this.monitorRecord = teExam.getMonitorRecord();
         this.progress = teExam.getProgress();

+ 8 - 4
themis-business/src/main/java/com/qmth/themis/business/entity/TEExam.java

@@ -212,8 +212,10 @@ public class TEExam extends BaseEntity {
         this.inProcessFaceVerify = teExamDto.getInProcessFaceVerify();
         this.inProcessFaceStrangerIgnore = teExamDto.getInProcessFaceStrangerIgnore();
         this.inProcessLivenessVerify = teExamDto.getInProcessLivenessVerify();
-        if (Objects.nonNull(teExamDto.getInProcessLivenessFixedRange())) {
-            this.inProcessLivenessFixedRange = teExamDto.getInProcessLivenessFixedRange().toString().trim().replace("[", "").replace("]", "").replaceAll(" ","");
+        if (Objects.nonNull(teExamDto.getInProcessLivenessFixedRange()) && !Objects.equals(teExamDto.getInProcessLivenessFixedRange(), "")) {
+            this.inProcessLivenessFixedRange = teExamDto.getInProcessLivenessFixedRange().toString().trim().replace("[", "").replace("]", "").replaceAll(" ", "");
+        } else {
+            this.inProcessLivenessFixedRange = null;
         }
         this.inProcessLivenessJudgePolicy = teExamDto.getInProcessLivenessJudgePolicy();
         this.recordSelectStrategy = teExamDto.getRecordSelectStrategy();
@@ -221,8 +223,10 @@ public class TEExam extends BaseEntity {
         this.ipAllow = teExamDto.getIpAllow();
         this.scoreStatus = teExamDto.getScoreStatus();
         this.objectiveScorePolicy = teExamDto.getObjectiveScorePolicy();
-        if (Objects.nonNull(teExamDto.getMonitorVideoSource())) {
-            this.monitorVideoSource = teExamDto.getMonitorVideoSource().toString().trim().replace("[", "").replace("]", "").replaceAll(" ","");
+        if (Objects.nonNull(teExamDto.getMonitorVideoSource()) && !Objects.equals(teExamDto.getMonitorVideoSource(), "")) {
+            this.monitorVideoSource = teExamDto.getMonitorVideoSource().toString().trim().replace("[", "").replace("]", "").replaceAll(" ", "");
+        } else {
+            this.monitorVideoSource = null;
         }
         this.monitorRecord = teExamDto.getMonitorRecord();
         this.progress = teExamDto.getProgress();

+ 11 - 5
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -111,10 +111,16 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                             Long l = Long.valueOf(longs[i].trim());
                             inProcessLivenessFixedRange.add(l);
                         }
-                        v.setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
+                        if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ", ""), "")) {
+                            v.setInProcessLivenessFixedRange(null);
+                        } else {
+                            v.setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
+                        }
                     }
-                    if (Objects.nonNull(v.getMonitorVideoSourceStr())) {
+                    if (Objects.nonNull(v.getMonitorVideoSourceStr()) && !Objects.equals(v.getMonitorVideoSource().toString().trim().replaceAll(" ", ""), "")) {
                         v.setMonitorVideoSource(Arrays.asList(v.getMonitorVideoSourceStr().trim().split(",")));
+                    } else {
+                        v.setMonitorVideoSource(null);
                     }
                 });
                 s.setActivities(teExamActivityList);
@@ -636,9 +642,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             ret.setObjectiveScore(er.getObjectiveScore());
         } else {
             ret.setDurationSeconds(ExamRecordCacheUtil.getDurationSeconds(recordId));
-            Date finishTime=ExamRecordCacheUtil.getFinishTime(recordId);
-            
-            ret.setFinishTime(finishTime==null?null:finishTime.getTime());
+            Date finishTime = ExamRecordCacheUtil.getFinishTime(recordId);
+
+            ret.setFinishTime(finishTime == null ? null : finishTime.getTime());
             ret.setFinishType(ExamRecordCacheUtil.getFinishType(recordId));
             ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
         }