|
@@ -1,16 +1,14 @@
|
|
|
/*
|
|
|
* *************************************************
|
|
|
* Copyright (c) 2018 QMTH. All Rights Reserved.
|
|
|
- * Created by Deason on 2018-11-07 10:17:17.
|
|
|
+ * Created by Deason on 2018-11-23 17:52:03.
|
|
|
* *************************************************
|
|
|
*/
|
|
|
|
|
|
-package cn.com.qmth.examcloud.core.print.service;
|
|
|
+package cn.com.qmth.examcloud.core.print.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SqlWrapper;
|
|
|
-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.enums.QuesStructType;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.StatisticService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamCourseInfo;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.questionstructure.PaperQuestionStructureInfo;
|
|
@@ -20,7 +18,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -28,16 +26,13 @@ import java.util.List;
|
|
|
* @author: fengdesheng
|
|
|
* @since: 2018/11/7
|
|
|
*/
|
|
|
-@Component
|
|
|
-public class CommonService {
|
|
|
- private static final Logger log = LoggerFactory.getLogger(CommonService.class);
|
|
|
+@Service
|
|
|
+public class StatisticServiceImpl implements StatisticService {
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(StatisticServiceImpl.class);
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
- /**
|
|
|
- * 获取所有"传统"考试列表
|
|
|
- * (正式场景数据极少,一次获取全部)
|
|
|
- */
|
|
|
+ @Override
|
|
|
public List<ExamInfo> findExams(String examType) {
|
|
|
//暂时直接查库,待“考务”接口提供后改为通过接口获取数据
|
|
|
SqlWrapper sql = new SqlWrapper()
|
|
@@ -50,10 +45,12 @@ public class CommonService {
|
|
|
return jdbcTemplate.query(sql.build(), new BeanPropertyRowMapper(ExamInfo.class));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取考试所有的开考课程列表
|
|
|
- * 含试卷类型、考生数量
|
|
|
- */
|
|
|
+ @Override
|
|
|
+ public List<ExamCourseInfo> findExamCourses(Long orgId, Long examId) {
|
|
|
+ return this.findExamCourses(orgId, examId, null, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<ExamCourseInfo> findExamCourses(Long orgId, Long examId, Long courseId, String paperType) {
|
|
|
//暂时直接查库,待“考务”接口提供后改为通过接口获取数据
|
|
|
SqlWrapper sql = new SqlWrapper()
|
|
@@ -72,47 +69,10 @@ public class CommonService {
|
|
|
return jdbcTemplate.query(sql.build(), new BeanPropertyRowMapper(ExamCourseInfo.class));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取考试所有的开考课程列表
|
|
|
- * 含试卷类型、考生数量
|
|
|
- */
|
|
|
- public List<ExamCourseInfo> findExamCourses(Long orgId, Long examId) {
|
|
|
- return this.findExamCourses(orgId, examId, null, null);
|
|
|
- }
|
|
|
-
|
|
|
+ @Override
|
|
|
public PaperQuestionStructureInfo findStructureByPaperId(Long examId, String paperId) {
|
|
|
- // just mock data todo
|
|
|
PaperQuestionStructureInfo info = new PaperQuestionStructureInfo();
|
|
|
-
|
|
|
- ObjectiveQuestionStructure objective = new ObjectiveQuestionStructure();
|
|
|
- objective.setExamId(examId);
|
|
|
- objective.setPaperId(paperId);
|
|
|
- objective.setCourseId(1L);
|
|
|
- objective.setCourseCode("123456");
|
|
|
- objective.setCourseName("测试课程");
|
|
|
- objective.setPaperName("测试试卷");
|
|
|
- objective.setPaperType("A");
|
|
|
- objective.setQuestionType(QuesStructType.SINGLE_ANSWER_QUESTION.name());
|
|
|
- objective.setAnswer("1");
|
|
|
- objective.setSectionNum(1);
|
|
|
- objective.setUnitNum(1);
|
|
|
- objective.setUnitScore(2.0);
|
|
|
- info.addObjective(objective);
|
|
|
-
|
|
|
- SubjectiveQuestionStructure subjective = new SubjectiveQuestionStructure();
|
|
|
- subjective.setExamId(examId);
|
|
|
- subjective.setPaperId(paperId);
|
|
|
- subjective.setCourseId(1L);
|
|
|
- subjective.setCourseCode("123456");
|
|
|
- subjective.setCourseName("测试课程");
|
|
|
- subjective.setPaperName("测试试卷");
|
|
|
- subjective.setPaperType("A");
|
|
|
- subjective.setSectionNum(1);
|
|
|
- subjective.setSectionName("简答题");
|
|
|
- subjective.setUnitNum(1);
|
|
|
- subjective.setUnitScore(2.0);
|
|
|
- info.addSubjective(subjective);
|
|
|
-
|
|
|
+ //todo
|
|
|
return info;
|
|
|
}
|
|
|
|