deason 6 years ago
parent
commit
5a8caf9749

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

@@ -10,18 +10,15 @@ package cn.com.qmth.examcloud.core.print.api.controller;
 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.service.PrintingProjectStatisticService;
-import cn.com.qmth.examcloud.core.print.service.bean.PrintingProjectInfo;
-import cn.com.qmth.examcloud.core.print.service.bean.PrintingProjectQuery;
+import cn.com.qmth.examcloud.core.print.service.bean.ProjectStatisticInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
-
 import static cn.com.qmth.examcloud.core.print.common.Result.success;
 
 /**
@@ -37,16 +34,16 @@ public class PrintingProjectStatisticController extends ControllerSupport {
     @Autowired
     private PrintingProjectStatisticService printingProjectStatisticService;
 
-    @PostMapping("/list")
-    @ApiOperation(value = "获取印刷项目统计列表")
-    public List<PrintingProjectInfo> list(@RequestBody PrintingProjectQuery query) {
-        return printingProjectStatisticService.getPrintingProjectStatisticList(query);
+    @PostMapping("/{orgId}/{examId}")
+    @ApiOperation(value = "获取某个印刷项目的统计信息")
+    public ProjectStatisticInfo list(@PathVariable Long orgId, @PathVariable Long examId) {
+        return printingProjectStatisticService.getPrintingProjectStatistic(orgId, examId);
     }
 
     @PostMapping("/init")
-    @ApiOperation(value = "执行印刷项目统计")
-    public Result statistic() {
-        printingProjectStatisticService.statistic();
+    @ApiOperation(value = "初始印刷项目的统计信息")
+    public Result init() {
+        printingProjectStatisticService.initPrintingProjectStatistics();
         return success();
     }
 

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

@@ -7,10 +7,9 @@
 
 package cn.com.qmth.examcloud.core.print.service;
 
-import cn.com.qmth.examcloud.core.print.service.bean.PrintingProjectInfo;
-import cn.com.qmth.examcloud.core.print.service.bean.PrintingProjectQuery;
+import cn.com.qmth.examcloud.core.print.service.bean.ProjectStatisticInfo;
 
-import java.util.List;
+import javax.validation.constraints.NotNull;
 
 /**
  * @author: fengdesheng
@@ -18,8 +17,18 @@ import java.util.List;
  */
 public interface PrintingProjectStatisticService {
 
-    List<PrintingProjectInfo> getPrintingProjectStatisticList(PrintingProjectQuery query);
+    /**
+     * 获取某个印刷项目的统计信息
+     *
+     * @param orgId
+     * @param examId
+     * @return
+     */
+    ProjectStatisticInfo getPrintingProjectStatistic(@NotNull Long orgId, @NotNull Long examId);
 
-    void statistic();
+    /**
+     * 初始印刷项目的统计信息
+     */
+    void initPrintingProjectStatistics();
 
 }

+ 239 - 0
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/ProjectStatisticInfo.java

@@ -0,0 +1,239 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-10-30 11:15:44.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.core.print.service.bean;
+
+import java.io.Serializable;
+
+/**
+ * 印刷项目的统计信息
+ *
+ * @author: fengdesheng
+ * @since: 2018/10/30
+ */
+public class ProjectStatisticInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 印刷项目ID
+     */
+    private Long projectId;
+    /**
+     * 考试ID
+     */
+    private Long examId;
+    /**
+     * 考试名称
+     */
+    private String examName;
+    /**
+     * 学校机构ID
+     */
+    private Long orgId;
+    /**
+     * 学校机构名称
+     */
+    private String orgName;
+    /**
+     * 供应商ID
+     */
+    private Long supplierId;
+    /**
+     * 供应商名称
+     */
+    private String supplierName;
+    /**
+     * 项目经理ID
+     */
+    private Long pmId;
+    /**
+     * 项目经理名称
+     */
+    private String pmName;
+    /**
+     * 人科次
+     */
+    private Integer totalExamStudent;
+    /**
+     * 课程数量
+     */
+    private Integer totalCourse;
+    /**
+     * 试卷数量
+     */
+    private Integer totalPaper;
+    /**
+     * 试卷袋数
+     */
+    private Integer totalPkg;
+    /**
+     * 常规 印刷数量A3
+     */
+    private Integer normalA3;
+    /**
+     * 常规 印刷数量A4
+     */
+    private Integer normalA4;
+    /**
+     * 备份 印刷数量A4
+     */
+    private Integer backupA3;
+    /**
+     * 备份 印刷数量A4
+     */
+    private Integer backupA4;
+
+    /**
+     * 合计 印刷数量A3
+     */
+    public Integer getTotalA3() {
+        return getNormalA3() + getBackupA3();
+    }
+
+    /**
+     * 合计 印刷数量A4
+     */
+    public Integer getTotalA4() {
+        return getNormalA4() + getBackupA4();
+    }
+
+    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 String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getOrgName() {
+        return orgName;
+    }
+
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+
+    public Long getSupplierId() {
+        return supplierId;
+    }
+
+    public void setSupplierId(Long supplierId) {
+        this.supplierId = supplierId;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public Long getPmId() {
+        return pmId;
+    }
+
+    public void setPmId(Long pmId) {
+        this.pmId = pmId;
+    }
+
+    public String getPmName() {
+        return pmName;
+    }
+
+    public void setPmName(String pmName) {
+        this.pmName = pmName;
+    }
+
+    public Integer getTotalExamStudent() {
+        return totalExamStudent != null ? totalExamStudent : 0;
+    }
+
+    public void setTotalExamStudent(Integer totalExamStudent) {
+        this.totalExamStudent = totalExamStudent;
+    }
+
+    public Integer getTotalCourse() {
+        return totalCourse != null ? totalCourse : 0;
+    }
+
+    public void setTotalCourse(Integer totalCourse) {
+        this.totalCourse = totalCourse;
+    }
+
+    public Integer getTotalPaper() {
+        return totalPaper != null ? totalPaper : 0;
+    }
+
+    public void setTotalPaper(Integer totalPaper) {
+        this.totalPaper = totalPaper;
+    }
+
+    public Integer getNormalA3() {
+        return normalA3 != null ? normalA3 : 0;
+    }
+
+    public void setNormalA3(Integer normalA3) {
+        this.normalA3 = normalA3;
+    }
+
+    public Integer getNormalA4() {
+        return normalA4 != null ? normalA4 : 0;
+    }
+
+    public void setNormalA4(Integer normalA4) {
+        this.normalA4 = normalA4;
+    }
+
+    public Integer getBackupA3() {
+        return backupA3 != null ? backupA3 : 0;
+    }
+
+    public void setBackupA3(Integer backupA3) {
+        this.backupA3 = backupA3;
+    }
+
+    public Integer getBackupA4() {
+        return backupA4 != null ? backupA4 : 0;
+    }
+
+    public void setBackupA4(Integer backupA4) {
+        this.backupA4 = backupA4;
+    }
+
+    public Integer getTotalPkg() {
+        return totalPkg != null ? totalPkg : 0;
+    }
+
+    public void setTotalPkg(Integer totalPkg) {
+        this.totalPkg = totalPkg;
+    }
+
+}

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

@@ -10,13 +10,10 @@ package cn.com.qmth.examcloud.core.print.service.impl;
 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.PrintingProjectInfo;
-import cn.com.qmth.examcloud.core.print.service.bean.PrintingProjectQuery;
+import cn.com.qmth.examcloud.core.print.service.bean.ProjectStatisticInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-
 /**
  * @author: fengdesheng
  * @since: 2018/10/26
@@ -29,14 +26,13 @@ public class PrintingProjectStatisticServiceImpl implements PrintingProjectStati
     private CourseStatisticService courseStatisticService;
 
     @Override
-    public List<PrintingProjectInfo> getPrintingProjectStatisticList(PrintingProjectQuery query) {
-        //todo
+    public ProjectStatisticInfo getPrintingProjectStatistic(Long orgId, Long examId) {
         return null;
     }
 
     @Override
-    public void statistic() {
-        //todo
+    public void initPrintingProjectStatistics() {
+
     }
 
 }

+ 40 - 0
examcloud-core-print-starter/src/test/java/cn/com/qmth/examcloud/core/print/test/ProjectStatisticServiceTest.java

@@ -0,0 +1,40 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-10-30 11:06:53.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.core.print.test;
+
+import cn.com.qmth.examcloud.core.print.PrintApplication;
+import cn.com.qmth.examcloud.core.print.service.PrintingProjectStatisticService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author: fengdesheng
+ * @since: 2018/10/17
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = PrintApplication.class)
+public class ProjectStatisticServiceTest {
+    @Autowired
+    private PrintingProjectStatisticService printingProjectStatisticService;
+
+    @Test
+    public void getPrintingProjectStatisticTest() throws Exception {
+        Long orgId = 1L;
+        Long examId = 1L;
+        printingProjectStatisticService.getPrintingProjectStatistic(orgId, examId);
+    }
+
+    @Test
+    public void initPrintingProjectStatisticsTest() throws Exception {
+        printingProjectStatisticService.initPrintingProjectStatistics();
+    }
+
+}