|
@@ -27,14 +27,18 @@ import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.GetCourseReq;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.GetCourseResp;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseRelationEntity;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseRelationPK;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamPaperTypeRelationEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
@@ -226,12 +230,29 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
|
|
|
|
ExamStudentEntity saved = examStudentRepo.save(one);
|
|
|
|
|
|
+ ExamCourseRelationEntity ecR = examCourseRelationRepo
|
|
|
+ .findOne(new ExamCourseRelationPK(saved.getExamId(), saved.getCourseId()));
|
|
|
+
|
|
|
ExamCourseRelationEntity relation = new ExamCourseRelationEntity();
|
|
|
relation.setExamId(saved.getExamId());
|
|
|
relation.setCourseId(saved.getCourseId());
|
|
|
relation.setCourseLevel(saved.getCourseLevel());
|
|
|
relation.setCourseCode(saved.getCourseCode());
|
|
|
relation.setCourseName(saved.getCourseName());
|
|
|
+
|
|
|
+ if (null != ecR) {
|
|
|
+ relation.setCourseEnable(ecR.getCourseEnable());
|
|
|
+ } else {
|
|
|
+ GetCourseReq getCourseReq = new GetCourseReq();
|
|
|
+ getCourseReq.setRootOrgId(saved.getRootOrgId());
|
|
|
+ getCourseReq.setId(saved.getCourseId());
|
|
|
+ getCourseReq.setCode(saved.getCourseCode());
|
|
|
+ GetCourseResp getCourseResp = courseCloudService.getCourse(getCourseReq);
|
|
|
+ CourseBean courseBean = getCourseResp.getCourseBean();
|
|
|
+ relation.setCourseName(courseBean.getName());
|
|
|
+ relation.setCourseEnable(courseBean.getEnable());
|
|
|
+ }
|
|
|
+
|
|
|
examCourseRelationRepo.save(relation);
|
|
|
|
|
|
ExamPaperTypeRelationEntity pt = new ExamPaperTypeRelationEntity();
|