|
@@ -1,60 +1,32 @@
|
|
|
-/*
|
|
|
- * *************************************************
|
|
|
- * Copyright (c) 2018 QMTH. All Rights Reserved.
|
|
|
- * Created by Deason on 2018-08-27 16:24:08.
|
|
|
- * *************************************************
|
|
|
- */
|
|
|
-
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
-import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.jpa.Searcher;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.jpa.SpecUtils;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.base.jpa.SqlWrapper;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.utils.CommonUtil;
|
|
|
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.enums.AuditStatus;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.DisciplineType;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.FaceVerifyResult;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.*;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.bean.UserDataRules;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.*;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.RedoAuditInfo;
|
|
|
import cn.com.qmth.examcloud.marking.api.MarkWorkCloudService;
|
|
|
import cn.com.qmth.examcloud.marking.api.request.AppendMarkWorkPaperReq;
|
|
|
-import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.ExamStageCacheBean;
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.OrgCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.enums.FaceBiopsyScheme;
|
|
|
-import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
|
import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
|
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.hibernate.query.NativeQuery;
|
|
|
-import org.hibernate.transform.Transformers;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.PageImpl;
|
|
|
-import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import javax.persistence.EntityManager;
|
|
|
-import javax.persistence.Query;
|
|
|
-import java.math.BigInteger;
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import static cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.ExamAuditMapper.EXAM_RECORD_DATA_ID;
|
|
|
|
|
|
/**
|
|
|
* 考试记录审核相关接口
|
|
@@ -65,18 +37,12 @@ import static cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.ExamAud
|
|
|
@Service
|
|
|
public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
|
|
|
- @Autowired
|
|
|
- private ExportTaskService exportTaskService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ExamAuditRepo examAuditRepo;
|
|
|
|
|
|
@Autowired
|
|
|
private ExamScoreRepo examScoreRepo;
|
|
|
|
|
|
- @Autowired
|
|
|
- private EntityManager entityManager;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ExamRecordDataRepo examRecordDataRepo;
|
|
|
|
|
@@ -86,9 +52,6 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
@Autowired
|
|
|
private ExamRecordForMarkingRepo examRecordForMarkingRepo;
|
|
|
|
|
|
- @Autowired
|
|
|
- private GainBaseDataService gainBaseDataService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ExamScorePushQueueService examScorePushQueueService;
|
|
|
|
|
@@ -96,14 +59,11 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
private ExamScoreObtainQueueService examScoreObtainQueueService;
|
|
|
|
|
|
@Autowired
|
|
|
- MarkWorkCloudService markWorkCloudService;
|
|
|
+ private MarkWorkCloudService markWorkCloudService;
|
|
|
|
|
|
@Autowired
|
|
|
private ExamFaceLivenessVerifyRepo examFaceLivenessVerifyRepo;
|
|
|
|
|
|
- @Autowired
|
|
|
- private IllegallyTypeService illegallyTypeService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private FaceBiopsyItemRepo faceBiopsyItemRepo;
|
|
|
|
|
@@ -114,10 +74,10 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
private ExamStudentFinalScoreService examStudentFinalScoreService;
|
|
|
|
|
|
@Autowired
|
|
|
- IllegallyTypeRepo illegallyTypeRepo;
|
|
|
+ private IllegallyTypeRepo illegallyTypeRepo;
|
|
|
|
|
|
@Autowired
|
|
|
- ExamStudentFinalScoreRepo examStudentFinalScoreRepo;
|
|
|
+ private ExamStudentFinalScoreRepo examStudentFinalScoreRepo;
|
|
|
|
|
|
/**
|
|
|
* 活体检测失败自动审核
|
|
@@ -134,274 +94,6 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
*/
|
|
|
private static final String AUDIT_USER_NAME = "SYSTEM";
|
|
|
|
|
|
- @SuppressWarnings({"deprecation", "unchecked", "rawtypes"})
|
|
|
- @Override
|
|
|
- public Page<ExamAuditInfo> getExamAuditList(UserDataRules uds, ExamAuditQuery query) {
|
|
|
- if (uds.getCourseRule().assertEmptyQueryResult() || uds.getOrgRule().assertEmptyQueryResult()) {
|
|
|
- return Page.empty();
|
|
|
- }
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
- //封装查询条件
|
|
|
- Pageable pageable = SpecUtils.buildPageable(query.getPageNo(), query.getPageSize());
|
|
|
-
|
|
|
- final String columns = ExamAuditMapper.defaultColumns();
|
|
|
- SqlWrapper wrapper = getSqlWrapper(uds, query);
|
|
|
-
|
|
|
- long totalSize = 0;
|
|
|
- //查询总记录数
|
|
|
- if (query.getSelectType() == null || query.getSelectType() != SelectType.EXPORT) {
|
|
|
- final String count = "count(0)";
|
|
|
- final String leftJoin = "LEFT JOIN ec_oe_exam_process_record AS process ON record.id = process.exam_record_data_id";
|
|
|
- String countSql = wrapper.build().replace(columns, count).replace(leftJoin, " ");
|
|
|
- Query countQuery = entityManager.createNativeQuery(countSql);
|
|
|
- BigInteger element = (BigInteger) countQuery.getSingleResult();
|
|
|
- totalSize = element.longValue();
|
|
|
- if (totalSize == 0) {
|
|
|
- return new PageImpl<>(Lists.newArrayList(), pageable, totalSize);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- wrapper.groupBy("record.id ");
|
|
|
- //查询分页记录
|
|
|
- wrapper.orderBy("record.update_time", true);//需求调整20200816:按审核时间排序
|
|
|
- Query dataQuery = entityManager.createNativeQuery(wrapper.build());
|
|
|
-
|
|
|
- // dataQuery.unwrap(SQLQuery.class).setResultTransformer(Transformers.aliasToBean(HashMap.class));
|
|
|
- dataQuery.unwrap(NativeQuery.class).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
|
|
|
- if (query.getSelectType() == null || query.getSelectType() != SelectType.EXPORT) {
|
|
|
- dataQuery.setFirstResult((int) pageable.getOffset());
|
|
|
- dataQuery.setMaxResults(pageable.getPageSize());
|
|
|
- }
|
|
|
- List resultList = dataQuery.getResultList();
|
|
|
-
|
|
|
- List<ExamAuditInfo> list = ExamAuditEntityConvert.of(resultList);
|
|
|
-
|
|
|
- for (ExamAuditInfo examAuditInfo : list) {
|
|
|
- OrgCacheBean orgBean = gainBaseDataService.getOrgBean(examAuditInfo.getOrgId());
|
|
|
- examAuditInfo.setOrgName(orgBean.getName());
|
|
|
-
|
|
|
- //将违纪类型重赋值为文本,万恶的历史原因,不该这么做的。 待优化
|
|
|
- if (StringUtils.isNotEmpty(examAuditInfo.getDisciplineType())) {
|
|
|
- IllegallyTypeEntity illegallyType = illegallyTypeService.getIllegallyType(orgBean.getRootId(), examAuditInfo.getDisciplineType());
|
|
|
- examAuditInfo.setDisciplineType(illegallyType.getName());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- CourseCacheBean courseBean = ExamCacheTransferHelper.getCachedCourse(examAuditInfo.getCourseId());
|
|
|
- examAuditInfo.setCourseName(courseBean.getName());
|
|
|
- examAuditInfo.setCourseCode(courseBean.getCode());
|
|
|
- examAuditInfo.setCourseLevel(CourseLevel.getCourseLevel(courseBean.getLevel()).getTitle());
|
|
|
-
|
|
|
- //考试名称
|
|
|
- ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
|
- examAuditInfo.setExamName(examBean.getName());
|
|
|
-
|
|
|
- //客观分
|
|
|
- ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examAuditInfo.getExamRecordDataId());
|
|
|
- examAuditInfo.setObjectiveScore(String.valueOf(examScore.getObjectiveScore()));
|
|
|
-
|
|
|
- }
|
|
|
- fillStage(list);
|
|
|
- return new PageImpl<ExamAuditInfo>(list, pageable, totalSize);
|
|
|
- }
|
|
|
-
|
|
|
- @SuppressWarnings({"rawtypes", "deprecation"})
|
|
|
- private List getExamAuditForAsyncPage(UserDataRules uds, ExamAuditQuery query, int pageNo, int pageSize) {
|
|
|
- SqlWrapper wrapper = getSqlWrapper(uds, query);
|
|
|
-
|
|
|
- wrapper.groupBy("record.id ");
|
|
|
- //查询分页记录
|
|
|
- wrapper.orderBy("record.update_time", true);//需求调整20200816:按审核时间排序
|
|
|
- Query dataQuery = entityManager.createNativeQuery(wrapper.build());
|
|
|
- dataQuery.unwrap(NativeQuery.class).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
|
|
|
- int currentNum = (pageNo - 1) * pageSize;
|
|
|
- dataQuery.setFirstResult(currentNum);
|
|
|
- dataQuery.setMaxResults(pageSize);
|
|
|
- List resultList = dataQuery.getResultList();
|
|
|
- return resultList;
|
|
|
- }
|
|
|
-
|
|
|
- @SuppressWarnings({"rawtypes", "unchecked"})
|
|
|
- @Override
|
|
|
- public List<ExamAuditInfo> getExamAudit(UserDataRules uds, ExamAuditQuery query) {
|
|
|
- Check.isNull(query, "查询参数不能为空!");
|
|
|
- Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
- List resultList = new ArrayList<ExamStudentEntity>();
|
|
|
- int pageNo = 1;
|
|
|
- int pageSize = 5000;
|
|
|
- for (; ; ) {
|
|
|
- exportTaskService.checkStopExportTaskById(query.getTaskId());
|
|
|
- List tem = getExamAuditForAsyncPage(uds, query, pageNo, pageSize);
|
|
|
- if (tem == null || tem.size() == 0) {
|
|
|
- break;
|
|
|
- } else {
|
|
|
- pageNo++;
|
|
|
- resultList.addAll(tem);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ExamAuditInfo> list = ExamAuditEntityConvert.of(resultList);
|
|
|
-
|
|
|
- for (ExamAuditInfo examAuditInfo : list) {
|
|
|
- exportTaskService.checkStopExportTaskById(query.getTaskId());
|
|
|
- OrgCacheBean orgBean = gainBaseDataService.getOrgBean(examAuditInfo.getOrgId());
|
|
|
- examAuditInfo.setOrgName(orgBean.getName());
|
|
|
-
|
|
|
- //将违纪类型重赋值为文本,万恶的历史原因,不该这么做的。 待优化
|
|
|
- if (StringUtils.isNotEmpty(examAuditInfo.getDisciplineType())) {
|
|
|
- IllegallyTypeEntity illegallyType = illegallyTypeService.getIllegallyType(orgBean.getRootId(), examAuditInfo.getDisciplineType());
|
|
|
- examAuditInfo.setDisciplineType(illegallyType.getName());
|
|
|
- }
|
|
|
-
|
|
|
- CourseCacheBean courseBean = ExamCacheTransferHelper.getCachedCourse(examAuditInfo.getCourseId());
|
|
|
- examAuditInfo.setCourseName(courseBean.getName());
|
|
|
- examAuditInfo.setCourseCode(courseBean.getCode());
|
|
|
- examAuditInfo.setCourseLevel(CourseLevel.getCourseLevel(courseBean.getLevel()).getTitle());
|
|
|
-
|
|
|
- //考试名称
|
|
|
- ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
|
- examAuditInfo.setExamName(examBean.getName());
|
|
|
-
|
|
|
- //客观分
|
|
|
- ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examAuditInfo.getExamRecordDataId());
|
|
|
- examAuditInfo.setObjectiveScore(String.valueOf(examScore.getObjectiveScore()));
|
|
|
-
|
|
|
- }
|
|
|
- fillStage(list, query.getTaskId());
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- private void fillStage(List<ExamAuditInfo> list, Long taskId) {
|
|
|
- if (CollectionUtils.isEmpty(list)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for (ExamAuditInfo info : list) {
|
|
|
- exportTaskService.checkStopExportTaskById(taskId);
|
|
|
- if (info.getExamStageId() != null) {
|
|
|
- ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
|
|
|
- info.setExamStageOrder(stage.getStageOrder());
|
|
|
- info.setStartTime(stage.getStartTime());
|
|
|
- info.setEndTime(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<ExamAuditInfo> list) {
|
|
|
- if (CollectionUtils.isEmpty(list)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for (ExamAuditInfo info : list) {
|
|
|
- if (info.getExamStageId() != null) {
|
|
|
- ExamStageCacheBean stage = CacheHelper.getExamStage(info.getExamId(), info.getExamStageId());
|
|
|
- info.setExamStageOrder(stage.getStageOrder());
|
|
|
- info.setStartTime(stage.getStartTime());
|
|
|
- info.setEndTime(stage.getEndTime());
|
|
|
- info.setExamStage(stage.getStageOrder() + "("
|
|
|
- + DateUtil.format(stage.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
|
|
|
- + DateUtil.format(stage.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private SqlWrapper getSqlWrapper(UserDataRules uds, ExamAuditQuery query) {
|
|
|
- final String columns = ExamAuditMapper.defaultColumns();
|
|
|
- SqlWrapper wrapper = new SqlWrapper()
|
|
|
- .select(columns).from("ec_oe_exam_audit").as("audit")
|
|
|
- .innerJoin("ec_oe_exam_record_data").as("record").on("record.id", "audit.exam_record_data_id")
|
|
|
- .leftJoin("ec_oe_exam_process_record").as("process").on("record.id", "process.exam_record_data_id")
|
|
|
- .where().notEq("record.exam_record_status", ExamRecordStatus.EXAM_INVALID.name());
|
|
|
- if (query.getSwitchScreenCountStart() != null) {
|
|
|
- wrapper.and().gte("record.switch_screen_count", query.getSwitchScreenCountStart());
|
|
|
- }
|
|
|
- if (query.getSwitchScreenCountEnd() != null) {
|
|
|
- wrapper.and().lte("record.switch_screen_count", query.getSwitchScreenCountEnd());
|
|
|
- }
|
|
|
- if (query.getOrgId() != null) {
|
|
|
- wrapper.and().eq("record.org_id", query.getOrgId());
|
|
|
- }
|
|
|
- if (query.getExamId() != null) {
|
|
|
- wrapper.and().eq("record.exam_id", query.getExamId());
|
|
|
- }
|
|
|
- if (query.getExamStageId() != null) {
|
|
|
- wrapper.and().eq("record.exam_stage_id", query.getExamStageId());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getStudentCode())) {
|
|
|
- wrapper.and().rightLike("record.student_code", query.getStudentCode());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getStudentName())) {
|
|
|
- wrapper.and().rightLike("record.student_name", query.getStudentName());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getIdentityNumber())) {
|
|
|
- wrapper.and().rightLike("record.identity_number", query.getIdentityNumber());
|
|
|
- }
|
|
|
- if (query.getCourseId() != null) {
|
|
|
- wrapper.and().eq("record.course_id", query.getCourseId());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getCourseLevel())) {
|
|
|
- wrapper.and().eq("record.course_level", query.getCourseLevel());
|
|
|
- }
|
|
|
- if (query.getExamRecordDataId() != null) {
|
|
|
- wrapper.and().eq("record.id", query.getExamRecordDataId());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getStatus())) {
|
|
|
- wrapper.and().eq("audit.status", query.getStatus());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getDisciplineType())) {
|
|
|
- wrapper.and().eq("audit.discipline_type", query.getDisciplineType());
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(query.getAuditType())) {
|
|
|
- if ("1".equals(query.getAuditType())) {
|
|
|
- // 系统审核
|
|
|
- wrapper.and().eq("audit.audit_user_name", AUDIT_USER_NAME);
|
|
|
- } else {
|
|
|
- // 人工审核
|
|
|
- if (StringUtils.isNotBlank(query.getAuditUserName())) {
|
|
|
- if (AUDIT_USER_NAME.equals(query.getAuditUserName())) {
|
|
|
- // 排除SYSTEM关键字
|
|
|
- wrapper.and().notEq("audit.audit_user_name", AUDIT_USER_NAME);
|
|
|
- }
|
|
|
- wrapper.and().rightLike("audit.audit_user_name", query.getAuditUserName());
|
|
|
- } else {
|
|
|
- wrapper.and().notEq("audit.audit_user_name", AUDIT_USER_NAME);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (StringUtils.isNotBlank(query.getAuditUserName())) {
|
|
|
- wrapper.and().rightLike("audit.audit_user_name", query.getAuditUserName());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(query.getStartTime()) && StringUtils.isNotBlank(query.getEndTime())) {
|
|
|
- wrapper.and().gte("record.start_time", query.getStartTime());
|
|
|
- wrapper.and().lte("record.start_time", query.getEndTime());
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(query.getSubmitStartTime()) && StringUtils.isNotBlank(query.getSubmitEndTime())) {
|
|
|
- wrapper.and().isNotNull("record.end_time");
|
|
|
- wrapper.and().gte("record.end_time", query.getSubmitStartTime());
|
|
|
- wrapper.and().lte("record.end_time", query.getSubmitEndTime());
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(query.getAuditStartTime()) && StringUtils.isNotBlank(query.getAuditEndTime())) {
|
|
|
- wrapper.and().isNotNull("audit.update_time");
|
|
|
- wrapper.and().gte("audit.update_time", query.getAuditStartTime());
|
|
|
- wrapper.and().lte("audit.update_time", query.getAuditEndTime());
|
|
|
- }
|
|
|
-
|
|
|
- if (uds.getOrgRule().assertNeedQueryRefIds()) {
|
|
|
- wrapper.and().in("record.org_id", uds.getOrgRule().getRefIds());
|
|
|
- }
|
|
|
- if (uds.getCourseRule().assertNeedQueryRefIds()) {
|
|
|
- wrapper.and().in("record.course_id", uds.getCourseRule().getRefIds());
|
|
|
- }
|
|
|
- return wrapper;
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public ExamAuditEntity getExamAuditByExamRecordDataId(Long examRecordDataId) {
|
|
@@ -409,7 +101,7 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
return null;
|
|
|
}
|
|
|
Searcher searchers = new Searcher()
|
|
|
- .eq(EXAM_RECORD_DATA_ID, examRecordDataId);
|
|
|
+ .eq("examRecordDataId", examRecordDataId);
|
|
|
Specification<ExamAuditEntity> spec = SpecUtils.buildSearchers(ExamAuditEntity.class, searchers.build());
|
|
|
List<ExamAuditEntity> list = examAuditRepo.findAll(spec);
|
|
|
if (list != null && list.size() > 0) {
|
|
@@ -418,22 +110,6 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void batchAudit(List<Long> examRecordDataIds, Boolean isPass, User user) {
|
|
|
- //系统默认违纪类型
|
|
|
- List<IllegallyTypeEntity> sysIllegallyTypeList = illegallyTypeService.getSystemIllegallyTypes();
|
|
|
- if (null == sysIllegallyTypeList || sysIllegallyTypeList.isEmpty()) {
|
|
|
- throw new StatusException("100001", "默认违纪类型未配置");
|
|
|
- }
|
|
|
- for (Long examRecordDataId : examRecordDataIds) {
|
|
|
- String disciplineType = isPass ? DisciplineType.BATCH_PASS.name() : DisciplineType.BATCH_NOTPASS.name();
|
|
|
- IllegallyTypeEntity illType = sysIllegallyTypeList.stream()
|
|
|
- .filter(p -> p.getCode().equals(disciplineType))
|
|
|
- .collect(Collectors.toList()).get(0);
|
|
|
- singleAudit(examRecordDataId, isPass, "批量审核", disciplineType, user, illType.getId());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void singleAudit(Long examRecordDataId, Boolean isPass, String disciplineDetail,
|
|
@@ -520,7 +196,7 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
examRecordData.setUpdateTime(new Date());
|
|
|
examRecordDataRepo.save(examRecordData);
|
|
|
|
|
|
- doAuditPostProcesser(redoAuditInfo.getIsPass(), examRecordData,redoAuditInfo.getFromMarking());
|
|
|
+ doAuditPostProcesser(redoAuditInfo.getIsPass(), examRecordData, redoAuditInfo.getFromMarking());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -698,18 +374,19 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
* @param isPass
|
|
|
* @param examRecordData
|
|
|
*/
|
|
|
- private void doAuditPostProcesser(Boolean isPass, ExamRecordDataEntity examRecordData,Boolean fromMarking) {
|
|
|
+ private void doAuditPostProcesser(Boolean isPass, ExamRecordDataEntity examRecordData, Boolean fromMarking) {
|
|
|
if (isPass) {
|
|
|
auditPassPostProcesser(examRecordData);
|
|
|
} else {
|
|
|
- auditUnPassPostProcesser(examRecordData,fromMarking);
|
|
|
+ auditUnPassPostProcesser(examRecordData, fromMarking);
|
|
|
}
|
|
|
|
|
|
//重新计算考生的最终分数
|
|
|
examStudentFinalScoreService.calcAndSaveFinalScore(examRecordData.getExamStudentId());
|
|
|
}
|
|
|
+
|
|
|
private void doAuditPostProcesser(Boolean isPass, ExamRecordDataEntity examRecordData) {
|
|
|
- doAuditPostProcesser(isPass, examRecordData, null);
|
|
|
+ doAuditPostProcesser(isPass, examRecordData, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -764,13 +441,13 @@ public class ExamAuditServiceImpl implements ExamAuditService {
|
|
|
*
|
|
|
* @param examRecordData
|
|
|
*/
|
|
|
- private void auditUnPassPostProcesser(ExamRecordDataEntity examRecordData,Boolean fromMarking) {
|
|
|
- if(fromMarking==null||!fromMarking) {
|
|
|
- ExamRecordForMarkingEntity examRecordForMarking = examRecordForMarkingRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
- if (examRecordForMarking != null) {
|
|
|
- //删除阅卷需要数据,防止违纪数据进入阅卷
|
|
|
- examRecordForMarkingRepo.delete(examRecordForMarking);
|
|
|
- }
|
|
|
+ private void auditUnPassPostProcesser(ExamRecordDataEntity examRecordData, Boolean fromMarking) {
|
|
|
+ if (fromMarking == null || !fromMarking) {
|
|
|
+ ExamRecordForMarkingEntity examRecordForMarking = examRecordForMarkingRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
+ if (examRecordForMarking != null) {
|
|
|
+ //删除阅卷需要数据,防止违纪数据进入阅卷
|
|
|
+ examRecordForMarkingRepo.delete(examRecordForMarking);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//删除考生的最终分数,后续会重新计算
|