Jelajahi Sumber

字段修改

wangliang 4 tahun lalu
induk
melakukan
f3035b4b7b

+ 2 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -230,8 +230,9 @@ public class TEExamController {
         if (Objects.isNull(teExam)) {
             throw new BusinessException(ExceptionResultEnum.EXAM_NO);
         }
+        TEExamDto teExamDto = new TEExamDto(teExam);
         Map map = new HashMap<>();
-        map.put(SystemConstant.RECORDS, teExam);
+        map.put(SystemConstant.RECORDS, teExamDto);
         return ResultUtil.ok(map);
     }
 

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

@@ -2,19 +2,19 @@ package com.qmth.themis.business.dto.request;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.qmth.themis.business.base.BaseEntity;
+import com.qmth.themis.business.entity.TEExam;
 import com.qmth.themis.business.enums.*;
 import io.swagger.annotations.ApiModelProperty;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
-/** 
-* @Description: 考试请求dto
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/8/8 
-*/ 
+/**
+ * @Description: 考试请求dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/8/8
+ */
 public class TEExamDto extends BaseEntity {
 
     @ApiModelProperty(value = "机构ID")
@@ -169,6 +169,66 @@ public class TEExamDto extends BaseEntity {
     @TableField(value = "progress")
     private Double progress;
 
+    public TEExamDto() {
+
+    }
+
+    public TEExamDto(TEExam teExam) {
+        setId(teExam.getId());
+        this.orgId = teExam.getOrgId();
+        this.name = teExam.getName();
+        this.code = teExam.getCode();
+        this.tag = teExam.getTag();
+        this.startTime = teExam.getStartTime();
+        this.endTime = teExam.getEndTime();
+        this.shortCode = teExam.getShortCode();
+        this.prepareSeconds = teExam.getPrepareSeconds();
+        this.minDurationSeconds = teExam.getMinDurationSeconds();
+        this.preNotice = teExam.getPreNotice();
+        this.preNoticeStaySeconds = teExam.getPreNoticeStaySeconds();
+        this.postNotice = teExam.getPostNotice();
+        this.examCount = teExam.getExamCount();
+        this.breakExpireSeconds = teExam.getBreakExpireSeconds();
+        this.breakResumeCount = teExam.getBreakResumeCount();
+        this.cameraPhotoUpload = teExam.getCameraPhotoUpload();
+        this.reexamAuditing = teExam.getReexamAuditing();
+        this.showObjectiveScore = teExam.getShowObjectiveScore();
+        this.mode = teExam.getMode();
+        this.enable = teExam.getEnable();
+        this.archived = teExam.getArchived();
+        this.openingSeconds = teExam.getOpeningSeconds();
+        this.maxDurationSeconds = teExam.getMaxDurationSeconds();
+        this.forceFinish = teExam.getForceFinish();
+        this.entryAuthenticationPolicy = teExam.getEntryAuthenticationPolicy();
+        this.inProcessFaceVerify = teExam.getInProcessFaceVerify();
+        this.inProcessFaceStrangerIgnore = teExam.getInProcessFaceStrangerIgnore();
+        this.inProcessLivenessVerify = teExam.getInProcessLivenessVerify();
+        if (Objects.nonNull(teExam.getInProcessLivenessFixedRange())) {
+            String[] longs = teExam.getInProcessLivenessFixedRange().split(",");
+            List inProcessLivenessFixedRange = new ArrayList();
+            for (int i = 0; i < longs.length; i++) {
+                Long l = Long.valueOf(longs[i]);
+                inProcessLivenessFixedRange.add(l);
+            }
+            setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
+        }
+        this.inProcessLivenessJudgePolicy = teExam.getInProcessLivenessJudgePolicy();
+        this.recordSelectStrategy = teExam.getRecordSelectStrategy();
+        this.enableIpLimit = teExam.getEnableIpLimit();
+        this.ipAllow = teExam.getIpAllow();
+        this.scoreStatus = teExam.getScoreStatus();
+        this.objectiveScorePolicy = teExam.getObjectiveScorePolicy();
+        if (Objects.nonNull(teExam.getMonitorVideoSource())) {
+            setMonitorVideoSource(Arrays.asList(teExam.getMonitorVideoSource().split(",")));
+        }
+        this.monitorRecord = teExam.getMonitorRecord();
+        this.progress = teExam.getProgress();
+        setCreateId(teExam.getCreateId());
+        setCreateTime(teExam.getCreateTime());
+        setUpdateId(teExam.getUpdateId());
+        setUpdateTime(teExam.getUpdateTime());
+    }
+
     public Long getOrgId() {
         return orgId;
     }

+ 11 - 2
themis-business/src/main/java/com/qmth/themis/business/entity/TEExam.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
+import java.util.Objects;
 
 /**
  * @Description: 考试批次
@@ -206,16 +207,24 @@ public class TEExam extends BaseEntity {
         this.inProcessFaceVerify = teExamDto.getInProcessFaceVerify();
         this.inProcessFaceStrangerIgnore = teExamDto.getInProcessFaceStrangerIgnore();
         this.inProcessLivenessVerify = teExamDto.getInProcessLivenessVerify();
-        this.inProcessLivenessFixedRange = teExamDto.getInProcessLivenessFixedRange().toString().replace("[", "").replace("]", "");
+        if (Objects.nonNull(teExamDto.getInProcessLivenessFixedRange())) {
+            this.inProcessLivenessFixedRange = teExamDto.getInProcessLivenessFixedRange().toString().replace("[", "").replace("]", "");
+        }
         this.inProcessLivenessJudgePolicy = teExamDto.getInProcessLivenessJudgePolicy();
         this.recordSelectStrategy = teExamDto.getRecordSelectStrategy();
         this.enableIpLimit = teExamDto.getEnableIpLimit();
         this.ipAllow = teExamDto.getIpAllow();
         this.scoreStatus = teExamDto.getScoreStatus();
         this.objectiveScorePolicy = teExamDto.getObjectiveScorePolicy();
-        this.monitorVideoSource = teExamDto.getMonitorVideoSource().toString().replace("[", "").replace("]", "");
+        if (Objects.nonNull(teExamDto.getMonitorVideoSource())) {
+            this.monitorVideoSource = teExamDto.getMonitorVideoSource().toString().replace("[", "").replace("]", "");
+        }
         this.monitorRecord = teExamDto.getMonitorRecord();
         this.progress = teExamDto.getProgress();
+        setCreateId(teExamDto.getCreateId());
+        setCreateTime(teExamDto.getCreateTime());
+        setUpdateId(teExamDto.getUpdateId());
+        setUpdateTime(teExamDto.getUpdateTime());
     }
 
     public Integer getCameraPhotoUpload() {