|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
}
|