deason 6 lat temu
rodzic
commit
97c105a2e1

+ 4 - 4
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/CommonService.java

@@ -38,7 +38,7 @@ public class CommonService {
      * 获取所有"传统"考试列表
      * (正式场景数据极少,一次获取全部)
      */
-    public List<ExamInfo> getExamList(String examType) {
+    public List<ExamInfo> findExams(String examType) {
         //暂时直接查库,待“考务”接口提供后改为通过接口获取数据
         SqlWrapper sql = new SqlWrapper()
                 .select("em.id examId,em.name examName,em.root_org_id orgId,org.name orgName").from("ec_e_exam em")
@@ -54,7 +54,7 @@ public class CommonService {
      * 获取考试所有的开考课程列表
      * 含试卷类型、考生数量
      */
-    public List<ExamCourseInfo> getExamCourseList(Long orgId, Long examId, Long courseId, String paperType) {
+    public List<ExamCourseInfo> findExamCourses(Long orgId, Long examId, Long courseId, String paperType) {
         //暂时直接查库,待“考务”接口提供后改为通过接口获取数据
         SqlWrapper sql = new SqlWrapper()
                 .select("root_org_id orgId,exam_id,course_id,course_code,course_name,paper_type,count(course_code) totalStudent")
@@ -76,8 +76,8 @@ public class CommonService {
      * 获取考试所有的开考课程列表
      * 含试卷类型、考生数量
      */
-    public List<ExamCourseInfo> getExamCourseList(Long orgId, Long examId) {
-        return this.getExamCourseList(orgId, examId, null, null);
+    public List<ExamCourseInfo> findExamCourses(Long orgId, Long examId) {
+        return this.findExamCourses(orgId, examId, null, null);
     }
 
     public PaperQuestionStructureInfo findStructureByPaperId(Long examId, String paperId) {

+ 9 - 6
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/impl/CourseStatisticServiceImpl.java

@@ -93,7 +93,7 @@ public class CourseStatisticServiceImpl implements CourseStatisticService {
             if (course.getCourseId() == null || StringUtils.isBlank(course.getPaperType())) {
                 continue;
             }
-            List<ExamCourseInfo> examCourses = commonService.getExamCourseList(req.getOrgId(), req.getExamId(), course.getCourseId(), course.getPaperType());
+            List<ExamCourseInfo> examCourses = commonService.findExamCourses(req.getOrgId(), req.getExamId(), course.getCourseId(), course.getPaperType());//todo
             this.syncCourseStatisticList(examCourses);
         }
     }
@@ -101,13 +101,16 @@ public class CourseStatisticServiceImpl implements CourseStatisticService {
     @Override
     public void initAllCourseStatistic() {
         log.debug("initAllCourseStatistic...");
+
         //只处理已存在印刷项目中的考试
         List<ExamInfo> exams = printingProjectService.getExamList(null);
-        if (exams != null && !exams.isEmpty()) {
-            for (ExamInfo info : exams) {
-                List<ExamCourseInfo> examCourses = commonService.getExamCourseList(info.getOrgId(), info.getExamId());
-                this.syncCourseStatisticList(examCourses);
-            }
+        if (exams == null || exams.isEmpty()) {
+            return;
+        }
+
+        for (ExamInfo info : exams) {
+            List<ExamCourseInfo> examCourses = commonService.findExamCourses(info.getOrgId(), info.getExamId());//todo
+            this.syncCourseStatisticList(examCourses);
         }
     }
 

+ 1 - 1
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/impl/PrintingProjectServiceImpl.java

@@ -165,7 +165,7 @@ public class PrintingProjectServiceImpl implements PrintingProjectService {
     public void syncAllPrintingProject() {
         //获取所有"传统"考试列表
         log.debug("syncAllPrintingProject...");
-        List<ExamInfo> list = commonService.getExamList(ExamType.TRADITION.name());
+        List<ExamInfo> list = commonService.findExams(ExamType.TRADITION.name());//todo
         if (list != null && !list.isEmpty()) {
             for (ExamInfo info : list) {
                 syncPrintingProject(info);

+ 14 - 1
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/impl/PrintingProjectStatisticServiceImpl.java

@@ -15,6 +15,7 @@ import cn.com.qmth.examcloud.core.print.repository.ProjectStatisticRepository;
 import cn.com.qmth.examcloud.core.print.service.CourseStatisticService;
 import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
 import cn.com.qmth.examcloud.core.print.service.PrintingProjectStatisticService;
+import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.printingproject.ProjectStatisticInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.projectstatistic.PrintingStatisticConvert;
 import org.slf4j.Logger;
@@ -22,6 +23,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 import static cn.com.qmth.examcloud.core.print.common.Constants.PRT_CODE_500;
 
 /**
@@ -62,7 +65,17 @@ public class PrintingProjectStatisticServiceImpl implements PrintingProjectStati
 
     @Override
     public void initAllPrintingProjectStatistic() {
-        //todo init
+        log.debug("initAllPrintingProjectStatistic...");
+
+        //只处理已存在印刷项目中的考试
+        List<ExamInfo> exams = printingProjectService.getExamList(null);
+        if (exams == null || exams.isEmpty()) {
+            return;
+        }
+
+        for (ExamInfo info : exams) {
+            //todo
+        }
     }
 
 }