Browse Source

不用entity传参

xiatian 5 years ago
parent
commit
d6fd9bf18a

+ 2 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/ExamRecordDataService.java

@@ -2,7 +2,7 @@ package cn.com.qmth.examcloud.core.oe.admin.service;
 
 import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
-import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentBean;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
 
 /**
@@ -21,7 +21,7 @@ public interface ExamRecordDataService {
      * @param fullyObjective
      * @return
      */
-    ExamRecordDataEntity createOfflineExamRecordData(ExamStudentEntity examStudent,
+    ExamRecordDataEntity createOfflineExamRecordData(ExamStudentBean bean,
                                                      ExamBean examBean,
                                                      CourseBean courseBean,
                                                      String basePaperId,

+ 286 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/examstudent/ExamStudentBean.java

@@ -0,0 +1,286 @@
+package cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+
+public class ExamStudentBean implements JsonSerializable {
+
+
+	/**
+     * 
+     */
+    private static final long serialVersionUID = -205239358290227432L;
+
+    /**
+	 * 不做业务字段使用
+	 */
+	private Long id;
+
+	/**
+	 * 考生ID(与考务的考生ID一致) 跟其他表关联使用
+	 */
+	private Long examStudentId;
+
+	/**
+	 * 考试ID
+	 */
+	private Long examId;
+
+	/**
+	 * 学生ID
+	 */
+	private Long studentId;
+
+	/**
+	 * 学号
+	 */
+	private String studentCode;
+
+	/**
+	 * 学生姓名
+	 */
+	private String studentName;
+
+	/**
+	 * 身份证号
+	 */
+	private String identityNumber;
+
+	/**
+	 * 课程ID
+	 */
+	private Long courseId;
+
+	/**
+	 * 课程Code
+	 */
+	private String courseCode;
+
+	/**
+	 * 课程层次
+	 */
+	private String courseLevel;
+
+	/**
+	 * 学习中心ID
+	 */
+	private Long orgId;
+
+	/**
+	 * 顶级机构ID
+	 */
+	private Long rootOrgId;
+
+	/**
+	 * 专业code
+	 */
+	private String specialtyCode;
+
+	/**
+	 * 专业名称
+	 */
+	private String specialtyName;
+
+	/**
+	 * 试卷类型
+	 */
+	private String paperType;
+
+	/**
+	 * 采集人
+	 */
+	private String infoCollector;
+
+	/**
+	 * 是否完成考试
+	 */
+	private Boolean finished;
+
+	/**
+	 * 已经考试的次数
+	 */
+	private Integer usedNum;
+
+	/**
+	 * 补加的考试次数
+	 */
+	private Integer extraNum;
+
+	/**
+	 * 年级
+	 */
+	private String grade;
+
+	/**
+	 * 是否可用
+	 */
+	private Boolean enable;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getExamStudentId() {
+		return examStudentId;
+	}
+
+	public void setExamStudentId(Long examStudentId) {
+		this.examStudentId = examStudentId;
+	}
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public Long getStudentId() {
+		return studentId;
+	}
+
+	public void setStudentId(Long studentId) {
+		this.studentId = studentId;
+	}
+
+	public String getStudentCode() {
+		return studentCode;
+	}
+
+	public void setStudentCode(String studentCode) {
+		this.studentCode = studentCode;
+	}
+
+	public String getStudentName() {
+		return studentName;
+	}
+
+	public void setStudentName(String studentName) {
+		this.studentName = studentName;
+	}
+
+	public String getIdentityNumber() {
+		return identityNumber;
+	}
+
+	public void setIdentityNumber(String identityNumber) {
+		this.identityNumber = identityNumber;
+	}
+
+	public Long getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
+	public String getCourseLevel() {
+		return courseLevel;
+	}
+
+	public void setCourseLevel(String courseLevel) {
+		this.courseLevel = courseLevel;
+	}
+
+	public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getSpecialtyCode() {
+		return specialtyCode;
+	}
+
+	public void setSpecialtyCode(String specialtyCode) {
+		this.specialtyCode = specialtyCode;
+	}
+
+	public String getSpecialtyName() {
+		return specialtyName;
+	}
+
+	public void setSpecialtyName(String specialtyName) {
+		this.specialtyName = specialtyName;
+	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+	public String getInfoCollector() {
+		return infoCollector;
+	}
+
+	public void setInfoCollector(String infoCollector) {
+		this.infoCollector = infoCollector;
+	}
+
+	public Boolean getFinished() {
+		return finished;
+	}
+
+	public void setFinished(Boolean finished) {
+		this.finished = finished;
+	}
+
+	public Integer getUsedNum() {
+		return usedNum;
+	}
+
+	public void setUsedNum(Integer usedNum) {
+		this.usedNum = usedNum;
+	}
+
+	public Integer getExtraNum() {
+		return extraNum;
+	}
+
+	public void setExtraNum(Integer extraNum) {
+		this.extraNum = extraNum;
+	}
+
+	public String getGrade() {
+		return grade;
+	}
+
+	public void setGrade(String grade) {
+		this.grade = grade;
+	}
+
+	public Boolean getEnable() {
+		return enable;
+	}
+
+	public void setEnable(Boolean enable) {
+		this.enable = enable;
+	}
+
+}

+ 2 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordDataServiceImpl.java

@@ -8,10 +8,10 @@ import org.springframework.stereotype.Service;
 import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
-import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamRecordStatus;
 import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamType;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordDataService;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentBean;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
 
 /**
@@ -27,7 +27,7 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
     private ExamRecordDataRepo examRecordDataRepo;
 
     @Override
-    public ExamRecordDataEntity createOfflineExamRecordData(ExamStudentEntity examStudent,
+    public ExamRecordDataEntity createOfflineExamRecordData(ExamStudentBean examStudent,
                                                             ExamBean examBean,
                                                             CourseBean courseBean,
                                                             String basePaperId,

+ 43 - 11
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/OfflineExamServiceImpl.java

@@ -30,6 +30,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
 import cn.com.qmth.examcloud.core.oe.admin.service.OfflineExamService;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.OfflineExamCourseInfo;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordDataBean;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentBean;
 import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
 import cn.com.qmth.examcloud.core.questions.api.ExtractConfigCloudService;
 import cn.com.qmth.examcloud.core.questions.api.request.GetPaperReq;
@@ -169,10 +170,11 @@ public class OfflineExamServiceImpl implements OfflineExamService {
         }
         //获取考生信息
         ExamStudentEntity examStudentEntity = examStudentRepo.findByExamStudentId(examStudentId);
+        ExamStudentBean bean=of(examStudentEntity);
         //检查并获取课程信息
-        CourseBean courseBean = checkCourse(examStudentEntity);
+        CourseBean courseBean = checkCourse(bean);
         //检查并获取考试信息
-        ExamBean examBean = checkExam(examStudentEntity);
+        ExamBean examBean = checkExam(bean);
         //获取题库试卷结构(由于存在随机抽卷,所以不能缓存 )
         GetPaperReq getPaperReq = new GetPaperReq();
         getPaperReq.setExamId(examStudentEntity.getExamId());
@@ -181,7 +183,7 @@ public class OfflineExamServiceImpl implements OfflineExamService {
         GetPaperResp getPaperResp = extractConfigCloudService.getPaper(getPaperReq);
 
         //生成考试记录
-        ExamRecordDataEntity examRecordData = examRecordDataService.createOfflineExamRecordData(examStudentEntity,
+        ExamRecordDataEntity examRecordData = examRecordDataService.createOfflineExamRecordData(bean,
                 examBean, courseBean, getPaperResp.getPaperId(),
                 null, getPaperResp.getDefaultPaper().getFullyObjective());
         //生成分数
@@ -190,17 +192,17 @@ public class OfflineExamServiceImpl implements OfflineExamService {
         examStudentRepo.updateExamStudentFinished(examStudentId);
     }
 
-    private CourseBean checkCourse(ExamStudentEntity examStudentEntity) {
-        CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(examStudentEntity.getCourseId());
+    private CourseBean checkCourse(ExamStudentBean bean) {
+        CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(bean.getCourseId());
         if (!courseBean.getEnable()) {
             throw new StatusException("2001", "该课程已被禁用");
         }
         return courseBean;
     }
 
-    private ExamBean checkExam(ExamStudentEntity examStudentEntity) {
-        Long examId = examStudentEntity.getExamId();
-        Long studentId = examStudentEntity.getStudentId();
+    private ExamBean checkExam(ExamStudentBean bean) {
+        Long examId = bean.getExamId();
+        Long studentId = bean.getStudentId();
         ExamBean examBean = ExamCacheTransferHelper.getCachedExam(examId, studentId);
 
         //如果启用了了特殊设置,并且无特殊设置时结束考试 配置 设置为true..且实际未设置特殊设置则不允许考试
@@ -310,18 +312,22 @@ public class OfflineExamServiceImpl implements OfflineExamService {
         info.setBasePaperId(record.getBasePaperId());
         info.setPaperStructId(record.getPaperStructId());
         info.setInfoCollector(record.getInfoCollector());
+        info.setExamRecordQuestionsId(record.getExamRecordQuestionsId());
+        info.setExamRecordStatus(record.getExamRecordStatus());
         info.setStartTime(record.getStartTime());
         info.setEndTime(record.getEndTime());
         info.setCleanTime(record.getCleanTime());
+        info.setIsWarn(record.getIsWarn());
+        info.setIsAudit(record.getIsAudit());
+        info.setIsIllegality(record.getIsIllegality());
 
-
-
-        info.setExamRecordStatus(record.getExamRecordStatus());
         info.setUsedExamTime(record.getUsedExamTime());
         info.setExamOrder(record.getExamOrder());
         info.setIsReexamine(record.getIsReexamine());
         info.setIsContinued(record.getIsContinued());
         info.setContinuedCount(record.getContinuedCount());
+        info.setIsAllObjectivePaper(record.getIsAllObjectivePaper());
+        info.setIsExceed(record.getIsExceed());
         info.setFaceSuccessCount(record.getFaceSuccessCount());
         info.setFaceFailedCount(record.getFaceFailedCount());
         info.setFaceStrangerCount(record.getFaceStrangerCount());
@@ -332,4 +338,30 @@ public class OfflineExamServiceImpl implements OfflineExamService {
         info.setFaceLandmarkVal(record.getFaceLandmarkVal());
         return info;
     }
+    
+    private ExamStudentBean of(ExamStudentEntity et) {
+        ExamStudentBean b=new ExamStudentBean();
+        b.setId(et.getId());
+        b.setExamStudentId(et.getExamStudentId());
+        b.setExamId(et.getExamId());
+        b.setStudentId(et.getStudentId());
+        b.setStudentCode(et.getStudentCode());
+        b.setStudentName(et.getStudentName());
+        b.setIdentityNumber(et.getIdentityNumber());
+        b.setCourseId(et.getCourseId());
+        b.setCourseCode(et.getCourseCode());
+        b.setCourseLevel(et.getCourseLevel());
+        b.setOrgId(et.getOrgId());
+        b.setRootOrgId(et.getRootOrgId());
+        b.setSpecialtyCode(et.getSpecialtyCode());
+        b.setSpecialtyName(et.getSpecialtyName());
+        b.setPaperType(et.getPaperType());
+        b.setInfoCollector(et.getInfoCollector());
+        b.setFinished(et.getFinished());
+        b.setUsedNum(et.getUsedNum());
+        b.setExtraNum(et.getExtraNum());
+        b.setGrade(et.getGrade());
+        b.setEnable(et.getEnable());
+        return b;
+    }
 }