wangwei 6 éve
szülő
commit
1a9217f1f7

+ 25 - 0
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamStudentCloudServiceProvider.java

@@ -30,9 +30,13 @@ import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
 import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
 import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
 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.ExamEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamPaperTypeRelationEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
 import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamStudentInfo;
@@ -82,6 +86,12 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
 	@Autowired
 	CourseCloudService courseCloudService;
 
+	@Autowired
+	ExamCourseRelationRepo examCourseRelationRepo;
+
+	@Autowired
+	ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
+
 	@ApiOperation(value = "保存考生")
 	@PostMapping("saveExamStudent")
 	@Override
@@ -215,6 +225,21 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
 				one.setInfoCollector(es.getInfoCollector());
 
 				ExamStudentEntity saved = examStudentRepo.save(one);
+
+				ExamCourseRelationEntity relation = new ExamCourseRelationEntity();
+				relation.setExamId(saved.getExamId());
+				relation.setCourseId(saved.getCourseId());
+				relation.setCourseLevel(saved.getCourseLevel());
+				relation.setCourseCode(saved.getCourseCode());
+				relation.setCourseName(saved.getCourseName());
+				examCourseRelationRepo.save(relation);
+
+				ExamPaperTypeRelationEntity pt = new ExamPaperTypeRelationEntity();
+				pt.setCourseId(saved.getCourseId());
+				pt.setExamId(saved.getExamId());
+				pt.setPageType(saved.getPaperType());
+				examPaperTypeRelationRepo.save(pt);
+
 				examStudentIds.add(saved.getId());
 			}