|
@@ -0,0 +1,81 @@
|
|
|
|
+package com.qmth.distributed.print.business.service.impl;
|
|
|
|
+
|
|
|
|
+import com.qmth.distributed.print.business.entity.ExamDetail;
|
|
|
|
+import com.qmth.distributed.print.business.entity.ExamDetailCourse;
|
|
|
|
+import com.qmth.distributed.print.business.entity.ExamStudent;
|
|
|
|
+import com.qmth.distributed.print.business.service.ExamDetailCourseService;
|
|
|
|
+import com.qmth.distributed.print.business.service.ExamStudentService;
|
|
|
|
+import com.qmth.distributed.print.business.service.PrintFinishService;
|
|
|
|
+import com.qmth.teachcloud.common.entity.MarkPaper;
|
|
|
|
+import com.qmth.teachcloud.common.entity.MarkStudent;
|
|
|
|
+import com.qmth.teachcloud.common.service.MarkPaperService;
|
|
|
|
+import com.qmth.teachcloud.common.service.MarkQuestionService;
|
|
|
|
+import com.qmth.teachcloud.common.service.MarkStudentService;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@Service
|
|
|
|
+public class PrintFinishServiceImpl implements PrintFinishService {
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private MarkPaperService markPaperService;
|
|
|
|
+ @Resource
|
|
|
|
+ private MarkQuestionService markQuestionService;
|
|
|
|
+ @Resource
|
|
|
|
+ private MarkStudentService markStudentService;
|
|
|
|
+ @Resource
|
|
|
|
+ private ExamDetailCourseService examDetailCourseService;
|
|
|
|
+ @Resource
|
|
|
|
+ private ExamStudentService examStudentService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 打印结束后,生成阅卷科目数据
|
|
|
|
+ *
|
|
|
|
+ * @param examId
|
|
|
|
+ * @param courseCode
|
|
|
|
+ * @param courseName
|
|
|
|
+ * @param paperNumber
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void insertMarkPaper(Long examId, String courseCode, String courseName, String paperNumber) {
|
|
|
|
+ MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
|
+ if (markPaper != null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ MarkPaper insertMarkPaper = new MarkPaper(examId, courseCode, courseName, paperNumber);
|
|
|
|
+ markPaperService.save(insertMarkPaper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void insertMarkStudent(ExamDetail examDetail) {
|
|
|
|
+ List<MarkStudent> markStudentList = new ArrayList<>();
|
|
|
|
+ List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.listByExamDetailId(examDetail.getId());
|
|
|
|
+ for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
|
|
|
|
+ List<ExamStudent> examStudentList = examStudentService.listByExamDetailCourseId(examDetailCourse.getId());
|
|
|
|
+ for (ExamStudent examStudent : examStudentList) {
|
|
|
|
+ MarkStudent markStudent = markStudentService.getById(examStudent.getId());
|
|
|
|
+ if (markStudent != null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ markStudentList.add(new MarkStudent(examStudent.getId(), examDetail.getExamId(), examDetailCourse.getCourseCode(), examDetailCourse.getCourseName(), examDetailCourse.getPaperNumber(), examStudent.getStudentCode(), examStudent.getStudentName(), examDetail.getPackageCode(), examDetail.getExamPlace(), examDetail.getExamRoom(), examStudent.getStudentName()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (CollectionUtils.isNotEmpty(markStudentList)) {
|
|
|
|
+ markStudentService.saveBatch(markStudentList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void insertScanAnswerCard() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void insertMarkQuestion() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|