|
@@ -14,9 +14,10 @@ import cn.com.qmth.examcloud.core.print.entity.ObjectiveQuestionStructure;
|
|
|
import cn.com.qmth.examcloud.core.print.entity.SubjectiveQuestionStructure;
|
|
|
import cn.com.qmth.examcloud.core.print.repository.ObjectiveQuestionStructureRepository;
|
|
|
import cn.com.qmth.examcloud.core.print.repository.SubjectiveQuestionStructureRepository;
|
|
|
-import cn.com.qmth.examcloud.core.print.service.QuestionStructureService;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.ExamQuestionStructureService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.StatisticService;
|
|
|
-import cn.com.qmth.examcloud.core.print.service.bean.questionstructure.PaperQuestionStructureInfo;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.examquestionstructure.ExamQuestionStructureInfo;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -31,7 +32,7 @@ import java.util.List;
|
|
|
* @since: 2018/10/17
|
|
|
*/
|
|
|
@Service
|
|
|
-public class QuestionStructureServiceImpl implements QuestionStructureService {
|
|
|
+public class QuestionStructureServiceImpl implements ExamQuestionStructureService {
|
|
|
private static final Logger log = LoggerFactory.getLogger(QuestionStructureServiceImpl.class);
|
|
|
@Autowired
|
|
|
private ObjectiveQuestionStructureRepository objectiveQuestionStructureRepository;
|
|
@@ -46,7 +47,7 @@ public class QuestionStructureServiceImpl implements QuestionStructureService {
|
|
|
Check.isEmpty(paperId, "试卷ID不能为空!");
|
|
|
|
|
|
//从题库端获取试卷的试题结构信息
|
|
|
- PaperQuestionStructureInfo info = statisticService.findStructureByPaperId(examId, paperId);
|
|
|
+ ExamQuestionStructureInfo info = statisticService.findStructureByPaperId(examId, paperId);
|
|
|
|
|
|
//先清理旧数据
|
|
|
objectiveQuestionStructureRepository.deleteByExamIdAndPaperId(examId, paperId);
|
|
@@ -95,4 +96,20 @@ public class QuestionStructureServiceImpl implements QuestionStructureService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void syncObjectiveCourseNameByCourseId(Long courseId, String courseName) {
|
|
|
+ if (courseId == null || StringUtils.isBlank(courseName)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ objectiveQuestionStructureRepository.updateCourseNameByCourseId(courseId, courseName);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void syncSubjectiveCourseNameByCourseId(Long courseId, String courseName) {
|
|
|
+ if (courseId == null || StringUtils.isBlank(courseName)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ subjectiveQuestionStructureRepository.updateCourseNameByCourseId(courseId, courseName);
|
|
|
+ }
|
|
|
+
|
|
|
}
|