deason 6 years ago
parent
commit
fd07dcc828

+ 2 - 2
examcloud-core-print-provider/src/main/java/cn/com/qmth/examcloud/core/print/api/controller/PrintingProjectStatisticController.java

@@ -10,7 +10,7 @@ package cn.com.qmth.examcloud.core.print.api.controller;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.core.print.common.Result;
 import cn.com.qmth.examcloud.core.print.common.Result;
 import cn.com.qmth.examcloud.core.print.service.PrintingProjectStatisticService;
 import cn.com.qmth.examcloud.core.print.service.PrintingProjectStatisticService;
-import cn.com.qmth.examcloud.core.print.service.bean.printingproject.ProjectStatisticInfo;
+import cn.com.qmth.examcloud.core.print.service.bean.printingprojectstatistic.PrintingProjectStatisticInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,7 +33,7 @@ public class PrintingProjectStatisticController extends ControllerSupport {
 
 
     @PostMapping("/{orgId}/{examId}")
     @PostMapping("/{orgId}/{examId}")
     @ApiOperation(value = "获取某个印刷项目的统计信息")
     @ApiOperation(value = "获取某个印刷项目的统计信息")
-    public ProjectStatisticInfo list(@PathVariable Long orgId, @PathVariable Long examId) {
+    public PrintingProjectStatisticInfo list(@PathVariable Long orgId, @PathVariable Long examId) {
         return printingProjectStatisticService.getPrintingProjectStatistic(orgId, examId);
         return printingProjectStatisticService.getPrintingProjectStatistic(orgId, examId);
     }
     }
 
 

+ 6 - 0
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/PrintingProjectService.java

@@ -11,6 +11,7 @@ import cn.com.qmth.examcloud.core.print.entity.PrintingProject;
 import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.common.OrgInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.common.OrgInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectInfo;
+import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectLessInfo;
 import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectQuery;
 import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectQuery;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
 
 
@@ -85,4 +86,9 @@ public interface PrintingProjectService {
      */
      */
     List<ExamInfo> getExamList(Long orgId);
     List<ExamInfo> getExamList(Long orgId);
 
 
+    /**
+     * 获取印刷项目的简要信息列表
+     */
+    List<PrintingProjectLessInfo> getAllPrintingProjectLessInfo();
+
 }
 }

+ 2 - 2
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/PrintingProjectStatisticService.java

@@ -7,7 +7,7 @@
 
 
 package cn.com.qmth.examcloud.core.print.service;
 package cn.com.qmth.examcloud.core.print.service;
 
 
-import cn.com.qmth.examcloud.core.print.service.bean.printingproject.ProjectStatisticInfo;
+import cn.com.qmth.examcloud.core.print.service.bean.printingprojectstatistic.PrintingProjectStatisticInfo;
 
 
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.NotNull;
 
 
@@ -24,7 +24,7 @@ public interface PrintingProjectStatisticService {
      * @param examId
      * @param examId
      * @return
      * @return
      */
      */
-    ProjectStatisticInfo getPrintingProjectStatistic(@NotNull Long orgId, @NotNull Long examId);
+    PrintingProjectStatisticInfo getPrintingProjectStatistic(@NotNull Long orgId, @NotNull Long examId);
 
 
     /**
     /**
      * 刷新某个印刷项目的统计信息
      * 刷新某个印刷项目的统计信息

+ 57 - 0
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/printingproject/PrintingProjectLessInfo.java

@@ -0,0 +1,57 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-11-23 17:20:21.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.core.print.service.bean.printingproject;
+
+import java.io.Serializable;
+
+/**
+ * 印刷项目的简要信息
+ *
+ * @author: fengdesheng
+ * @since: 2018/11/23
+ */
+public class PrintingProjectLessInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 印刷项目ID
+     */
+    private Long projectId;
+    /**
+     * 考试ID
+     */
+    private Long examId;
+    /**
+     * 学校机构ID
+     */
+    private Long orgId;
+
+    public Long getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(Long projectId) {
+        this.projectId = projectId;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+}

+ 4 - 5
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/projectstatistic/PrintingStatisticConvert.java → examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/printingprojectstatistic/PrintingProjectStatisticConvert.java

@@ -5,20 +5,19 @@
  * *************************************************
  * *************************************************
  */
  */
 
 
-package cn.com.qmth.examcloud.core.print.service.bean.projectstatistic;
+package cn.com.qmth.examcloud.core.print.service.bean.printingprojectstatistic;
 
 
 import cn.com.qmth.examcloud.core.print.entity.PrintingProject;
 import cn.com.qmth.examcloud.core.print.entity.PrintingProject;
 import cn.com.qmth.examcloud.core.print.entity.ProjectStatistic;
 import cn.com.qmth.examcloud.core.print.entity.ProjectStatistic;
-import cn.com.qmth.examcloud.core.print.service.bean.printingproject.ProjectStatisticInfo;
 
 
 /**
 /**
  * @author: fengdesheng
  * @author: fengdesheng
  * @since: 2018/11/05
  * @since: 2018/11/05
  */
  */
-public class PrintingStatisticConvert {
+public class PrintingProjectStatisticConvert {
 
 
-    public static ProjectStatisticInfo of(PrintingProject project, ProjectStatistic statistic) {
-        ProjectStatisticInfo info = new ProjectStatisticInfo();
+    public static PrintingProjectStatisticInfo of(PrintingProject project, ProjectStatistic statistic) {
+        PrintingProjectStatisticInfo info = new PrintingProjectStatisticInfo();
         info.setProjectId(project.getId());
         info.setProjectId(project.getId());
         info.setOrgId(project.getOrgId());
         info.setOrgId(project.getOrgId());
         info.setExamId(project.getExamId());
         info.setExamId(project.getExamId());

+ 3 - 3
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/printingproject/ProjectStatisticInfo.java → examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/printingprojectstatistic/PrintingProjectStatisticInfo.java

@@ -1,11 +1,11 @@
 /*
 /*
  * *************************************************
  * *************************************************
  * Copyright (c) 2018 QMTH. All Rights Reserved.
  * Copyright (c) 2018 QMTH. All Rights Reserved.
- * Created by Deason on 2018-11-01 10:07:32.
+ * Created by Deason on 2018-11-23 17:13:51.
  * *************************************************
  * *************************************************
  */
  */
 
 
-package cn.com.qmth.examcloud.core.print.service.bean.printingproject;
+package cn.com.qmth.examcloud.core.print.service.bean.printingprojectstatistic;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 
 
@@ -15,7 +15,7 @@ import java.io.Serializable;
  * @author: fengdesheng
  * @author: fengdesheng
  * @since: 2018/10/30
  * @since: 2018/10/30
  */
  */
-public class ProjectStatisticInfo implements Serializable {
+public class PrintingProjectStatisticInfo implements Serializable {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
     /**
     /**
      * 印刷项目ID
      * 印刷项目ID

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

@@ -15,9 +15,9 @@ 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.CourseStatisticService;
 import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
 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.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 cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectLessInfo;
+import cn.com.qmth.examcloud.core.print.service.bean.printingprojectstatistic.PrintingProjectStatisticConvert;
+import cn.com.qmth.examcloud.core.print.service.bean.printingprojectstatistic.PrintingProjectStatisticInfo;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,7 +42,7 @@ public class PrintingProjectStatisticServiceImpl implements PrintingProjectStati
     private CourseStatisticService courseStatisticService;
     private CourseStatisticService courseStatisticService;
 
 
     @Override
     @Override
-    public ProjectStatisticInfo getPrintingProjectStatistic(Long orgId, Long examId) {
+    public PrintingProjectStatisticInfo getPrintingProjectStatistic(Long orgId, Long examId) {
         Check.isNull(orgId, "学校ID不能为空!");
         Check.isNull(orgId, "学校ID不能为空!");
         Check.isNull(examId, "考试ID不能为空!");
         Check.isNull(examId, "考试ID不能为空!");
 
 
@@ -52,7 +52,7 @@ public class PrintingProjectStatisticServiceImpl implements PrintingProjectStati
         }
         }
 
 
         ProjectStatistic statistic = projectStatisticRepository.getProjectStatisticByProjectId(project.getId());
         ProjectStatistic statistic = projectStatisticRepository.getProjectStatisticByProjectId(project.getId());
-        return PrintingStatisticConvert.of(project, statistic);
+        return PrintingProjectStatisticConvert.of(project, statistic);
     }
     }
 
 
     @Override
     @Override
@@ -78,12 +78,12 @@ public class PrintingProjectStatisticServiceImpl implements PrintingProjectStati
         log.debug("initAllPrintingProjectStatistic...");
         log.debug("initAllPrintingProjectStatistic...");
 
 
         //只处理印刷项目中已有的考试
         //只处理印刷项目中已有的考试
-        List<ExamInfo> exams = printingProjectService.getExamList(null);
-        if (exams == null || exams.isEmpty()) {
+        List<PrintingProjectLessInfo> projects = printingProjectService.getAllPrintingProjectLessInfo();
+        if (projects == null || projects.isEmpty()) {
             return;
             return;
         }
         }
 
 
-        for (ExamInfo info : exams) {
+        for (PrintingProjectLessInfo project : projects) {
             //todo
             //todo
         }
         }
     }
     }