|
@@ -1,62 +1,33 @@
|
|
|
-/*
|
|
|
- * *************************************************
|
|
|
- * 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.api.commons.enums.ExamType;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
-import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
|
-import cn.com.qmth.examcloud.commons.util.StringUtil;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.bean.StudentBean;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.request.GetStudentListByIdsReq;
|
|
|
-import cn.com.qmth.examcloud.core.basic.api.response.GetStudentListByIdsResp;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.base.jpa.SqlWrapper;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.base.utils.BatchSetDataUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.base.utils.DateUtils;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.*;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.entity.*;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.*;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordQuestionsRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.ExamScoreRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamQuestionEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordQuestionsEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScoreEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamRecordStatus;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.MarkingType;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentService;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.ExportTaskService;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.ExamStudentEffectiveScoreInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.UserDataRules;
|
|
|
-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.support.cache.CacheHelper;
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.*;
|
|
|
-import cn.com.qmth.examcloud.support.enums.ExamProperties;
|
|
|
-import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
|
-import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
|
|
|
-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.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.jdbc.core.RowMapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import javax.persistence.EntityManager;
|
|
|
-import javax.persistence.Query;
|
|
|
-import java.math.BigInteger;
|
|
|
import java.sql.ResultSet;
|
|
|
import java.sql.SQLException;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -68,146 +39,17 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class ExamRecordServiceImpl implements ExamRecordService {
|
|
|
|
|
|
- @Autowired
|
|
|
- private ExportTaskService exportTaskService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ExamScoreRepo examScoreRepo;
|
|
|
|
|
|
@Autowired
|
|
|
private ExamRecordDataRepo examRecordDataRepo;
|
|
|
|
|
|
- @Autowired
|
|
|
- private EntityManager entityManager;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExamStudentService examStudentService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private GainBaseDataService gainBaseDataService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@Autowired
|
|
|
- private ExamRecordEntityConvert examRecordEntityConvert;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private StudentCloudService studentCloudService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExamCaptureRepo examCaptureRepo;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExamCaptureCameraInfoRepo examCaptureCameraInfoRepo;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExamProcessRecordRepo examProcessRecordRepo;
|
|
|
-
|
|
|
-
|
|
|
- private static final String EXAM_RECORD_EXPORT_SQL = "select record_data.id," +
|
|
|
- "record_data.exam_record_status examRecordStatusValue," +
|
|
|
- "record_data.start_time startTime," +
|
|
|
- "record_data.end_time endTime," +
|
|
|
- "record_data.clean_time cleanTime," +
|
|
|
- "record_data.used_exam_time usedExamTime," +
|
|
|
- "record_data.exam_order examOrder," +
|
|
|
- "record_data.is_warn isWarn," +
|
|
|
- "record_data.is_audit isAudit," +
|
|
|
- "record_data.is_illegality isIllegalityValue," +
|
|
|
- "record_data.is_reexamine isReexamine," +
|
|
|
- "record_data.is_continued isContinued," +
|
|
|
- "record_data.is_all_objective_paper isAllObjectivePaper," +
|
|
|
- "record_data.continued_count continuedCount," +
|
|
|
- "record_data.face_success_count faceSuccessCount," +
|
|
|
- "record_data.face_failed_count faceFailedCount," +
|
|
|
- "record_data.face_stranger_count faceStrangerCount," +
|
|
|
- "record_data.face_total_count faceTotalCount," +
|
|
|
- "record_data.face_success_percent faceSuccessPercent," +
|
|
|
- "record_data.face_verify_result faceVerifyResultValue," +
|
|
|
- "record_data.baidu_face_liveness_success_percent baiduFaceLivenessSuccessPercent," +
|
|
|
- "record_data.creation_time creationTime," +
|
|
|
- "record_data.update_time updateTime," +
|
|
|
- "record_data.exam_id examId," +
|
|
|
- "record_data.exam_type examTypeValue," +
|
|
|
- "record_data.exam_student_id examStudentId," +
|
|
|
- "record_data.student_id studentId," +
|
|
|
- "record_data.student_code studentCode," +
|
|
|
- "record_data.student_name studentName," +
|
|
|
- "record_data.identity_number identityNumber," +
|
|
|
- "record_data.course_id courseId," +
|
|
|
- "record_data.course_level courseLevel," +
|
|
|
- "record_data.root_org_id rootOrgId," +
|
|
|
- "record_data.org_id orgId," +
|
|
|
- "record_data.base_paper_id basePaperId," +
|
|
|
- "record_data.paper_type paperType," +
|
|
|
- "record_data.paper_struct_id paperStructId," +
|
|
|
- "record_data.info_collector infoCollector," +
|
|
|
- "record_data.switch_screen_count switchScreenCount," +
|
|
|
- "record_data.exam_stage_id examStageId," +
|
|
|
- "audit.audit_user_name audit_user_name," +
|
|
|
- "eoes.objective_score objectiveTotalScore," +
|
|
|
- "eoes.subjective_score subjectiveTotalScore," +
|
|
|
- "eoes.total_score paperTotalScore," +
|
|
|
- "eoest.grade ," +
|
|
|
- "eoest.specialty_name specialtyName" +
|
|
|
-
|
|
|
- " from ec_oe_exam_record_data record_data " +
|
|
|
- " LEFT JOIN ec_oe_exam_process_record AS process ON record_data.id = process.exam_record_data_id " +
|
|
|
- " LEFT JOIN ec_oe_exam_audit AS audit ON record_data.id = audit.exam_record_data_id " +
|
|
|
- " LEFT JOIN ec_oe_exam_score eoes ON record_data.id = eoes.exam_record_data_id " +
|
|
|
- " LEFT JOIN ec_oe_exam_student eoest ON record_data.exam_student_id = eoest.exam_student_id " +
|
|
|
- " where 1=1";
|
|
|
-
|
|
|
- /**
|
|
|
- * ec_oe_exam_record_data 查询sql
|
|
|
- */
|
|
|
- private static final String EXAM_RECORD_HEAD_SQL = "select record_data.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_data.exam_id exam_id," +
|
|
|
- "record_data.exam_type exam_type," +
|
|
|
- "record_data.exam_student_id exam_student_id," +
|
|
|
- "record_data.student_id student_id," +
|
|
|
- "record_data.student_code student_code," +
|
|
|
- "record_data.student_name student_name," +
|
|
|
- "record_data.identity_number identity_number," +
|
|
|
- "record_data.course_id course_id," +
|
|
|
- "record_data.course_level course_level," +
|
|
|
- "record_data.root_org_id root_org_id," +
|
|
|
- "record_data.org_id org_id," +
|
|
|
- "record_data.base_paper_id base_paper_id," +
|
|
|
- "record_data.paper_type paper_type," +
|
|
|
- "record_data.paper_struct_id paper_struct_id," +
|
|
|
- "record_data.info_collector info_collector," +
|
|
|
- "record_data.switch_screen_count switchScreenCount," +
|
|
|
- "record_data.exam_stage_id examStageId," +
|
|
|
- "audit.audit_user_name audit_user_name ";
|
|
|
-
|
|
|
- private static final String EXAM_RECORD_FROM_SQL = " from ec_oe_exam_record_data record_data " +
|
|
|
- " LEFT JOIN ec_oe_exam_process_record AS process ON record_data.id = process.exam_record_data_id " +
|
|
|
- " LEFT JOIN ec_oe_exam_audit AS audit ON record_data.id = audit.exam_record_data_id " +
|
|
|
- " where 1=1";
|
|
|
+ private ExamRecordQuestionsRepo examRecordQuestionsRepo;
|
|
|
|
|
|
/**
|
|
|
* 考生作答成绩
|
|
@@ -220,194 +62,6 @@ public class ExamRecordServiceImpl implements ExamRecordService {
|
|
|
"inner join ec_e_exam ex on erd.exam_id=ex.id " +
|
|
|
"where 1=1 ";
|
|
|
|
|
|
- @Autowired
|
|
|
- private ExamRecordQuestionsRepo examRecordQuestionsRepo;
|
|
|
-
|
|
|
- @Override
|
|
|
- public Page<ExamRecordInfo> getExamRecordDetailListForPage(UserDataRules uds, ExamRecordQuery query) {
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
-
|
|
|
- Page<ExamRecordInfo> page = _getExamRecordDetailListForPage(uds, query);
|
|
|
- return this.loadData(page, query.getExamId());
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 考试 是否开启身份检测
|
|
|
- */
|
|
|
- private boolean isFaceEnable(Long examId) {
|
|
|
- ExamPropertyCacheBean examProperty = CacheHelper.getExamProperty(examId, ExamProperties.IS_FACE_ENABLE.name());
|
|
|
- String examValue = examProperty.getValue();
|
|
|
- if (StringUtils.isBlank(examValue)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (StringUtil.isTrue(examValue)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Page<ExamRecordInfo> getExamRecordWaitingAuditList(UserDataRules uds, ExamRecordQuery query) {
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
- //默认条件
|
|
|
- query.setIsAudit(false);
|
|
|
-
|
|
|
- // 改为只查询“需要审核的”
|
|
|
- // query.setIsWarn(true);
|
|
|
-
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
- return this.getExamRecordList(uds, query);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Long getExamRecordWaitingAuditNextId(UserDataRules uds, ExamRecordQuery query, Long examRecordDataId, String next) {
|
|
|
- //****注意按ID倒序排列的****,上一条,下一条
|
|
|
- if (uds.getCourseRule().assertEmptyQueryResult() || uds.getOrgRule().assertEmptyQueryResult()) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
- Check.isBlank(next, "[next]参数不能为空!");
|
|
|
- //默认条件
|
|
|
- query.setIsWarn(true);
|
|
|
- query.setIsAudit(false);
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
- //查询条件
|
|
|
- StringBuilder sqlBuilder = new StringBuilder();
|
|
|
- if ("1".equals(next)) {//下一条
|
|
|
- sqlBuilder.append("select max(record_data.id) id from ec_oe_exam_record_data record_data where 1 = 1 ");
|
|
|
- } else if ("0".equals(next)) {//上一条
|
|
|
- sqlBuilder.append("select min(record_data.id) id from ec_oe_exam_record_data record_data where 1 = 1 ");
|
|
|
- }
|
|
|
- sqlBuilder.append(buildExamRecordCommonSelectCondition(uds, query));
|
|
|
-
|
|
|
- if (query.getIsWarn() != null) {
|
|
|
- sqlBuilder.append(" and record_data.is_warn = ").append(query.getIsWarn() ? "1" : "0");
|
|
|
- }
|
|
|
-
|
|
|
- sqlBuilder.append(" and record_data.is_audit = 0");
|
|
|
-
|
|
|
- sqlBuilder.append(" and record_data.is_illegality = 0");
|
|
|
-
|
|
|
- if ("1".equals(next)) {//下一条
|
|
|
- sqlBuilder.append(" and record_data.id < ");
|
|
|
- sqlBuilder.append(examRecordDataId);
|
|
|
- } else if ("0".equals(next)) {//上一条
|
|
|
- sqlBuilder.append(" and record_data.id > ");
|
|
|
- sqlBuilder.append(examRecordDataId);
|
|
|
- }
|
|
|
- List<Long> ids = jdbcTemplate.query(sqlBuilder.toString(), (rs, rowNum) -> rs.getLong("id"));
|
|
|
- return CollectionUtils.isEmpty(ids) ? null : ids.get(0);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 考试明细查询
|
|
|
- *
|
|
|
- * @param query
|
|
|
- * @return
|
|
|
- */
|
|
|
- private Page<ExamRecordInfo> _getExamRecordDetailListForPage(UserDataRules uds, ExamRecordQuery query) {
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
- //查询条件
|
|
|
- StringBuilder sqlBuilder = new StringBuilder();
|
|
|
- sqlBuilder.append(EXAM_RECORD_FROM_SQL);
|
|
|
- sqlBuilder.append(buildExamRecordCommonSelectCondition(uds, query));
|
|
|
- sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))");
|
|
|
- sqlBuilder.append(" group by record_data.id ");
|
|
|
- //分页条件
|
|
|
- int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
|
- List<ExamRecordDataEntity> examRecordDataList = jdbcTemplate.query(
|
|
|
- EXAM_RECORD_HEAD_SQL + sqlBuilder.toString() + " order by record_data.id desc limit " + currentNum + "," + query.getPageSize(),
|
|
|
- new RowMapper<ExamRecordDataEntity>() {
|
|
|
- @Override
|
|
|
- public ExamRecordDataEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
|
- return getExamRecordDataEntityByResultSet(rs);
|
|
|
- }
|
|
|
- });
|
|
|
- //查询总数
|
|
|
- // long total = countExamRecordDetailListForPage(query);
|
|
|
- long total = jdbcTemplate.queryForObject("SELECT count(1) FROM (SELECT record_data.id " + sqlBuilder.toString() + ") temtb", Long.class);
|
|
|
- Pageable pageable = PageRequest.of(query.getPageNo() - 1, query.getPageSize());
|
|
|
- Page<ExamRecordDataEntity> page = new PageImpl<ExamRecordDataEntity>(examRecordDataList, pageable, total);
|
|
|
- Page<ExamRecordInfo> ret = examRecordEntityConvert.of(page);
|
|
|
- fillStage(ret.getContent());
|
|
|
- return ret;
|
|
|
- }
|
|
|
-
|
|
|
- private void fillStage(List<ExamRecordInfo> list, Long taskId) {
|
|
|
- if (CollectionUtils.isEmpty(list)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for (ExamRecordInfo info : list) {
|
|
|
- exportTaskService.checkStopExportTaskById(taskId);
|
|
|
- if (info.getExamStageId() != null) {
|
|
|
- ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
|
|
|
- info.setExamStageOrder(stage.getStageOrder());
|
|
|
- info.setStageStartTime(stage.getStartTime());
|
|
|
- info.setStageEndTime(stage.getEndTime());
|
|
|
- info.setExamStage(stage.getStageOrder() + "("
|
|
|
- + DateUtil.format(stage.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
|
|
|
- + DateUtil.format(stage.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void fillStage(List<ExamRecordInfo> list) {
|
|
|
- if (CollectionUtils.isEmpty(list)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for (ExamRecordInfo info : list) {
|
|
|
- if (info.getExamStageId() != null) {
|
|
|
- ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
|
|
|
- info.setExamStageOrder(stage.getStageOrder());
|
|
|
- info.setStageStartTime(stage.getStartTime());
|
|
|
- info.setStageEndTime(stage.getEndTime());
|
|
|
- info.setExamStage(stage.getStageOrder() + "("
|
|
|
- + DateUtil.format(stage.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
|
|
|
- + DateUtil.format(stage.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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"));
|
|
|
- examRecordData.setAuditUserName(rs.getString("audit_user_name"));
|
|
|
- examRecordData.setSwitchScreenCount(rs.getInt("switchScreenCount"));
|
|
|
- if (rs.getString("examStageId") != null) {
|
|
|
- examRecordData.setExamStageId(rs.getLong("examStageId"));
|
|
|
- }
|
|
|
-
|
|
|
- return examRecordData;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 构建查询 考试明细sql语句
|
|
|
*
|
|
@@ -536,168 +190,12 @@ public class ExamRecordServiceImpl implements ExamRecordService {
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 监考待审
|
|
|
- * 查询无异常的数据和有异常未审核的数据
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Page<ExamRecordInfo> getExamRecordList(UserDataRules uds, ExamRecordQuery query) {
|
|
|
- if (uds.getCourseRule().assertEmptyQueryResult() || uds.getOrgRule().assertEmptyQueryResult()) {
|
|
|
- return Page.empty();
|
|
|
- }
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- //查询条件
|
|
|
- StringBuilder sqlBuilder = new StringBuilder();
|
|
|
- //待审核(按原先的sql,多了一个ip字段)
|
|
|
- sqlBuilder.append(EXAM_RECORD_FROM_SQL);
|
|
|
- sqlBuilder.append(buildExamRecordCommonSelectCondition(uds, 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))");
|
|
|
- }*/
|
|
|
- if (query.getIsWarn() != null) {
|
|
|
- sqlBuilder.append(" and record_data.is_warn = ").append(query.getIsWarn() ? "1" : "0");
|
|
|
- }
|
|
|
-
|
|
|
- sqlBuilder.append(" and record_data.is_audit = 0");
|
|
|
-
|
|
|
- sqlBuilder.append(" and record_data.is_illegality = 0");
|
|
|
-
|
|
|
- //查询分页记录
|
|
|
- sqlBuilder.append(" group by record_data.id ");
|
|
|
- // sqlBuilder.append(" order by record_data.id desc");
|
|
|
- //分页条件
|
|
|
- int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
|
- // sqlBuilder.append(" limit " + currentNum + "," + query.getPageSize());
|
|
|
- List<ExamRecordDataEntity> examRecordDataList = jdbcTemplate.query(
|
|
|
- EXAM_RECORD_HEAD_SQL + sqlBuilder.toString() + " order by record_data.id desc limit " + currentNum + "," + query.getPageSize(), new RowMapper<ExamRecordDataEntity>() {
|
|
|
- @Override
|
|
|
- public ExamRecordDataEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
|
- return getExamRecordDataEntityByResultSet(rs);
|
|
|
- }
|
|
|
- });
|
|
|
- //查询总数
|
|
|
- // long total = countExamRecordListForPage(query);
|
|
|
- long total = jdbcTemplate.queryForObject("SELECT count(1) FROM (SELECT record_data.id " + sqlBuilder.toString() + ") temtb", Long.class);
|
|
|
- Pageable pageable = PageRequest.of(query.getPageNo() - 1, query.getPageSize());
|
|
|
-
|
|
|
- Page<ExamRecordDataEntity> page = new PageImpl<ExamRecordDataEntity>(examRecordDataList, pageable, total);
|
|
|
- return examRecordEntityConvert.of(page);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- @Override
|
|
|
- public List<Long> getExamRecordingStudentIds(Long examId) {
|
|
|
- Check.isNull(examId, "考试ID不能为空!");
|
|
|
-
|
|
|
- SqlWrapper wrapper = new SqlWrapper()
|
|
|
- .select("record_data.exam_student_id")
|
|
|
- .from("ec_oe_exam_record_data").as("data")
|
|
|
- .where().eq("data.exam_record_status", ExamRecordStatus.EXAM_ING.name())
|
|
|
- .and().eq("record_data.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);
|
|
|
}
|
|
|
|
|
|
- private Page<ExamRecordInfo> loadData(Page<ExamRecordInfo> page, Long examId) {
|
|
|
- if (CollectionUtils.isEmpty(page.getContent())) {
|
|
|
- return page;
|
|
|
- }
|
|
|
-
|
|
|
- //获取考试名称
|
|
|
- ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(examId);
|
|
|
-
|
|
|
- //考试 是否开启身份检测
|
|
|
- final boolean faceEnable;
|
|
|
- if (ExamType.ONLINE.name().equals(examBean.getExamType())) {
|
|
|
- faceEnable = this.isFaceEnable(examId);
|
|
|
- } else {
|
|
|
- faceEnable = false;
|
|
|
- }
|
|
|
-
|
|
|
- //缓存
|
|
|
- Map<String, Object> cahcheMap = new HashMap<>();
|
|
|
-
|
|
|
- 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"));
|
|
|
-
|
|
|
- e.setShowReAudit(faceEnable);
|
|
|
- });
|
|
|
-
|
|
|
- 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(UserDataRules uds, ExamRecordQuery query) {
|
|
|
if (uds.getCourseRule().assertEmptyQueryResult() || uds.getOrgRule().assertEmptyQueryResult()) {
|
|
@@ -711,253 +209,6 @@ public class ExamRecordServiceImpl implements ExamRecordService {
|
|
|
return jdbcTemplate.queryForObject(sqlBuilder.toString(), Long.class);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<ExamRecordInfo> getExamRecordDetailListForAsync(UserDataRules uds, ExamRecordQuery query) {
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_END.name());
|
|
|
- query.addRecordStatus(ExamRecordStatus.EXAM_OVERDUE.name());
|
|
|
-
|
|
|
- List<ExamRecordInfo> examRecordDataList = new ArrayList<ExamRecordInfo>();
|
|
|
- int pageNo = 1;
|
|
|
- int pageSize = 5000;
|
|
|
- for (; ; ) {
|
|
|
- exportTaskService.checkStopExportTaskById(query.getTaskId());
|
|
|
- List<ExamRecordInfo> tem = getExamRecordDetailPageForExport(uds, query, pageNo, pageSize);
|
|
|
- if (tem == null || tem.size() == 0) {
|
|
|
- break;
|
|
|
- } else {
|
|
|
- pageNo++;
|
|
|
- examRecordDataList.addAll(tem);
|
|
|
- }
|
|
|
- }
|
|
|
- if (examRecordDataList == null || examRecordDataList.size() == 0) {
|
|
|
- return examRecordDataList;
|
|
|
- }
|
|
|
- for (ExamRecordInfo erInfo : examRecordDataList) {
|
|
|
- exportTaskService.checkStopExportTaskById(query.getTaskId());
|
|
|
- setInfo(erInfo, query.getExamId());
|
|
|
- }
|
|
|
- setPhone(examRecordDataList, query.getRootOrgId(), query.getTaskId());
|
|
|
- String examType = examRecordDataList.get(0).getExamType();
|
|
|
- if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
|
|
|
- setVirtualCameraNames(examRecordDataList, query.getTaskId());
|
|
|
- setIps(examRecordDataList, query.getTaskId());
|
|
|
- }
|
|
|
- fillStage(examRecordDataList, query.getTaskId());
|
|
|
- return examRecordDataList;
|
|
|
- }
|
|
|
-
|
|
|
- @Deprecated
|
|
|
- @Override
|
|
|
- public void refreshCaptureStatistic(Long examId) {
|
|
|
- List<ExamRecordDataEntity> data = examRecordDataRepo.findDataByExamId(examId);
|
|
|
-
|
|
|
- for (ExamRecordDataEntity entity : data) {
|
|
|
- //如果开启了活检
|
|
|
- if (FaceBiopsyHelper.isFaceEnable(entity.getRootOrgId(), examId, entity.getStudentId())) {
|
|
|
- List<ExamCaptureEntity> captureEntities = examCaptureRepo.findByExamRecordDataId(entity.getId());
|
|
|
-
|
|
|
- Double succPercent = entity.getFaceSuccessPercent();
|
|
|
- Double livenessSuccessPercent = entity.getBaiduFaceLivenessSuccessPercent();
|
|
|
-
|
|
|
- //人脸识别阀值
|
|
|
- String warnThresholdStr = ExamCacheTransferHelper.getCachedExamProperty(examId,
|
|
|
- entity.getStudentId(), ExamProperties.WARN_THRESHOLD.name()).getValue();
|
|
|
- if (StringUtils.isBlank(warnThresholdStr)) {
|
|
|
- throw new StatusException("400101", "人脸检测预警阈值未设置");
|
|
|
- }
|
|
|
-
|
|
|
- //人脸真实性(百度活体检测)通过阀值
|
|
|
- String liveWarnThresholdStr = ExamCacheTransferHelper.getCachedExamProperty(examId,
|
|
|
- entity.getStudentId(), ExamProperties.LIVING_WARN_THRESHOLD.name()).getValue();
|
|
|
- if (StringUtils.isBlank(liveWarnThresholdStr)) {
|
|
|
- throw new StatusException("400102", "人脸真实性阈值未设置");
|
|
|
- }
|
|
|
-
|
|
|
- Double warnThreshold = Double.parseDouble(warnThresholdStr);
|
|
|
- Double livenessThreshold = Double.parseDouble(liveWarnThresholdStr);
|
|
|
- boolean checkFailed = succPercent < warnThreshold || livenessSuccessPercent < livenessThreshold;
|
|
|
-
|
|
|
- //虚拟摄像头进入待审核,且有虚拟摄像头的
|
|
|
- String valueSql = "SELECT value FROM ec_e_exam_prop WHERE exam_id =" + examId + " AND key_id=45";
|
|
|
- List<Boolean> list = jdbcTemplate.query(valueSql, (rs, rowNum) -> rs.getBoolean("value"));
|
|
|
- boolean hasVirtualCamera = !CollectionUtils.isEmpty(list) && list.get(0) &&
|
|
|
- captureEntities.stream().anyMatch(e -> e.getHasVirtualCamera() != null && e.getHasVirtualCamera());
|
|
|
-
|
|
|
- entity.setIsWarn(hasVirtualCamera || checkFailed);
|
|
|
-
|
|
|
- examRecordDataRepo.save(entity);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void setPhone(List<ExamRecordInfo> examRecordDataList, Long rootOrgId, Long taskId) {
|
|
|
- GetStudentListByIdsReq req = new GetStudentListByIdsReq();
|
|
|
- BatchSetDataUtil<ExamRecordInfo> tool = new BatchSetDataUtil<ExamRecordInfo>() {
|
|
|
- @Override
|
|
|
- public void setData(List<ExamRecordInfo> dataList) {
|
|
|
- exportTaskService.checkStopExportTaskById(taskId);
|
|
|
- req.setRootOrgId(rootOrgId);
|
|
|
- List<Long> ids = dataList.stream().map(dto -> dto.getStudentId()).distinct().collect(Collectors.toList());
|
|
|
- req.setStudentIdList(ids);
|
|
|
- GetStudentListByIdsResp resp = studentCloudService.getStudentListByIds(req);
|
|
|
- if (resp.getStudentBeanList() != null && resp.getStudentBeanList().size() > 0) {
|
|
|
- Map<Long, String> map = resp.getStudentBeanList().stream()
|
|
|
- .collect(Collectors.toMap(StudentBean::getId, account -> (account.getPhoneNumber() == null ? "" : account.getPhoneNumber())));
|
|
|
- for (ExamRecordInfo erInfo : dataList) {
|
|
|
- erInfo.setPhone(map.get(erInfo.getStudentId()));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
- tool.setDataForBatch(examRecordDataList, 1000);
|
|
|
- }
|
|
|
-
|
|
|
- private void setVirtualCameraNames(List<ExamRecordInfo> examRecordDataList, Long taskId) {
|
|
|
- BatchSetDataUtil<ExamRecordInfo> tool = new BatchSetDataUtil<ExamRecordInfo>() {
|
|
|
- @Override
|
|
|
- public void setData(List<ExamRecordInfo> dataList) {
|
|
|
- exportTaskService.checkStopExportTaskById(taskId);
|
|
|
- List<Long> ids = dataList.stream().map(dto -> dto.getId()).distinct().collect(Collectors.toList());
|
|
|
- Map<Long, Set<String>> map = new HashMap<>();
|
|
|
- List<ExamCaptureCameraInfoEntity> examCaptureList = examCaptureCameraInfoRepo.findByExamRecordDataIdInAndVirtualCamera(ids, true);
|
|
|
- if (examCaptureList != null && examCaptureList.size() > 0) {
|
|
|
- for (ExamCaptureCameraInfoEntity examCapture : examCaptureList) {
|
|
|
- Set<String> virtualCameraNames = map.get(examCapture.getExamRecordDataId());
|
|
|
- if (virtualCameraNames == null) {
|
|
|
- virtualCameraNames = new HashSet<String>();
|
|
|
- map.put(examCapture.getExamRecordDataId(), virtualCameraNames);
|
|
|
- }
|
|
|
- String cameraInfos = examCapture.getName();
|
|
|
- if (StringUtils.isNotBlank(cameraInfos)) {
|
|
|
- virtualCameraNames.add(cameraInfos);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for (ExamRecordInfo erInfo : dataList) {
|
|
|
- erInfo.setVirtualCameraNames(getStrFromSet(map.get(erInfo.getId())));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
- tool.setDataForBatch(examRecordDataList, 1000);
|
|
|
- }
|
|
|
-
|
|
|
- private void setIps(List<ExamRecordInfo> examRecordDataList, Long taskId) {
|
|
|
- BatchSetDataUtil<ExamRecordInfo> tool = new BatchSetDataUtil<ExamRecordInfo>() {
|
|
|
- @Override
|
|
|
- public void setData(List<ExamRecordInfo> dataList) {
|
|
|
- exportTaskService.checkStopExportTaskById(taskId);
|
|
|
- List<Long> ids = dataList.stream().map(dto -> dto.getId()).distinct().collect(Collectors.toList());
|
|
|
- Map<Long, Set<String>> map = new HashMap<>();
|
|
|
- List<ExamProcessRecordEntity> list = examProcessRecordRepo.findByExamRecordDataIdIn(ids);
|
|
|
- if (list != null && list.size() > 0) {
|
|
|
- for (ExamProcessRecordEntity ep : list) {
|
|
|
- Set<String> ips = map.get(ep.getExamRecordDataId());
|
|
|
- if (ips == null) {
|
|
|
- ips = new HashSet<String>();
|
|
|
- map.put(ep.getExamRecordDataId(), ips);
|
|
|
- }
|
|
|
- String ip = ep.getSourceIp();
|
|
|
- if (StringUtils.isNotBlank(ip)) {
|
|
|
- ips.add(ip);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for (ExamRecordInfo erInfo : dataList) {
|
|
|
- erInfo.setIp(getStrFromSet(map.get(erInfo.getId())));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
- tool.setDataForBatch(examRecordDataList, 1000);
|
|
|
- }
|
|
|
-
|
|
|
- private String getStrFromSet(Set<String> set) {
|
|
|
- if (set == null || set.size() == 0) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- StringJoiner sj = new StringJoiner(";");
|
|
|
- for (String cameraName : set) {
|
|
|
- sj.add(cameraName);
|
|
|
- }
|
|
|
- return sj.toString();
|
|
|
- }
|
|
|
-
|
|
|
- private void setInfo(ExamRecordInfo info, Long examId) {
|
|
|
- info.setDataId(info.getId());
|
|
|
- if (info.getExamTypeValue() != null) {
|
|
|
- info.setExamType(info.getExamTypeValue().name());
|
|
|
- }
|
|
|
- CourseCacheBean courseBean = ExamCacheTransferHelper.getCachedCourse(info.getCourseId());
|
|
|
-
|
|
|
- info.setCourseCode(courseBean.getCode());
|
|
|
- info.setCourseName(courseBean.getName());
|
|
|
- info.setCourseNameAndCode(courseBean.getName() + "(" + courseBean.getCode() + ")");
|
|
|
- info.setCourseLevel(CourseLevel.getCourseLevelTitle(courseBean.getLevel()));
|
|
|
-
|
|
|
- OrgCacheBean orgBean = gainBaseDataService.getOrgBean(info.getOrgId());
|
|
|
- info.setOrgName(orgBean.getName());
|
|
|
- //封装详细数据
|
|
|
- if (info.getStartTime() != null) {
|
|
|
- info.setPaperStartTime(DateUtils.format(info.getStartTime()));
|
|
|
- } else {
|
|
|
- info.setPaperStartTime("");
|
|
|
- }
|
|
|
- if (info.getEndTime() != null) {
|
|
|
- info.setPaperSubmitTime(DateUtils.format(info.getEndTime()));
|
|
|
- info.setIsSubmit("是");
|
|
|
- } else {
|
|
|
- info.setPaperSubmitTime("");
|
|
|
- info.setIsSubmit("否");
|
|
|
- }
|
|
|
-
|
|
|
- //每次考试持续时间
|
|
|
- if (info.getStartTime() != null && info.getEndTime() != null) {
|
|
|
- if (info.getUsedExamTime() != null) {
|
|
|
- info.setExamTime(info.getUsedExamTime() > 0 ? DateUtils.diff(info.getUsedExamTime()) : "");
|
|
|
- }
|
|
|
- } else {
|
|
|
- info.setExamTime("");
|
|
|
- }
|
|
|
-
|
|
|
- //违纪标志
|
|
|
- info.setDisciplineSign(TrueFalse.of(info.getIsWarn()));
|
|
|
- info.setIsIllegality(TrueFalse.of(info.getIsIllegalityValue()));
|
|
|
-
|
|
|
- ExamRecordStatus status = info.getExamRecordStatusValue();
|
|
|
- if (status != null) {
|
|
|
- info.setExamRecordStatus(status.name());
|
|
|
- }
|
|
|
- IsSuccess result = info.getFaceVerifyResultValue();
|
|
|
- if (result != null) {
|
|
|
- info.setFaceVerifyResult(result.getDesc());
|
|
|
- }
|
|
|
-
|
|
|
- ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(examId);
|
|
|
- info.setExamName(examBean.getName());
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private List<ExamRecordInfo> getExamRecordDetailPageForExport(UserDataRules uds, ExamRecordQuery query, int pageNo, int pageSize) {
|
|
|
- StringBuilder sqlBuilder = new StringBuilder();
|
|
|
- sqlBuilder.append(EXAM_RECORD_EXPORT_SQL);
|
|
|
- sqlBuilder.append(buildExamRecordCommonSelectCondition(uds, query));
|
|
|
- sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))");
|
|
|
- sqlBuilder.append(" group by record_data.id ");
|
|
|
- //根据ip查询
|
|
|
- /*if (StringUtils.isNoneBlank(query.getIp())) {
|
|
|
- sqlBuilder.append(" having ip like '%"+query.getIp()+"%' ");
|
|
|
- }*/
|
|
|
- int currentNum = (pageNo - 1) * pageSize;
|
|
|
- sqlBuilder.append(" order by record_data.id limit " + currentNum + "," + pageSize);
|
|
|
-
|
|
|
- RowMapper<ExamRecordInfo> rowMapper = new BeanPropertyRowMapper<ExamRecordInfo>(ExamRecordInfo.class);
|
|
|
- List<ExamRecordInfo> ret = jdbcTemplate.query(sqlBuilder.toString(), rowMapper);
|
|
|
- return ret;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public List<ExamStudentQuestionScoreInfo> getExamStudentQuestionScoreList(Long examId, String courseCode) {
|
|
|
//最终返回的结果集
|