Browse Source

考试mobilePhotoUpload更改为考试科目mobilePhotoUpload

wangliang 2 years ago
parent
commit
ccdf641249

+ 5 - 2
themis-business/src/main/java/com/qmth/themis/business/cache/ExamRecordCacheUtil.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.cache;
 import com.qmth.themis.business.bean.status.*;
 import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
+import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
 import com.qmth.themis.business.constant.SpringContextHolder;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.enums.*;
@@ -1032,8 +1033,9 @@ public class ExamRecordCacheUtil {
      * @param recordId
      * @param examCache
      * @param ac
+     * @param examCourseCacheBean
      */
-    public static void updateExamRecordCache(Long recordId, ExamCacheBean examCache, ExamActivityCacheBean ac) {
+    public static void updateExamRecordCache(Long recordId, ExamCacheBean examCache, ExamActivityCacheBean ac, ExamCourseCacheBean examCourseCacheBean) {
         ExamRecordCacheUtil.setStartTime(recordId, ac.getStartTime());
         ExamRecordCacheUtil.setEndTime(recordId, ac.getFinishTime());
         ExamRecordCacheUtil.setOpeningSeconds(recordId, ac.getOpeningSeconds());
@@ -1041,7 +1043,8 @@ public class ExamRecordCacheUtil {
         ExamRecordCacheUtil.setMaxDurationSeconds(recordId, ac.getMaxDurationSeconds());
         ExamRecordCacheUtil.setForceFinish(recordId, examCache.getForceFinish());
         ExamRecordCacheUtil.setCameraPhotoUpload(recordId, examCache.getCameraPhotoUpload());
-        ExamRecordCacheUtil.setMobilePhotoUpload(recordId, examCache.getMobilePhotoUpload());
+//        ExamRecordCacheUtil.setMobilePhotoUpload(recordId, examCache.getMobilePhotoUpload());
+        ExamRecordCacheUtil.setMobilePhotoUpload(recordId, examCourseCacheBean.getMobilePhotoUpload());
         ExamRecordCacheUtil.setEntryAuthenticationPolicy(recordId, examCache.getEntryAuthenticationPolicy().name());
         ExamRecordCacheUtil.setInProcessRealnessVerifyStatus(recordId, examCache.getInProcessRealnessVerify());
         ExamRecordCacheUtil.setInProcessFaceStrangerIgnore(recordId, examCache.getInProcessFaceStrangerIgnore());

+ 7 - 7
themis-business/src/main/java/com/qmth/themis/business/cache/bean/ExamCacheBean.java

@@ -152,7 +152,7 @@ public class ExamCacheBean implements Serializable {
     private String monitorRecord;
 
     //是否允许使用移动端拍照答题,0:不开启,1:开启
-    private Integer mobilePhotoUpload;
+//    private Integer mobilePhotoUpload;
 
     //考试过程中活体检测间隔时间
     private String inProcessLivenessFixedRange;
@@ -248,13 +248,13 @@ public class ExamCacheBean implements Serializable {
         this.progress = progress;
     }
 
-    public Integer getMobilePhotoUpload() {
-        return mobilePhotoUpload;
-    }
+//    public Integer getMobilePhotoUpload() {
+//        return mobilePhotoUpload;
+//    }
 
-    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
-        this.mobilePhotoUpload = mobilePhotoUpload;
-    }
+//    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
+//        this.mobilePhotoUpload = mobilePhotoUpload;
+//    }
 
     public String getInProcessLivenessFixedRange() {
         return inProcessLivenessFixedRange;

+ 115 - 103
themis-business/src/main/java/com/qmth/themis/business/cache/bean/ExamCourseCacheBean.java

@@ -2,149 +2,161 @@ package com.qmth.themis.business.cache.bean;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 import java.util.List;
 
 public class ExamCourseCacheBean implements Serializable {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -9033695063460046875L;
+    /**
+     *
+     */
+    private static final long serialVersionUID = -9033695063460046875L;
 
-	// 主键
-	@JsonSerialize(using = ToStringSerializer.class)
-	private Long id;
+    // 主键
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
 
-	// 考试ID
-	@JsonSerialize(using = ToStringSerializer.class)
-	private Long examId;
+    // 考试ID
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long examId;
 
-	// 科目编码
-	private String courseCode;
+    // 科目编码
+    private String courseCode;
 
-	// 科目名称
-	private String courseName;
+    // 科目名称
+    private String courseName;
 
-	// 是否开启客观题乱序,0:不开启,1:开启
-	private Integer objectiveShuffle;
+    // 是否开启客观题乱序,0:不开启,1:开启
+    private Integer objectiveShuffle;
 
-	// 是否选项乱序,针对一个科目进行设置,0:不开启,1:开启
-	private Integer optionShuffle;
+    // 是否选项乱序,针对一个科目进行设置,0:不开启,1:开启
+    private Integer optionShuffle;
 
-	// 已绑定试卷数量
-	private Integer paperCount;
+    // 已绑定试卷数量
+    private Integer paperCount;
 
-	// 是否已补齐标答,0:否,1:是
-	private Integer hasAnswer;
+    // 是否已补齐标答,0:否,1:是
+    private Integer hasAnswer;
 
-	// 音频播放次数
-	private Integer audioPlayCount;
-	
-	// 题干包含音频,0:不包含,1:包含
-	private Integer hasAudio;
+    // 音频播放次数
+    private Integer audioPlayCount;
 
-	// 试卷id
-	private List<Long> paperIds;
+    // 题干包含音频,0:不包含,1:包含
+    private Integer hasAudio;
 
-	// 调卷比例
-	private List<Double> paperWeight;
+    // 试卷id
+    private List<Long> paperIds;
 
-	public Long getId() {
-		return id;
-	}
+    // 调卷比例
+    private List<Double> paperWeight;
 
-	public void setId(Long id) {
-		this.id = id;
-	}
+    @ApiModelProperty(value = "是否允许使用移动端拍照答题,0:不开启,1:开启")
+    private Integer mobilePhotoUpload = 0;
 
-	public Long getExamId() {
-		return examId;
-	}
+    public Integer getMobilePhotoUpload() {
+        return mobilePhotoUpload;
+    }
 
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
+    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
+        this.mobilePhotoUpload = mobilePhotoUpload;
+    }
 
-	public String getCourseCode() {
-		return courseCode;
-	}
+    public Long getId() {
+        return id;
+    }
 
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
-	}
+    public void setId(Long id) {
+        this.id = id;
+    }
 
-	public String getCourseName() {
-		return courseName;
-	}
+    public Long getExamId() {
+        return examId;
+    }
 
-	public void setCourseName(String courseName) {
-		this.courseName = courseName;
-	}
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
 
-	public Integer getObjectiveShuffle() {
-		return objectiveShuffle;
-	}
+    public String getCourseCode() {
+        return courseCode;
+    }
 
-	public void setObjectiveShuffle(Integer objectiveShuffle) {
-		this.objectiveShuffle = objectiveShuffle;
-	}
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
 
-	public Integer getOptionShuffle() {
-		return optionShuffle;
-	}
+    public String getCourseName() {
+        return courseName;
+    }
 
-	public void setOptionShuffle(Integer optionShuffle) {
-		this.optionShuffle = optionShuffle;
-	}
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
 
-	public Integer getPaperCount() {
-		return paperCount;
-	}
+    public Integer getObjectiveShuffle() {
+        return objectiveShuffle;
+    }
 
-	public void setPaperCount(Integer paperCount) {
-		this.paperCount = paperCount;
-	}
+    public void setObjectiveShuffle(Integer objectiveShuffle) {
+        this.objectiveShuffle = objectiveShuffle;
+    }
 
-	public Integer getHasAnswer() {
-		return hasAnswer;
-	}
+    public Integer getOptionShuffle() {
+        return optionShuffle;
+    }
 
-	public void setHasAnswer(Integer hasAnswer) {
-		this.hasAnswer = hasAnswer;
-	}
+    public void setOptionShuffle(Integer optionShuffle) {
+        this.optionShuffle = optionShuffle;
+    }
 
-	public Integer getAudioPlayCount() {
-		return audioPlayCount;
-	}
+    public Integer getPaperCount() {
+        return paperCount;
+    }
 
-	public void setAudioPlayCount(Integer audioPlayCount) {
-		this.audioPlayCount = audioPlayCount;
-	}
+    public void setPaperCount(Integer paperCount) {
+        this.paperCount = paperCount;
+    }
 
-	public List<Long> getPaperIds() {
-		return paperIds;
-	}
+    public Integer getHasAnswer() {
+        return hasAnswer;
+    }
 
-	public void setPaperIds(List<Long> paperIds) {
-		this.paperIds = paperIds;
-	}
+    public void setHasAnswer(Integer hasAnswer) {
+        this.hasAnswer = hasAnswer;
+    }
 
-	public List<Double> getPaperWeight() {
-		return paperWeight;
-	}
+    public Integer getAudioPlayCount() {
+        return audioPlayCount;
+    }
 
-	public void setPaperWeight(List<Double> paperWeight) {
-		this.paperWeight = paperWeight;
-	}
+    public void setAudioPlayCount(Integer audioPlayCount) {
+        this.audioPlayCount = audioPlayCount;
+    }
 
-	public Integer getHasAudio() {
-		return hasAudio;
-	}
+    public List<Long> getPaperIds() {
+        return paperIds;
+    }
 
-	public void setHasAudio(Integer hasAudio) {
-		this.hasAudio = hasAudio;
-	}
+    public void setPaperIds(List<Long> paperIds) {
+        this.paperIds = paperIds;
+    }
+
+    public List<Double> getPaperWeight() {
+        return paperWeight;
+    }
+
+    public void setPaperWeight(List<Double> paperWeight) {
+        this.paperWeight = paperWeight;
+    }
+
+    public Integer getHasAudio() {
+        return hasAudio;
+    }
+
+    public void setHasAudio(Integer hasAudio) {
+        this.hasAudio = hasAudio;
+    }
 
 }

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

@@ -180,9 +180,9 @@ public class TEExamDto extends BaseEntity {
     @TableField(value = "progress")
     private Double progress;
 
-    @ApiModelProperty(value = "是否允许使用移动端拍照答题,0:不开启,1:开启")
-    @TableField(value = "mobile_photo_upload")
-    private Integer mobilePhotoUpload;
+//    @ApiModelProperty(value = "是否允许使用移动端拍照答题,0:不开启,1:开启")
+//    @TableField(value = "mobile_photo_upload")
+//    private Integer mobilePhotoUpload;
 
     @ApiModelProperty(value = "监考人工审核,now:实时审核,later:事后审核")
     @TableField(value = "invigilate_verify")
@@ -221,7 +221,7 @@ public class TEExamDto extends BaseEntity {
         this.breakExpireSeconds = teExam.getBreakExpireSeconds();
         this.breakResumeCount = teExam.getBreakResumeCount();
         this.cameraPhotoUpload = teExam.getCameraPhotoUpload();
-        this.mobilePhotoUpload = teExam.getMobilePhotoUpload();
+//        this.mobilePhotoUpload = teExam.getMobilePhotoUpload();
         this.reexamAuditing = teExam.getReexamAuditing();
         this.showObjectiveScore = teExam.getShowObjectiveScore();
         this.mode = teExam.getMode();
@@ -306,13 +306,13 @@ public class TEExamDto extends BaseEntity {
         this.invigilateVerify = invigilateVerify;
     }
 
-    public Integer getMobilePhotoUpload() {
-        return mobilePhotoUpload;
-    }
-
-    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
-        this.mobilePhotoUpload = mobilePhotoUpload;
-    }
+//    public Integer getMobilePhotoUpload() {
+//        return mobilePhotoUpload;
+//    }
+//
+//    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
+//        this.mobilePhotoUpload = mobilePhotoUpload;
+//    }
 
     public Long getOrgId() {
         return orgId;

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

@@ -186,7 +186,7 @@ public class TEExamActivityDto implements Serializable {
             maxDurationSeconds = examActivityCacheBean.getMaxDurationSeconds();
             forceFinish = ec.getForceFinish();
             cameraPhotoUpload = ec.getCameraPhotoUpload();
-            mobilePhotoUpload = ec.getMobilePhotoUpload();
+            mobilePhotoUpload = examCourseCacheBean.getMobilePhotoUpload();
             entryAuthenticationPolicy = ec.getEntryAuthenticationPolicy().name();
             inProcessFaceStrangerIgnore = ec.getInProcessFaceStrangerIgnore();
             inProcessLivenessFixedRange = ec.getInProcessLivenessFixedRange();

File diff suppressed because it is too large
+ 11 - 11
themis-business/src/main/java/com/qmth/themis/business/entity/TEExam.java


+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/entity/TEExamCourse.java

@@ -57,6 +57,9 @@ public class TEExamCourse extends BaseEntity {
     @TableField(value = "has_audio")
     private Integer hasAudio;
 
+    @ApiModelProperty(value = "是否允许使用移动端拍照答题,0:不开启,1:开启")
+    private Integer mobilePhotoUpload = 0;
+
     public TEExamCourse() {
 
     }
@@ -144,4 +147,12 @@ public class TEExamCourse extends BaseEntity {
     public void setHasAudio(Integer hasAudio) {
         this.hasAudio = hasAudio;
     }
+
+    public Integer getMobilePhotoUpload() {
+        return mobilePhotoUpload;
+    }
+
+    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
+        this.mobilePhotoUpload = mobilePhotoUpload;
+    }
 }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -23,7 +23,7 @@ import java.util.Set;
  */
 public interface TOeExamRecordService extends IService<TOeExamRecord> {
 
-    Long saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId, Integer serialNumber, Long studentId);
+    Long saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId, Integer serialNumber, Long studentId, Integer mobilePhotoUpload);
 
     /**
      * 计算客观分

+ 1 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamCourseServiceImpl.java

@@ -123,6 +123,7 @@ public class TEExamCourseServiceImpl extends ServiceImpl<TEExamCourseMapper, TEE
         ret.setHasAnswer(ec.getHasAnswer());
         ret.setAudioPlayCount(ec.getAudioPlayCount());
         ret.setHasAudio(ec.getHasAudio());
+        ret.setMobilePhotoUpload(ec.getMobilePhotoUpload());
         List<TEExamPaper> papers = teExamPaperMapper.findListByExamIdAndCourseCode(examId, courseCode);
         if (papers != null && papers.size() > 0) {
             List<Long> paperIds = new ArrayList<Long>();

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

@@ -277,7 +277,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                 ExamRecordStatusEnum statusEnum = ExamRecordCacheUtil.getStatus(recordId);
                 boolean cache = false;
                 if (Objects.nonNull(statusEnum) && !Objects.equals(statusEnum, ExamRecordStatusEnum.RESUME_PREPARE)) {
-                    ExamRecordCacheUtil.updateExamRecordCache(recordId, examCache, ac);
+                    ExamRecordCacheUtil.updateExamRecordCache(recordId, examCache, ac, ec);
                 } else {
                     cache = true;
                 }
@@ -342,7 +342,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
 
         Long recordId = toeExamRecordService
                 .saveByPrepare(es.getExamId(), es.getExamActivityId(), examStudentId, paperId,
-                        es.getAlreadyExamCount() + 1, studentId);
+                        es.getAlreadyExamCount() + 1, studentId, ec.getMobilePhotoUpload());
 
         es.setCurrentRecordId(recordId);
         ExamPrepareBean prepare = new ExamPrepareBean(recordId,

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -107,7 +107,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     @Transactional
     @Override
     public Long saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId,
-                              Integer serialNumber, Long studentId) {
+                              Integer serialNumber, Long studentId, Integer mobilePhotoUpload) {
         ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(examActivityId);
         ExamCacheBean exam = examService.getExamCacheBean(examId);
         TOeExamRecord er = new TOeExamRecord();
@@ -130,7 +130,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         er.setMaxDurationSeconds(ac.getMaxDurationSeconds());
         er.setForceFinish(exam.getForceFinish());
         er.setCameraPhotoUpload(exam.getCameraPhotoUpload());
-        er.setMobilePhotoUpload(exam.getMobilePhotoUpload());
+        er.setMobilePhotoUpload(mobilePhotoUpload);
         er.setEntryAuthenticationPolicy(exam.getEntryAuthenticationPolicy());
         er.setInProcessFaceVerifyStatus(exam.getInProcessFaceVerify());
         er.setInProcessLivenessVerifyStatus(exam.getInProcessLivenessVerify());

+ 0 - 1
themis-business/src/main/resources/mapper/TEExamActivityMapper.xml

@@ -172,7 +172,6 @@
         tee.in_process_liveness_fixed_range as inProcessLivenessFixedRangeStr,
         tee.in_process_liveness_judge_policy as inProcessLivenessJudgePolicy,
         tee.camera_photo_upload as cameraPhotoUpload,
-        tee.mobile_photo_upload as mobilePhotoUpload,
         teea.start_time as startTime,
         teea.finish_time as finishTime,
         tee.pre_notice as preNotice,

Some files were not shown because too many files changed in this diff