|
@@ -0,0 +1,743 @@
|
|
|
+/*
|
|
|
+ * *************************************************
|
|
|
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
|
|
|
+ * Created by Deason on 2018-08-23 16:38:01.
|
|
|
+ * *************************************************
|
|
|
+ */
|
|
|
+
|
|
|
+package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.StudentBean;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamCacheTransferHelper;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamService;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentService;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.ExamStudentEffectiveScoreInfo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordEntityConvert;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordInfo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordQuery;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamStudentQuestionScoreInfo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentInfo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.base.jpa.Searcher;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.base.jpa.SpecUtils;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.base.jpa.SqlWrapper;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.enums.MarkingType;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.service.GainBaseDataService;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.service.LocalCacheService;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.base.utils.Check;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.entity.ExamQuestionEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.entity.ExamRecordDataEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.entity.ExamRecordEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.entity.ExamRecordQuestionsEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.entity.ExamScoreEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.enums.ExamRecordStatus;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.enums.ExamType;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.enums.IsSuccess;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.repository.ExamAuditRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.repository.ExamRecordDataRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.repository.ExamRecordQuestionsRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.repository.ExamRecordRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.common.repository.ExamScoreRepo;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.OrgCacheBean;
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.jdbc.core.RowMapper;
|
|
|
+import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.persistence.EntityManager;
|
|
|
+import javax.persistence.NoResultException;
|
|
|
+import javax.persistence.Query;
|
|
|
+
|
|
|
+import java.math.BigInteger;
|
|
|
+import java.sql.ResultSet;
|
|
|
+import java.sql.SQLException;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import static cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordMapper.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 考试记录接口
|
|
|
+ *
|
|
|
+ * @author: fengdesheng
|
|
|
+ * @since: 2018/8/16
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ExamRecordServiceImpl implements ExamRecordService {
|
|
|
+ @Autowired
|
|
|
+ private ExamRecordRepo examRecordRepo;
|
|
|
+ @Autowired
|
|
|
+ private ExamScoreRepo examScoreRepo;
|
|
|
+ @Autowired
|
|
|
+ private ExamRecordDataRepo examRecordDataRepo;
|
|
|
+ @Autowired
|
|
|
+ private ExamAuditRepo examAuditRepo;
|
|
|
+ @Autowired
|
|
|
+ private EntityManager entityManager;
|
|
|
+ @Autowired
|
|
|
+ private ExamService examService;
|
|
|
+ @Autowired
|
|
|
+ private ExamStudentService examStudentService;
|
|
|
+ @Autowired
|
|
|
+ private GainBaseDataService gainBaseDataService;
|
|
|
+ @Autowired
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
+ @Autowired
|
|
|
+ private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
|
|
+ @Autowired
|
|
|
+ private ExamRecordEntityConvert examRecordEntityConvert;
|
|
|
+ @Autowired
|
|
|
+ private LocalCacheService localCacheService;
|
|
|
+ /**
|
|
|
+ * ec_oe_exam_record_data 联合 ec_oe_exam_record 查询sql
|
|
|
+ */
|
|
|
+ private static final String EXAM_RECORD_SQL = "select record_data.id," +
|
|
|
+ "record_data.exam_record_id," +
|
|
|
+ "record_data.exam_record_status," +
|
|
|
+ "record_data.start_time," +
|
|
|
+ "record_data.end_time," +
|
|
|
+ "record_data.clean_time," +
|
|
|
+ "record_data.used_exam_time," +
|
|
|
+ "record_data.exam_order," +
|
|
|
+ "record_data.is_warn," +
|
|
|
+ "record_data.is_audit," +
|
|
|
+ "record_data.is_illegality," +
|
|
|
+ "record_data.is_reexamine," +
|
|
|
+ "record_data.is_continued," +
|
|
|
+ "record_data.is_all_objective_paper," +
|
|
|
+ "record_data.continued_count," +
|
|
|
+ "record_data.face_success_count," +
|
|
|
+ "record_data.face_failed_count," +
|
|
|
+ "record_data.face_stranger_count," +
|
|
|
+ "record_data.face_total_count," +
|
|
|
+ "record_data.face_success_percent," +
|
|
|
+ "record_data.face_verify_result," +
|
|
|
+ "record_data.baidu_face_liveness_success_percent," +
|
|
|
+ "record_data.creation_time," +
|
|
|
+ "record_data.update_time," +
|
|
|
+ "record.exam_id exam_id," +
|
|
|
+ "record.exam_type exam_type," +
|
|
|
+ "record.exam_student_id exam_student_id," +
|
|
|
+ "record.student_id student_id," +
|
|
|
+ "record.student_code student_code," +
|
|
|
+ "record.student_name student_name," +
|
|
|
+ "record.identity_number identity_number," +
|
|
|
+ "record.course_id course_id," +
|
|
|
+ "record.course_level course_level," +
|
|
|
+ "record.root_org_id root_org_id," +
|
|
|
+ "record.org_id org_id," +
|
|
|
+ "record.base_paper_id base_paper_id," +
|
|
|
+ "record.paper_type paper_type," +
|
|
|
+ "record.paper_struct_id paper_struct_id," +
|
|
|
+ "record.info_collector info_collector" +
|
|
|
+ " from ec_oe_exam_record_data record_data " +
|
|
|
+ " left join ec_oe_exam_record record on record_data.exam_record_id = record.id where 1=1";
|
|
|
+ /**
|
|
|
+ * 考生作答成绩
|
|
|
+ */
|
|
|
+ private static final String EXAM_STUDENT_QUESTION_SCORE_SQL = "select " +
|
|
|
+ "erd.id exam_record_data_id,co.`code` course_code,co.`name` course_name, ex.`name` exam_name" +
|
|
|
+ ",er.student_code,er.base_paper_id " +
|
|
|
+ "from ec_oe_exam_record er " +
|
|
|
+ "inner join ec_oe_exam_record_data erd on er.id=erd.exam_record_id " +
|
|
|
+ "inner join ec_b_course co on er.course_id=co.id " +
|
|
|
+ "inner join ec_e_exam ex on er.exam_id=ex.id " +
|
|
|
+ "where 1=1 ";
|
|
|
+ @Autowired
|
|
|
+ private ExamRecordQuestionsRepo examRecordQuestionsRepo;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<ExamRecordInfo> getExamRecordDetailListForPage(ExamRecordQuery query) {
|
|
|
+ Check.isNull(query, "查询参数不能为空!");
|
|
|
+ query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
+ query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
+ return this.loadData(_getExamRecordDetailListForPage(query), query.getExamId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<ExamRecordInfo> getExamRecordWaitingAuditList(ExamRecordQuery query) {
|
|
|
+ Check.isNull(query, "查询参数不能为空!");
|
|
|
+ //默认条件
|
|
|
+ query.setIsAudit(false);
|
|
|
+ query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
+ query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
+ return this.getExamRecordList(query);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 考试明细查询
|
|
|
+ *
|
|
|
+ * @param query
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Page<ExamRecordInfo> _getExamRecordDetailListForPage(ExamRecordQuery query) {
|
|
|
+ Check.isNull(query, "查询参数不能为空!");
|
|
|
+ //查询条件
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append(EXAM_RECORD_SQL);
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))");
|
|
|
+ sqlBuilder.append(" order by record.id desc");
|
|
|
+ //分页条件
|
|
|
+ int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
|
+ sqlBuilder.append(" limit " + currentNum + "," + query.getPageSize());
|
|
|
+ List<ExamRecordDataEntity> examRecordDataList = jdbcTemplate.query(sqlBuilder.toString(), new RowMapper<ExamRecordDataEntity>() {
|
|
|
+ @Override
|
|
|
+ public ExamRecordDataEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
|
+ return getExamRecordDataEntityByResultSet(rs);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //查询总数
|
|
|
+ long total = countExamRecordDetailListForPage(query);
|
|
|
+ Pageable pageable = new PageRequest(query.getPageNo() - 1, query.getPageSize());
|
|
|
+ Page<ExamRecordDataEntity> page = new PageImpl<ExamRecordDataEntity>(examRecordDataList, pageable, total);
|
|
|
+ return examRecordEntityConvert.of(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ private ExamRecordDataEntity getExamRecordDataEntityByResultSet(ResultSet rs) throws SQLException {
|
|
|
+ ExamRecordDataEntity examRecordData = new ExamRecordDataEntity();
|
|
|
+ examRecordData.setId(rs.getLong("id"));
|
|
|
+ examRecordData.setExamRecordStatus(ExamRecordStatus.getByName(rs.getString("exam_record_status")));
|
|
|
+ examRecordData.setStartTime(rs.getTimestamp("start_time"));
|
|
|
+ examRecordData.setEndTime(rs.getTimestamp("end_time"));
|
|
|
+ examRecordData.setCleanTime(rs.getTimestamp("clean_time"));
|
|
|
+ examRecordData.setUsedExamTime(rs.getLong("used_exam_time"));
|
|
|
+ examRecordData.setExamOrder(rs.getInt("exam_order"));
|
|
|
+ examRecordData.setIsWarn(rs.getBoolean("is_warn"));
|
|
|
+ examRecordData.setIsAudit(rs.getBoolean("is_audit"));
|
|
|
+ examRecordData.setIsIllegality(rs.getBoolean("is_illegality"));
|
|
|
+ examRecordData.setIsReexamine(rs.getBoolean("is_reexamine"));
|
|
|
+ examRecordData.setIsContinued(rs.getBoolean("is_continued"));
|
|
|
+ examRecordData.setIsAllObjectivePaper(rs.getBoolean("is_all_objective_paper"));
|
|
|
+ examRecordData.setContinuedCount(rs.getInt("continued_count"));
|
|
|
+ examRecordData.setFaceSuccessCount(rs.getInt("face_success_count"));
|
|
|
+ examRecordData.setFaceFailedCount(rs.getInt("face_failed_count"));
|
|
|
+ examRecordData.setFaceStrangerCount(rs.getInt("face_stranger_count"));
|
|
|
+ examRecordData.setFaceTotalCount(rs.getInt("face_total_count"));
|
|
|
+ examRecordData.setFaceSuccessPercent(rs.getDouble("face_success_percent"));
|
|
|
+ examRecordData.setFaceVerifyResult(IsSuccess.strToEnum(rs.getString("face_verify_result")));
|
|
|
+ examRecordData.setBaiduFaceLivenessSuccessPercent(rs.getDouble("baidu_face_liveness_success_percent"));
|
|
|
+
|
|
|
+// ExamRecordEntity examRecord = new ExamRecordEntity();
|
|
|
+// examRecord.setId(rs.getLong("exam_record_id"));
|
|
|
+// examRecord.setExamId(rs.getLong("exam_id"));
|
|
|
+// examRecord.setExamType(ExamType.strToEnum(rs.getString("exam_type")));
|
|
|
+// examRecord.setExamStudentId(rs.getLong("exam_student_id"));
|
|
|
+// examRecord.setStudentId(rs.getLong("student_id"));
|
|
|
+// examRecord.setStudentCode(rs.getString("student_code"));
|
|
|
+// examRecord.setStudentName(rs.getString("student_name"));
|
|
|
+// examRecord.setIdentityNumber(rs.getString("identity_number"));
|
|
|
+// examRecord.setCourseId(rs.getLong("course_id"));
|
|
|
+// examRecord.setCourseLevel(rs.getString("course_level"));
|
|
|
+// examRecord.setRootOrgId(rs.getLong("root_org_id"));
|
|
|
+// examRecord.setOrgId(rs.getLong("org_id"));
|
|
|
+// examRecord.setBasePaperId(rs.getString("base_paper_id"));
|
|
|
+// examRecord.setPaperStructId(rs.getString("paper_struct_id"));
|
|
|
+// examRecord.setInfoCollector(rs.getString("info_collector"));
|
|
|
+ examRecordData.setExamRecordId(rs.getLong("exam_record_id"));
|
|
|
+
|
|
|
+ return examRecordData;
|
|
|
+ }
|
|
|
+
|
|
|
+ private long countExamRecordDetailListForPage(ExamRecordQuery query) {
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append("select count(record_data.id) from ec_oe_exam_record_data record_data left join ec_oe_exam_record record on record_data.exam_record_id = record.id where 1=1");
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))");
|
|
|
+ return jdbcTemplate.queryForObject(sqlBuilder.toString(), Long.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建查询 考试明细sql语句
|
|
|
+ *
|
|
|
+ * @param query
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private StringBuilder buildExamRecordCommonSelectCondition(ExamRecordQuery query) {
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ if (query.getExamRecordDataId() != null) {
|
|
|
+ sql.append(" and record_data.id = " + query.getExamRecordDataId());
|
|
|
+ }
|
|
|
+ if (query.getOrgId() != null) {
|
|
|
+ sql.append(" and record.org_id = " + query.getOrgId());
|
|
|
+ }
|
|
|
+ if (query.getExamId() != null) {
|
|
|
+ sql.append(" and record.exam_id = " + query.getExamId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(query.getStudentCode())) {
|
|
|
+ sql.append(" and record.student_code LIKE '%" + query.getStudentCode() + "%'");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(query.getStudentName())) {
|
|
|
+ sql.append(" and record.student_name LIKE '%" + query.getStudentName() + "%'");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(query.getIdentityNumber())) {
|
|
|
+ sql.append(" and record.identity_number LIKE '%" + query.getIdentityNumber() + "%'");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(query.getInfoCollector())) {
|
|
|
+ sql.append(" and record.info_collector LIKE '%" + query.getInfoCollector() + "%'");
|
|
|
+ }
|
|
|
+ if (query.getCourseId() != null) {
|
|
|
+ sql.append(" and record.course_id = " + query.getCourseId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(query.getCourseLevel())) {
|
|
|
+ sql.append(" and record.course_level = '" + query.getCourseLevel() + "'");
|
|
|
+ }
|
|
|
+ if (query.getExamRecordId() != null) {
|
|
|
+ sql.append(" and record.id = " + query.getExamRecordId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(query.getStartTime()) && StringUtils.isNotBlank(query.getEndTime())) {
|
|
|
+ sql.append(" and record_data.start_time >= str_to_date('" + query.getStartTime() + "','%Y/%m/%d %H:%i:%s')"
|
|
|
+ + " and record_data.start_time <= str_to_date('" + query.getEndTime() + "','%Y/%m/%d %H:%i:%s')");
|
|
|
+ }
|
|
|
+ //考试记录状态
|
|
|
+ List<ExamRecordStatus> statusList = query.getRecordStatusList();
|
|
|
+ if (statusList != null && statusList.size() > 0) {
|
|
|
+ String status = "";
|
|
|
+ for (int i = 0; i < statusList.size(); i++) {
|
|
|
+ status += "'" + statusList.get(i) + "',";
|
|
|
+ }
|
|
|
+ status = status.substring(0, status.lastIndexOf(","));
|
|
|
+ sql.append(" and record_data.exam_record_status IN (" + status + ")");
|
|
|
+ }
|
|
|
+ //是否有陌生人脸
|
|
|
+ if (query.getHasStranger() != null) {
|
|
|
+ if (query.getHasStranger()) {
|
|
|
+ sql.append(" and record_data.face_stranger_count > 0");
|
|
|
+ } else {
|
|
|
+ sql.append(" and record_data.face_stranger_count = 0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //人脸识别成功率
|
|
|
+ if (query.getFaceSuccessPercentLower() != null && query.getFaceSuccessPercentUpper() != null) {
|
|
|
+ sql.append(" and record_data.face_success_percent >=" + query.getFaceSuccessPercentLower());
|
|
|
+ sql.append(" and record_data.face_success_percent <=" + query.getFaceSuccessPercentUpper());
|
|
|
+ }
|
|
|
+ if (query.getLivenessSuccessPercentLower() != null && query.getLivenessSuccessPercentUpper() != null) {
|
|
|
+ sql.append(" and record_data.baidu_face_liveness_success_percent >=" + query.getLivenessSuccessPercentLower());
|
|
|
+ sql.append(" and record_data.baidu_face_liveness_success_percent <=" + query.getLivenessSuccessPercentUpper());
|
|
|
+ }
|
|
|
+ return sql;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 监考待审
|
|
|
+ * 查询无异常的数据和有异常未审核的数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<ExamRecordInfo> getExamRecordList(ExamRecordQuery query) {
|
|
|
+ Check.isNull(query, "查询参数不能为空!");
|
|
|
+ //查询条件
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append(EXAM_RECORD_SQL);
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ //只查有异常未审核
|
|
|
+ if (query.getIsWarn() != null) {
|
|
|
+ if (query.getIsWarn()) {
|
|
|
+ sqlBuilder.append(" and record_data.is_warn = 1 and record_data.is_audit = 0 ");
|
|
|
+ } else {
|
|
|
+ sqlBuilder.append(" and record_data.is_warn = 0 ");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 0))");
|
|
|
+ }
|
|
|
+ sqlBuilder.append(" and record_data.is_illegality = 0");
|
|
|
+ sqlBuilder.append(" order by record.id desc");
|
|
|
+ //分页条件
|
|
|
+ int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
|
+ sqlBuilder.append(" limit " + currentNum + "," + query.getPageSize());
|
|
|
+ List<ExamRecordDataEntity> examRecordDataList = jdbcTemplate.query(sqlBuilder.toString(), new RowMapper<ExamRecordDataEntity>() {
|
|
|
+ @Override
|
|
|
+ public ExamRecordDataEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
|
+ return getExamRecordDataEntityByResultSet(rs);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //查询总数
|
|
|
+ long total = countExamRecordListForPage(query);
|
|
|
+ Pageable pageable = new PageRequest(query.getPageNo() - 1, query.getPageSize());
|
|
|
+ Page<ExamRecordDataEntity> page = new PageImpl<ExamRecordDataEntity>(examRecordDataList, pageable, total);
|
|
|
+ return examRecordEntityConvert.of(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 监考待审:数量查询
|
|
|
+ * 查询无异常的数据和有异常未审核的数据
|
|
|
+ */
|
|
|
+ private long countExamRecordListForPage(ExamRecordQuery query) {
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append("select count(record_data.id) from ec_oe_exam_record_data record_data left join ec_oe_exam_record record on record_data.exam_record_id = record.id where 1=1");
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ if (query.getIsWarn() != null) {
|
|
|
+ if (query.getIsWarn()) {
|
|
|
+ sqlBuilder.append(" and record_data.is_warn = 1 and record_data.is_audit = 0 ");
|
|
|
+ } else {
|
|
|
+ sqlBuilder.append(" and record_data.is_warn = 0 ");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 0))");
|
|
|
+ }
|
|
|
+ sqlBuilder.append(" and record_data.is_illegality = 0");
|
|
|
+ return jdbcTemplate.queryForObject(sqlBuilder.toString(), Long.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Long> getExamRecordingStudentIds(Long examId) {
|
|
|
+ Check.isNull(examId, "考试ID不能为空!");
|
|
|
+
|
|
|
+ SqlWrapper wrapper = new SqlWrapper()
|
|
|
+ .select("record.exam_student_id")
|
|
|
+ .from("ec_oe_exam_record").as("record")
|
|
|
+ .innerJoin("ec_oe_exam_record_data").as("data")
|
|
|
+ .on("record.id", "data.exam_record_id")
|
|
|
+ .where().eq("data.exam_record_status", ExamRecordStatus.EXAM_ING.name())
|
|
|
+ .and().eq("record.exam_id", examId);
|
|
|
+
|
|
|
+ Query query = entityManager.createNativeQuery(wrapper.build());
|
|
|
+ List<BigInteger> list = query.getResultList();
|
|
|
+ if (list == null || list.size() == 0) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ for (BigInteger big : list) {
|
|
|
+ ids.add(big.longValue());
|
|
|
+ }
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ExamRecordDataEntity> getExamRecordListByExamStudentId(Long examStudentId) {
|
|
|
+ Check.isNull(examStudentId, "考生ID不能为空!");
|
|
|
+ return examRecordDataRepo.findByExamStudentId(examStudentId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long findExamRecordDataId(Long examRecordId) {
|
|
|
+ SqlWrapper wrapper = new SqlWrapper()
|
|
|
+ .select("exam_record_id")
|
|
|
+ .from("ec_oe_exam_record_data")
|
|
|
+ .where()
|
|
|
+ .eq("exam_record_id", examRecordId);
|
|
|
+ Query query = entityManager.createNativeQuery(wrapper.build());
|
|
|
+ try {
|
|
|
+ BigInteger result = (BigInteger) query.getSingleResult();
|
|
|
+ if (result != null) {
|
|
|
+ return result.longValue();
|
|
|
+ }
|
|
|
+ } catch (NoResultException e) {
|
|
|
+ //ignore
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Page<ExamRecordInfo> loadData(Page<ExamRecordInfo> page, Long examId) {
|
|
|
+ if (page == null || page.getContent() == null) {
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ //缓存
|
|
|
+ Map<String, Object> cahcheMap = new HashMap<String, Object>();
|
|
|
+ //获取考试名称
|
|
|
+ ExamBean examBean = ExamCacheTransferHelper.getCachedExam(examId);
|
|
|
+
|
|
|
+ page.getContent().forEach(e -> {
|
|
|
+ ExamStudentInfo examStudent = examStudentService.getExamStudentInfo(e.getExamStudentId());
|
|
|
+ if (examStudent != null) {
|
|
|
+ String photoNumber = null;
|
|
|
+ if (cahcheMap.containsKey("photoNumber_" + examStudent.getStudentId())) {
|
|
|
+ photoNumber = (String) cahcheMap.get("photoNumber_" + examStudent.getStudentId());
|
|
|
+ } else {
|
|
|
+ StudentCacheBean studentBean = CacheHelper.getStudent(examStudent.getStudentId());
|
|
|
+ photoNumber = studentBean.getPhoneNumber();
|
|
|
+ cahcheMap.put("photoNumber_" + examStudent.getStudentId(), photoNumber);
|
|
|
+ }
|
|
|
+ e.setPhone(photoNumber);//电话号码
|
|
|
+
|
|
|
+ e.setOrgName(examStudent.getOrgName());
|
|
|
+ e.setSpecialtyName(examStudent.getSpecialtyName());
|
|
|
+ e.setGrade(examStudent.getGrade());
|
|
|
+ OrgCacheBean orgBean = gainBaseDataService.getOrgBean(examStudent.getOrgId());
|
|
|
+ e.setOrgName(orgBean.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ e.setExamName(examBean.getName());
|
|
|
+ Map<String, String> data = this.getPaperScore(e.getDataId());
|
|
|
+ //试卷总分
|
|
|
+ e.setPaperTotalScore(data.get("paperTotalScore"));
|
|
|
+ //客观题总分
|
|
|
+ e.setObjectiveTotalScore(data.get("objectiveTotalScore"));
|
|
|
+ //主观题总分
|
|
|
+ e.setSubjectiveTotalScore(data.get("subjectiveTotalScore"));
|
|
|
+ });
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取卷面分
|
|
|
+ */
|
|
|
+ public Map<String, String> getPaperScore(Long examRecordDataId) {
|
|
|
+ Map<String, String> data = new HashMap<>();
|
|
|
+ ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordDataId);
|
|
|
+ //卷面总分
|
|
|
+ Double paperTotalScore = 0d;
|
|
|
+ //客观题总分
|
|
|
+ Double objectiveTotalScore = 0d;
|
|
|
+ //主观题总分
|
|
|
+ Double subjectiveTotalScore = 0d;
|
|
|
+ if (examScore != null) {
|
|
|
+ paperTotalScore = examScore.getObjectiveScore() == null ? 0d : examScore.getObjectiveScore();
|
|
|
+ objectiveTotalScore = examScore.getObjectiveScore() == null ? 0d : examScore.getObjectiveScore();
|
|
|
+ subjectiveTotalScore = examScore.getSubjectiveScore() == null ? 0d : examScore.getSubjectiveScore();
|
|
|
+ }
|
|
|
+ data.put("paperTotalScore", String.valueOf(paperTotalScore));
|
|
|
+ data.put("objectiveTotalScore", String.valueOf(objectiveTotalScore));
|
|
|
+ data.put("subjectiveTotalScore", String.valueOf(subjectiveTotalScore));
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long existsWarnExamRecordDetail(ExamRecordQuery query) {
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append("select count(record_data.id) from ec_oe_exam_record_data record_data "
|
|
|
+ + " left join ec_oe_exam_record record on record_data.exam_record_id = record.id "
|
|
|
+ + " where 1=1 ");
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ sqlBuilder.append(" and record_data.is_warn = 1 and record_data.is_audit = 0");
|
|
|
+ return jdbcTemplate.queryForObject(sqlBuilder.toString(), Long.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ExamRecordInfo> getExamRecordDetailList(ExamRecordQuery query) {
|
|
|
+ Check.isNull(query, "查询参数不能为空!");
|
|
|
+ query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
+ query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
+
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append(EXAM_RECORD_SQL);
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))");
|
|
|
+ sqlBuilder.append(" order by record.id desc");
|
|
|
+
|
|
|
+ List<ExamRecordDataEntity> examRecordDataList = jdbcTemplate.query(sqlBuilder.toString(), new RowMapper<ExamRecordDataEntity>() {
|
|
|
+ @Override
|
|
|
+ public ExamRecordDataEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
|
+ return getExamRecordDataEntityByResultSet(rs);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ List<ExamRecordInfo> examRecordInfoList = examRecordEntityConvert.of(examRecordDataList);
|
|
|
+ return this.loadExamRecordDetailData(examRecordInfoList, query.getExamId());
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<ExamRecordInfo> loadExamRecordDetailData(List<ExamRecordInfo> list, Long examId) {
|
|
|
+ if (list == null || list.size() == 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ //缓存
|
|
|
+ Map<String, Object> cahcheMap = new HashMap<String, Object>();
|
|
|
+ //获取考试名称
|
|
|
+ ExamBean examBean = ExamCacheTransferHelper.getCachedExam(examId);
|
|
|
+ list.forEach(examRecordInfo -> {
|
|
|
+ examRecordInfo.setExamName(examBean.getName());
|
|
|
+ ExamStudentInfo examStudent = (ExamStudentInfo) cahcheMap.get("examStudentinfo_" + examRecordInfo.getExamStudentId());
|
|
|
+ if (examStudent == null) {
|
|
|
+ examStudent = examStudentService.getExamStudentInfo(examRecordInfo.getExamStudentId());
|
|
|
+ cahcheMap.put("examStudentinfo_" + examRecordInfo.getExamStudentId(), examStudent);
|
|
|
+ }
|
|
|
+
|
|
|
+ String photoNumber = localCacheService.getStudentPhotoNumber(cahcheMap, examRecordInfo.getStudentId());
|
|
|
+ examRecordInfo.setPhone(photoNumber);//电话号码
|
|
|
+ if (examStudent != null) {
|
|
|
+ examRecordInfo.setSpecialtyName(examStudent.getSpecialtyName());
|
|
|
+ examRecordInfo.setGrade(examStudent.getGrade());
|
|
|
+ }
|
|
|
+ Map<String, String> data = this.getPaperScore(examRecordInfo.getDataId());
|
|
|
+ //试卷总分
|
|
|
+ examRecordInfo.setPaperTotalScore(data.get("paperTotalScore"));
|
|
|
+ //客观题总分
|
|
|
+ examRecordInfo.setObjectiveTotalScore(data.get("objectiveTotalScore"));
|
|
|
+ //主观题总分
|
|
|
+ examRecordInfo.setSubjectiveTotalScore(data.get("subjectiveTotalScore"));
|
|
|
+ });
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ExamStudentQuestionScoreInfo> getExamStudentQuestionScoreList(Long examId, String courseCode) {
|
|
|
+ //最终返回的结果集
|
|
|
+ List<ExamStudentQuestionScoreInfo> resultList = new ArrayList<ExamStudentQuestionScoreInfo>();
|
|
|
+ //获取考试记录相关基本信息
|
|
|
+ List<ExamStudentQuestionScoreInfo> partialExamStudentQuestionScoreList = getPartialExamStudentQuestionScoreList(examId, courseCode);
|
|
|
+ List<Long> examRecordDataIdList = new ArrayList<Long>();
|
|
|
+ if (partialExamStudentQuestionScoreList != null && !partialExamStudentQuestionScoreList.isEmpty()) {
|
|
|
+ partialExamStudentQuestionScoreList.forEach(p -> examRecordDataIdList.add(p.getExamRecordDataId()));
|
|
|
+ //批量查询考试记录数据
|
|
|
+ List<ExamRecordQuestionsEntity> examRecordQuestionsList = examRecordQuestionsRepo.findByExamRecordDataIdIn(examRecordDataIdList);
|
|
|
+ for (ExamStudentQuestionScoreInfo scoreInfo : partialExamStudentQuestionScoreList) {
|
|
|
+ List<ExamRecordQuestionsEntity> filterExamRecordQuestionsList = examRecordQuestionsList.stream().filter(p -> p.getExamRecordDataId().equals(scoreInfo.getExamRecordDataId())).collect(Collectors.toList());
|
|
|
+ if (examRecordQuestionsList != null && !examRecordQuestionsList.isEmpty()) {
|
|
|
+ ExamRecordQuestionsEntity filterExamRecordQuestionsEntity = filterExamRecordQuestionsList.get(0);
|
|
|
+ //当前考试记录中的所有考题成绩集合
|
|
|
+ List<ExamQuestionEntity> examQuestionEntities = filterExamRecordQuestionsEntity.getExamQuestionEntities();
|
|
|
+ if (examQuestionEntities != null && !examQuestionEntities.isEmpty()) {
|
|
|
+ examQuestionEntities.forEach(qa -> {
|
|
|
+ ExamStudentQuestionScoreInfo examStudentQuestionScoreInfo = buildExamStudentQuestionScore(scoreInfo, qa);
|
|
|
+ resultList.add(examStudentQuestionScoreInfo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return resultList;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public List<ExamStudentEffectiveScoreInfo> getExamStudentEffectiveScoreList(String markingType, List<Long> examStudentIdList) {
|
|
|
+ List<ExamStudentEffectiveScoreInfo> resultList = new ArrayList<>();
|
|
|
+ //考生所有的考试记录
|
|
|
+ List<ExamRecordEntity> allExamRecordList = examRecordRepo.findByExamStudentIdList(examStudentIdList);
|
|
|
+ if (allExamRecordList==null || allExamRecordList.isEmpty()){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<Long> examRecordIdList = allExamRecordList.stream().map(p -> p.getId()).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<ExamRecordDataEntity> allExamRecordDataList = examRecordDataRepo.findByExamRecordIdIn(examRecordIdList);
|
|
|
+ if (allExamRecordDataList==null || allExamRecordDataList.isEmpty()){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<Long> examRecordDataIdList = allExamRecordDataList.stream().map(p -> p.getId()).collect(Collectors.toList());
|
|
|
+ //当前考试记录的所有成绩
|
|
|
+ List<ExamScoreEntity> allExamScoreList = examScoreRepo.findByExamRecordDataIdIn(examRecordDataIdList);
|
|
|
+ if (allExamScoreList==null || allExamScoreList.isEmpty()){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Map<Long, List<ExamRecordEntity>> groupedByExamStudentExamRecordMap = allExamRecordList.stream().collect(Collectors.groupingBy(ExamRecordEntity::getExamStudentId));
|
|
|
+ for (Long examStudentId: groupedByExamStudentExamRecordMap.keySet()){
|
|
|
+ //当前考生的所有考试记录集合
|
|
|
+ List<ExamRecordEntity> curExamRecordList=groupedByExamStudentExamRecordMap.get(examStudentId);
|
|
|
+ List<Long> curExamRecordIdList=curExamRecordList.stream().map(p->p.getId()).collect(Collectors.toList());
|
|
|
+ List<ExamRecordDataEntity> curExamRecordDataList=allExamRecordDataList.stream().
|
|
|
+ filter(p-> curExamRecordIdList.contains(p.getExamRecordId())).collect(Collectors.toList());
|
|
|
+ List<Long> curExamRecordDataIdList = curExamRecordDataList.stream().map(p->p.getId()).collect(Collectors.toList());
|
|
|
+ //当前考生的所有考试成绩集合
|
|
|
+ List<ExamScoreEntity> curExamScoreList=allExamScoreList.stream().
|
|
|
+ filter(p->curExamRecordDataIdList.contains(p.getExamRecordDataId())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //最终生效的成绩
|
|
|
+ ExamScoreEntity effectiveScore=getStudentEffectiveScore(curExamScoreList,markingType);
|
|
|
+ //最终生效的考试记录
|
|
|
+ ExamRecordDataEntity effectiveExamRecordData=curExamRecordDataList.stream().
|
|
|
+ filter(p->p.getId().equals(effectiveScore.getExamRecordDataId())).collect(Collectors.toList()).get(0);
|
|
|
+ ExamRecordEntity effectiveExamRecord = curExamRecordList.stream().
|
|
|
+ filter(p->p.getId().equals(effectiveExamRecordData.getExamRecordId())).collect(Collectors.toList()).get(0);
|
|
|
+ ExamStudentEffectiveScoreInfo info = new ExamStudentEffectiveScoreInfo();
|
|
|
+ info.setExamStudentId(examStudentId);
|
|
|
+ info.setRootOrgId(effectiveExamRecord.getRootOrgId());
|
|
|
+ info.setOrgId(effectiveExamRecord.getOrgId());
|
|
|
+ info.setBasePaperId(effectiveExamRecord.getBasePaperId());
|
|
|
+ info.setCourseId(effectiveExamRecord.getCourseId());
|
|
|
+ info.setScore(effectiveScore.getTotalScore());
|
|
|
+ info.setExamRecordDataId(effectiveExamRecordData.getId());
|
|
|
+ resultList.add(info);
|
|
|
+ }
|
|
|
+
|
|
|
+ return resultList;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 获取考生一次考试的最终有效成绩
|
|
|
+ * @Author lideyin
|
|
|
+ * @Date 2019/7/18 17:49
|
|
|
+ * @Version 1.0
|
|
|
+ */
|
|
|
+ private ExamScoreEntity getStudentEffectiveScore(List<ExamScoreEntity> curExamScoreList,String markingType){
|
|
|
+ if (curExamScoreList==null || curExamScoreList.isEmpty()){
|
|
|
+ throw new StatusException("201101","考试记录不为空,考试分数数据为空");
|
|
|
+ }
|
|
|
+ ExamScoreEntity examScoreEntity;
|
|
|
+ //阅卷方式为全部评阅或客观题分数最高,均取总分最高
|
|
|
+ if (MarkingType.ALL.toString().equals(markingType) || MarkingType.OBJECT_SCORE_MAX.toString().equals(markingType)) {
|
|
|
+ examScoreEntity = curExamScoreList.stream().max(Comparator.comparing(p -> p.getTotalScore())).get();
|
|
|
+ } else if (MarkingType.LAST_SUBMIT.toString().equals(markingType)) {
|
|
|
+ examScoreEntity=curExamScoreList.stream().max(Comparator.comparing(p -> p.getId())).get();
|
|
|
+ } else {
|
|
|
+ throw new StatusException("201001", "阅卷类型不支持");
|
|
|
+ }
|
|
|
+ return examScoreEntity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据考试记录信息和考题信息构建完整 的考生考题作答记录
|
|
|
+ *
|
|
|
+ * @param scoreInfo
|
|
|
+ * @param qa
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private ExamStudentQuestionScoreInfo buildExamStudentQuestionScore(ExamStudentQuestionScoreInfo scoreInfo,
|
|
|
+ ExamQuestionEntity qa) {
|
|
|
+ ExamStudentQuestionScoreInfo examStudentQuestionScoreInfo = new ExamStudentQuestionScoreInfo();
|
|
|
+ examStudentQuestionScoreInfo.setExamRecordDataId(scoreInfo.getExamRecordDataId());
|
|
|
+ examStudentQuestionScoreInfo.setCourseCode(scoreInfo.getCourseCode());
|
|
|
+ examStudentQuestionScoreInfo.setCourseName(scoreInfo.getCourseName());
|
|
|
+ examStudentQuestionScoreInfo.setExamName(scoreInfo.getExamName());
|
|
|
+ examStudentQuestionScoreInfo.setStudentCode(scoreInfo.getStudentCode());
|
|
|
+ examStudentQuestionScoreInfo.setBasePaperId(scoreInfo.getBasePaperId());
|
|
|
+ examStudentQuestionScoreInfo.setMainNumber(qa.getMainNumber());
|
|
|
+ examStudentQuestionScoreInfo.setOrder(qa.getOrder());
|
|
|
+ examStudentQuestionScoreInfo.setStudentScore(qa.getStudentScore());
|
|
|
+ examStudentQuestionScoreInfo.setStudentAnswer(qa.getStudentAnswer());
|
|
|
+ return examStudentQuestionScoreInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据考试id和课程代码获取学生考试成绩的部分信息
|
|
|
+ *
|
|
|
+ * @param examId 考试id
|
|
|
+ * @param courseCode 课程代码
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<ExamStudentQuestionScoreInfo> getPartialExamStudentQuestionScoreList(Long examId, String courseCode) {
|
|
|
+ //查询条件
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder();
|
|
|
+ sqlBuilder.append(EXAM_STUDENT_QUESTION_SCORE_SQL);
|
|
|
+ sqlBuilder.append(" and er.exam_id=" + examId);
|
|
|
+ sqlBuilder.append(" and co.`code`='" + courseCode + "'");
|
|
|
+ List<ExamStudentQuestionScoreInfo> examRecordDataList = jdbcTemplate.query(sqlBuilder.toString(), new RowMapper<ExamStudentQuestionScoreInfo>() {
|
|
|
+ @Override
|
|
|
+ public ExamStudentQuestionScoreInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
|
+ return getExamStudentQuestionScoreInfoByResultSet(rs);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return examRecordDataList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据结果集获取相应的实体对象
|
|
|
+ *
|
|
|
+ * @param rs
|
|
|
+ * @return
|
|
|
+ * @throws SQLException
|
|
|
+ */
|
|
|
+ private ExamStudentQuestionScoreInfo getExamStudentQuestionScoreInfoByResultSet(ResultSet rs) throws SQLException {
|
|
|
+ ExamStudentQuestionScoreInfo info = new ExamStudentQuestionScoreInfo();
|
|
|
+ info.setExamRecordDataId(rs.getLong("exam_record_data_id"));
|
|
|
+ info.setCourseCode(rs.getString("course_code"));
|
|
|
+ info.setCourseName(rs.getString("course_name"));
|
|
|
+ info.setExamName(rs.getString("exam_name"));
|
|
|
+ info.setStudentCode(rs.getString("student_code"));
|
|
|
+ info.setBasePaperId(rs.getString("base_paper_id"));
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+}
|