|
@@ -37,6 +37,7 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentFinalScoreEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.CourseLevel;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamRecordStatus;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamScoreService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentFinalScoreService;
|
|
@@ -45,6 +46,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examscore.ExamScoreEntityConvert;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examscore.ExamScoreInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examscore.ExamScoreQuery;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examscore.ObjectiveScoreInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
@@ -402,4 +404,58 @@ public class ExamScoreServiceImpl implements ExamScoreService {
|
|
|
examScoreRepo.save(examScoreEntity);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ObjectiveScoreInfo> queryObjectiveScoreList(Long examStudentId) {
|
|
|
+ List<ExamRecordDataEntity> examRecordDataList = examRecordDataRepo.findByExamStudentId(examStudentId);
|
|
|
+ //过滤已完成的考试记录(包括违纪的)
|
|
|
+ examRecordDataList = examRecordDataList.stream().filter((o -> {
|
|
|
+ return o.getExamRecordStatus() == ExamRecordStatus.EXAM_END ||
|
|
|
+ o.getExamRecordStatus() == ExamRecordStatus.EXAM_OVERDUE ||
|
|
|
+ o.getExamRecordStatus() == ExamRecordStatus.EXAM_HAND_IN ||
|
|
|
+ o.getExamRecordStatus() == ExamRecordStatus.EXAM_AUTO_HAND_IN;
|
|
|
+ })).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<ObjectiveScoreInfo> objectiveScoreInfoList = new ArrayList<ObjectiveScoreInfo>();
|
|
|
+ for (ExamRecordDataEntity examRecordDataEntity : examRecordDataList) {
|
|
|
+ ObjectiveScoreInfo objectiveScoreInfo = new ObjectiveScoreInfo();
|
|
|
+ objectiveScoreInfo.setExamRecordDataId(examRecordDataEntity.getId());
|
|
|
+ objectiveScoreInfo.setExamOrder(examRecordDataEntity.getExamOrder());
|
|
|
+ objectiveScoreInfo.setStartTime(examRecordDataEntity.getStartTime());
|
|
|
+ objectiveScoreInfo.setEndTime(examRecordDataEntity.getEndTime());
|
|
|
+
|
|
|
+ //如果考试没有结束,则只能返回部分数据
|
|
|
+ if (!isExamRecordEnded(examRecordDataEntity)) {
|
|
|
+ objectiveScoreInfo.setIsExamEnded(false);
|
|
|
+ objectiveScoreInfoList.add(objectiveScoreInfo);
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ objectiveScoreInfo.setIsExamEnded(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!examRecordDataEntity.getIsIllegality()) {
|
|
|
+ if (examRecordDataEntity.getIsWarn() && !examRecordDataEntity.getIsAudit()) {
|
|
|
+ objectiveScoreInfo.setIsAuditing(true);
|
|
|
+ } else if (!examRecordDataEntity.getIsWarn() || (examRecordDataEntity.getIsWarn() && examRecordDataEntity.getIsAudit())) {
|
|
|
+ ExamScoreEntity examScore = examScoreRepo.findByExamRecordDataId(examRecordDataEntity.getId());
|
|
|
+ objectiveScoreInfo.setIsAuditing(false);
|
|
|
+ objectiveScoreInfo.setObjectiveScore(examScore.getObjectiveScore());
|
|
|
+ }
|
|
|
+ objectiveScoreInfo.setIsIllegality(false);
|
|
|
+ } else {
|
|
|
+ objectiveScoreInfo.setIsIllegality(true);
|
|
|
+ }
|
|
|
+ objectiveScoreInfoList.add(objectiveScoreInfo);
|
|
|
+ }
|
|
|
+ return objectiveScoreInfoList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean isExamRecordEnded(ExamRecordDataEntity examRecordData) {
|
|
|
+ //如果考试记录状态为已处理,则直接返回true.
|
|
|
+ if (examRecordData.getExamRecordStatus() == ExamRecordStatus.EXAM_END ||
|
|
|
+ examRecordData.getExamRecordStatus() == ExamRecordStatus.EXAM_OVERDUE ||
|
|
|
+ examRecordData.getExamRecordStatus() == ExamRecordStatus.EXAM_INVALID) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|