Browse Source

update api

deason 2 năm trước cách đây
mục cha
commit
0874b7f793

+ 19 - 0
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/ExamStatisticController.java

@@ -1,12 +1,19 @@
 package cn.com.qmth.examcloud.core.oe.admin.api.controller;
 
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamStatisticService;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic.ExamStatisticInfo;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic.OverviewInfo;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 @RestController
 @Api(tags = "考试统计相关接口")
 @RequestMapping("${$rmp.ctr.oe}/exam/statistic")
@@ -15,4 +22,16 @@ public class ExamStatisticController extends ControllerSupport {
     @Autowired
     private ExamStatisticService examStatisticService;
 
+    @PostMapping("/overview")
+    @ApiOperation(value = "统计概况")
+    public OverviewInfo overview(@RequestParam Long examId, @RequestParam Long courseId) {
+        return examStatisticService.overview(examId, courseId);
+    }
+
+    @PostMapping("/overview/for/org")
+    @ApiOperation(value = "统计概况(学习中心)")
+    public List<ExamStatisticInfo> overviewForOrg(@RequestParam Long examId, @RequestParam Long courseId) {
+        return examStatisticService.overviewForOrg(examId, courseId);
+    }
+
 }

+ 1 - 1
examcloud-core-oe-admin-dao/src/main/java/cn/com/qmth/examcloud/core/oe/admin/dao/entity/ExamStatisticEntity.java

@@ -28,7 +28,7 @@ public class ExamStatisticEntity extends JpaEntity {
     private Long examId;
 
     /**
-     * 考试ID
+     * 课程ID
      */
     @Column(nullable = false)
     private Long courseId;

+ 9 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/ExamStatisticService.java

@@ -1,5 +1,14 @@
 package cn.com.qmth.examcloud.core.oe.admin.service;
 
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic.ExamStatisticInfo;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic.OverviewInfo;
+
+import java.util.List;
+
 public interface ExamStatisticService {
 
+    OverviewInfo overview(Long examId, Long courseId);
+
+    List<ExamStatisticInfo> overviewForOrg(Long examId, Long courseId);
+
 }

+ 153 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/statistic/ExamStatisticInfo.java

@@ -0,0 +1,153 @@
+package cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+
+public class ExamStatisticInfo implements JsonSerializable {
+
+    private static final long serialVersionUID = 5667104330981650606L;
+
+    private Long examId;
+
+    private Long courseId;
+
+    private Long orgId;
+
+    private String title;
+
+    /**
+     * 应考人数
+     */
+    private Integer allCount;
+
+    /**
+     * 实考人数
+     */
+    private Integer finishCount;
+
+    /**
+     * 缺考人数
+     */
+    private Integer unFinishCount;
+
+    /**
+     * 缺考率
+     */
+    private Double unFinishRate;
+
+    /**
+     * (成绩)及格人数
+     */
+    private Integer passScoreCount;
+
+    /**
+     * 及格率
+     */
+    private Double passScoreRate;
+
+    /**
+     * (成绩)优秀人数
+     */
+    private Integer goodScoreCount;
+
+    /**
+     * 优秀率
+     */
+    private Double goodScoreRate;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public Integer getAllCount() {
+        return allCount;
+    }
+
+    public void setAllCount(Integer allCount) {
+        this.allCount = allCount;
+    }
+
+    public Integer getFinishCount() {
+        return finishCount;
+    }
+
+    public void setFinishCount(Integer finishCount) {
+        this.finishCount = finishCount;
+    }
+
+    public Integer getUnFinishCount() {
+        return unFinishCount;
+    }
+
+    public void setUnFinishCount(Integer unFinishCount) {
+        this.unFinishCount = unFinishCount;
+    }
+
+    public Double getUnFinishRate() {
+        return unFinishRate;
+    }
+
+    public void setUnFinishRate(Double unFinishRate) {
+        this.unFinishRate = unFinishRate;
+    }
+
+    public Integer getPassScoreCount() {
+        return passScoreCount;
+    }
+
+    public void setPassScoreCount(Integer passScoreCount) {
+        this.passScoreCount = passScoreCount;
+    }
+
+    public Double getPassScoreRate() {
+        return passScoreRate;
+    }
+
+    public void setPassScoreRate(Double passScoreRate) {
+        this.passScoreRate = passScoreRate;
+    }
+
+    public Integer getGoodScoreCount() {
+        return goodScoreCount;
+    }
+
+    public void setGoodScoreCount(Integer goodScoreCount) {
+        this.goodScoreCount = goodScoreCount;
+    }
+
+    public Double getGoodScoreRate() {
+        return goodScoreRate;
+    }
+
+    public void setGoodScoreRate(Double goodScoreRate) {
+        this.goodScoreRate = goodScoreRate;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+}

+ 29 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/statistic/OverviewInfo.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+
+public class OverviewInfo implements JsonSerializable {
+
+    private static final long serialVersionUID = 5667104330981650606L;
+
+    private ExamStatisticInfo examResult;
+
+    private ExamStatisticInfo courseResult;
+
+    public ExamStatisticInfo getExamResult() {
+        return examResult;
+    }
+
+    public void setExamResult(ExamStatisticInfo examResult) {
+        this.examResult = examResult;
+    }
+
+    public ExamStatisticInfo getCourseResult() {
+        return courseResult;
+    }
+
+    public void setCourseResult(ExamStatisticInfo courseResult) {
+        this.courseResult = courseResult;
+    }
+
+}

+ 14 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStatisticServiceImpl.java

@@ -2,11 +2,15 @@ package cn.com.qmth.examcloud.core.oe.admin.service.impl;
 
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamStatisticRepo;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamStatisticService;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic.ExamStatisticInfo;
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.statistic.OverviewInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ExamStatisticServiceImpl implements ExamStatisticService {
 
@@ -15,4 +19,14 @@ public class ExamStatisticServiceImpl implements ExamStatisticService {
     @Autowired
     private ExamStatisticRepo examStatisticRepo;
 
+    @Override
+    public OverviewInfo overview(Long examId, Long courseId) {
+        return null;
+    }
+
+    @Override
+    public List<ExamStatisticInfo> overviewForOrg(Long examId, Long courseId) {
+        return null;
+    }
+
 }