|
@@ -0,0 +1,123 @@
|
|
|
|
+package cn.com.qmth.examcloud.core.oe.admin.api.provider;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamStatisticsCloudService;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamCompletionBean;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.api.request.GetExamCompletionStatisticsReq;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.api.response.GetExamCompletionStatisticsResp;
|
|
|
|
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
|
+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.ArrayList;
|
|
|
|
+import java.util.Iterator;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.function.Function;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Description 考试统计类
|
|
|
|
+ * @Author lideyin
|
|
|
|
+ * @Date 2019/9/27 11:32
|
|
|
|
+ * @Version 1.0
|
|
|
|
+ */
|
|
|
|
+@Api(tags = "考试统计类")
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("${$rmp.cloud.oe}/examStatistics")
|
|
|
|
+public class ExamStatisticsCloudServiceProvider extends ControllerSupport implements ExamStatisticsCloudService {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @ApiOperation(value = "获取考试完成情况统计信息")
|
|
|
|
+ @PostMapping("/getExamCompletionStatistics")
|
|
|
|
+ public GetExamCompletionStatisticsResp getExamCompletionStatistics(@RequestBody GetExamCompletionStatisticsReq req) {
|
|
|
|
+ GetExamCompletionStatisticsResp resp = new GetExamCompletionStatisticsResp();
|
|
|
|
+ PageInfo<ExamCompletionBeanW> examCompletionInfo = null;//TODO 调王伟接口获取
|
|
|
|
+ PageInfo<ExamCompletionBean> pagedList = getPageInfoFrom(examCompletionInfo);
|
|
|
|
+ resp.setPagedExamCompletionList(pagedList);
|
|
|
|
+ return resp;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private PageInfo<ExamCompletionBean> getPageInfoFrom(PageInfo<ExamCompletionBeanW> examCompletionInfo) {
|
|
|
|
+ PageInfo<ExamCompletionBean> resultPageInfo = new PageInfo<>();
|
|
|
|
+ resultPageInfo.setTotal(examCompletionInfo.getTotal());
|
|
|
|
+ resultPageInfo.setIndex(examCompletionInfo.getIndex());
|
|
|
|
+ resultPageInfo.setLimit(examCompletionInfo.getLimit());
|
|
|
|
+ resultPageInfo.setPages(examCompletionInfo.getPages());
|
|
|
|
+ resultPageInfo.setSize(examCompletionInfo.getSize());
|
|
|
|
+ List<ExamCompletionBean> resultList = new ArrayList<>();
|
|
|
|
+ List<ExamCompletionBeanW> list = examCompletionInfo.getList();
|
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
|
+ for (ExamCompletionBeanW ni : list) {
|
|
|
|
+ ExamCompletionBean bean = new ExamCompletionBean();
|
|
|
|
+ bean.setExamId(ni.getExamId());
|
|
|
|
+ bean.setExamName(ni.getExamName());
|
|
|
|
+ bean.setExamType(ni.getExamType());
|
|
|
|
+ bean.setStartTime(ni.getStartTime());
|
|
|
|
+ bean.setEndTime(ni.getEndTime());
|
|
|
|
+ resultList.add(bean);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ resultPageInfo.setList(resultList);
|
|
|
|
+ return resultPageInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //TODO 临时用一下
|
|
|
|
+ private class ExamCompletionBeanW {
|
|
|
|
+ //考试id
|
|
|
|
+ private Long examId;
|
|
|
|
+ //考试名称
|
|
|
|
+ private String examName;
|
|
|
|
+ //考试类型
|
|
|
|
+ private String examType;
|
|
|
|
+ //考试开始时间
|
|
|
|
+ private String startTime;
|
|
|
|
+ //考试结束时间
|
|
|
|
+ private String endTime;
|
|
|
|
+
|
|
|
|
+ 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 String getExamType() {
|
|
|
|
+ return examType;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setExamType(String examType) {
|
|
|
|
+ this.examType = examType;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getStartTime() {
|
|
|
|
+ return startTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setStartTime(String startTime) {
|
|
|
|
+ this.startTime = startTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getEndTime() {
|
|
|
|
+ return endTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setEndTime(String endTime) {
|
|
|
|
+ this.endTime = endTime;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|