|
@@ -4,11 +4,16 @@ import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamStageStartExamStatus;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamType;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.GetCoursesByIdListReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.GetCoursesByIdListResp;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.api.request.*;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.api.response.CalcExamScoreResp;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.api.response.CalcFaceBiopsyResultResp;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.api.response.CheckPaperInExamResp;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.utils.QuestionTypeUtil;
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.bean.client.CourseInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.dao.ExamFaceLiveVerifyRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.dao.ExamFaceLivenessVerifyRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.dao.ExamRecordDataRepo;
|
|
@@ -38,6 +43,7 @@ import cn.com.qmth.examcloud.support.examing.ExamingSession;
|
|
|
import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
|
|
|
import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
|
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -81,6 +87,9 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
|
|
|
@Autowired
|
|
|
private ExamStageCloudService examStageCloudService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CourseCloudService courseCloudService;
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public ExamRecordData createExamRecordData(ExamingSession examingSession, ExamSettingsCacheBean examBean,
|
|
@@ -399,8 +408,26 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String findCourseNameById(Long id) {
|
|
|
- return examRecordDataRepo.findCourseNameById(id);
|
|
|
+ public CourseInfo getCourseInfo(Long examRecordDataId) {
|
|
|
+ Long courseId = examRecordDataRepo.findCourseIdByExamRecordDataId(examRecordDataId);
|
|
|
+ if (courseId == null) {
|
|
|
+ throw new StatusException("考试记录不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ GetCoursesByIdListReq req = new GetCoursesByIdListReq();
|
|
|
+ req.setCourseIdList(Lists.newArrayList(courseId));
|
|
|
+ GetCoursesByIdListResp resp = courseCloudService.getCoursesByIdList(req);
|
|
|
+ if (CollectionUtils.isEmpty(resp.getCourseList())) {
|
|
|
+ throw new StatusException("课程不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ CourseBean bean = resp.getCourseList().get(0);
|
|
|
+
|
|
|
+ CourseInfo info = new CourseInfo();
|
|
|
+ info.setCourseId(bean.getId());
|
|
|
+ info.setCourseCode(bean.getCode());
|
|
|
+ info.setCourseName(bean.getName());
|
|
|
+ return info;
|
|
|
}
|
|
|
|
|
|
/**
|