Selaa lähdekoodia

新增考试导览

yin 19 tuntia sitten
vanhempi
commit
a4d3228a44

+ 61 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/bean/ExamOverview.java

@@ -0,0 +1,61 @@
+package cn.com.qmth.stmms.biz.exam.bean;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class ExamOverview {
+
+    @ApiModelProperty(value = "条码张数")
+    private Long studentCount;
+
+    @ApiModelProperty(value = "科目数")
+    private Long subjectCount;
+
+    @ApiModelProperty(value = "检查考生")
+    private Boolean checkStudent;
+
+    @ApiModelProperty(value = "检查科目")
+    private Boolean checkSubject;
+
+    @ApiModelProperty(value = "检查缺考")
+    private Boolean checkAbsent;
+
+    public Long getStudentCount() {
+        return studentCount;
+    }
+
+    public void setStudentCount(Long studentCount) {
+        this.studentCount = studentCount;
+    }
+
+    public Long getSubjectCount() {
+        return subjectCount;
+    }
+
+    public void setSubjectCount(Long subjectCount) {
+        this.subjectCount = subjectCount;
+    }
+
+    public Boolean getCheckStudent() {
+        return checkStudent;
+    }
+
+    public void setCheckStudent(Boolean checkStudent) {
+        this.checkStudent = checkStudent;
+    }
+
+    public Boolean getCheckSubject() {
+        return checkSubject;
+    }
+
+    public void setCheckSubject(Boolean checkSubject) {
+        this.checkSubject = checkSubject;
+    }
+
+    public Boolean getCheckAbsent() {
+        return checkAbsent;
+    }
+
+    public void setCheckAbsent(Boolean checkAbsent) {
+        this.checkAbsent = checkAbsent;
+    }
+}

+ 0 - 4
stmms-web/src/main/java/cn/com/qmth/stmms/api/controller/BaseApiController.java

@@ -187,10 +187,6 @@ public class BaseApiController extends BaseController {
         }
     }
 
-    public WebUser getWebUser() {
-        return RequestUtils.getWebUser();
-    }
-
     public ApiUser getApiUser() {
         return RequestUtils.getApiUser();
     }

+ 27 - 19
stmms-web/src/main/java/cn/com/qmth/stmms/api/controller/admin/ExamController.java

@@ -1,30 +1,20 @@
 package cn.com.qmth.stmms.api.controller.admin;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
+import cn.com.qmth.stmms.biz.exam.service.CheckStudentService;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import com.qmth.boot.core.collection.PageResult;
 
 import cn.com.qmth.stmms.api.controller.BaseApiController;
-import cn.com.qmth.stmms.biz.exam.bean.ExamReport;
-import cn.com.qmth.stmms.biz.exam.bean.ExamView;
-import cn.com.qmth.stmms.biz.exam.bean.ExamVo;
-import cn.com.qmth.stmms.biz.exam.bean.ResultMessage;
+import cn.com.qmth.stmms.biz.exam.bean.*;
 import cn.com.qmth.stmms.biz.exam.model.Exam;
 import cn.com.qmth.stmms.biz.exam.query.ExamSearchQuery;
 import cn.com.qmth.stmms.biz.exam.service.ExamService;
@@ -37,11 +27,7 @@ import cn.com.qmth.stmms.biz.user.model.User;
 import cn.com.qmth.stmms.biz.utils.PageUtil;
 import cn.com.qmth.stmms.common.annotation.Logging;
 import cn.com.qmth.stmms.common.domain.ApiUser;
-import cn.com.qmth.stmms.common.enums.ExamStatus;
-import cn.com.qmth.stmms.common.enums.ExamType;
-import cn.com.qmth.stmms.common.enums.LogType;
-import cn.com.qmth.stmms.common.enums.ObjectiveStatus;
-import cn.com.qmth.stmms.common.enums.TrackCountPolicy;
+import cn.com.qmth.stmms.common.enums.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import net.sf.json.JSONArray;
@@ -72,6 +58,8 @@ public class ExamController extends BaseApiController {
 
     @Autowired
     private ExamService examService;
+    @Autowired
+    private CheckStudentService checkStudentService;
 
     @ApiOperation(value = "保存考试ai检测预估时间")
     @ResponseBody
@@ -322,4 +310,24 @@ public class ExamController extends BaseApiController {
         return ret;
     }
 
+    @ApiOperation(value = "考试导览")
+    @RequestMapping(value = "overview", method = RequestMethod.POST)
+    @ResponseBody
+    public ExamOverview overview() {
+        int examId = getSessionExamId();
+        ExamOverview overview = new ExamOverview();
+        long studentCount = examStudentService.countByExamId(examId);
+        overview.setStudentCount(studentCount);
+        overview.setSubjectCount(examSubjectService.count(examId));
+        if (studentCount > 0
+                && checkStudentService.countByExamIdAndCheckedAndType(examId, false, CheckType.MANUAL) == 0) {
+            overview.setCheckStudent(true);
+        } else {
+            overview.setCheckStudent(false);
+        }
+        overview.setCheckSubject(studentCount > 0 && examSubjectService.checkSubjectForExport(examId));
+        overview.setCheckAbsent(studentCount > 0 && examSubjectService.checkSubjectAbsentForExport(examId));
+        return overview;
+    }
+
 }