|
@@ -1,5 +1,8 @@
|
|
package cn.com.qmth.stmms.admin.exam;
|
|
package cn.com.qmth.stmms.admin.exam;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -15,13 +18,19 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
import cn.com.qmth.stmms.admin.exam.parameter.BaseParameterController;
|
|
import cn.com.qmth.stmms.admin.exam.parameter.BaseParameterController;
|
|
|
|
+import cn.com.qmth.stmms.admin.vo.ExamInfoVO;
|
|
import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
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.query.ExamSearchQuery;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkerService;
|
|
|
|
+import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.common.auth.annotation.AuthRequire;
|
|
import cn.com.qmth.stmms.common.auth.annotation.AuthRequire;
|
|
import cn.com.qmth.stmms.common.enums.Auth;
|
|
import cn.com.qmth.stmms.common.enums.Auth;
|
|
import cn.com.qmth.stmms.common.enums.ExamStatus;
|
|
import cn.com.qmth.stmms.common.enums.ExamStatus;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.LibraryStatus;
|
|
import cn.com.qmth.stmms.common.enums.UserType;
|
|
import cn.com.qmth.stmms.common.enums.UserType;
|
|
import cn.com.qmth.stmms.common.session.model.StmmsSession;
|
|
import cn.com.qmth.stmms.common.session.model.StmmsSession;
|
|
import cn.com.qmth.stmms.common.utils.Paginator;
|
|
import cn.com.qmth.stmms.common.utils.Paginator;
|
|
@@ -35,6 +44,15 @@ public class ExamController extends BaseParameterController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ExamService examService;
|
|
private ExamService examService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExamStudentService examStudentService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExamSubjectService examSubjectService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MarkerService markerService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MarkLibraryService libraryService;
|
|
|
|
+
|
|
|
|
|
|
@RequestMapping(value = { "", "/list" })
|
|
@RequestMapping(value = { "", "/list" })
|
|
@AuthRequire(value = { Auth.EXAM_VIEW_SELF, Auth.EXAM_VIEW_CAMPUS }, isAny = true)
|
|
@AuthRequire(value = { Auth.EXAM_VIEW_SELF, Auth.EXAM_VIEW_CAMPUS }, isAny = true)
|
|
@@ -94,72 +112,80 @@ public class ExamController extends BaseParameterController {
|
|
return "redirect:/exam/list";
|
|
return "redirect:/exam/list";
|
|
}
|
|
}
|
|
|
|
|
|
- @RequestMapping("/view/{examId}")
|
|
|
|
- @AuthRequire({ Auth.EXAM_VIEW_SELF })
|
|
|
|
- public String view(Model model, HttpServletRequest request, @PathVariable Integer examId) {
|
|
|
|
- StmmsSession session = RequestUtils.getSession(request);
|
|
|
|
- session.setParameter("examId", examId.toString());
|
|
|
|
-
|
|
|
|
- User user = RequestUtils.getWebUser(request).getUser();
|
|
|
|
- if (user.getType() == UserType.ADMIN) {
|
|
|
|
- // 管理员可以进入考生管理
|
|
|
|
- return "redirect:/admin/exam-param/student";
|
|
|
|
- } else {
|
|
|
|
- // 其他查询员类型,直接去成绩查询
|
|
|
|
- return "redirect:/admin/exam/score";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Exam exam = examService.findById(examId); long studentCount =
|
|
|
|
- * examStudentService.countByExamId(exam.getId()); long subjectCount =
|
|
|
|
- * examSubjectService.count(examId); long campusCount =
|
|
|
|
- * examStudentService.countCampusByExam(examId); long markerCount =
|
|
|
|
- * markerService.countByExam(exam.getId()); long scanCount =
|
|
|
|
- * examStudentService.countByExamIdAndUpload(examId, true); long
|
|
|
|
- * markedCount = libraryService.countByExamAndStatus(examId,
|
|
|
|
- * LibraryStatus.MARKED);
|
|
|
|
- *
|
|
|
|
- * List<ExamInfoVO> voList = new ArrayList<ExamInfoVO>();
|
|
|
|
- *
|
|
|
|
- * ExamInfoVO student = new ExamInfoVO(); student.setName("考生");
|
|
|
|
- * student.setAttr("共导入 " + studentCount + " 个考生");
|
|
|
|
- * student.setUrl("/admin/exam-param/student");
|
|
|
|
- *
|
|
|
|
- * ExamInfoVO subject = new ExamInfoVO(); subject.setName("科目");
|
|
|
|
- * subject.setAttr("共导入 " + subjectCount + " 个科目");
|
|
|
|
- * subject.setUrl("/admin/exam-param/paper");
|
|
|
|
- *
|
|
|
|
- * ExamInfoVO campus = new ExamInfoVO(); campus.setName("学习中心");
|
|
|
|
- * campus.setAttr("共导入 " + campusCount + " 个学习中心");
|
|
|
|
- * campus.setUrl("/admin/exam-param/student");
|
|
|
|
- *
|
|
|
|
- * ExamInfoVO marker = new ExamInfoVO(); marker.setName("评卷员");
|
|
|
|
- * marker.setAttr("已创建 " + markerCount + " 个评卷员");
|
|
|
|
- * marker.setUrl("/admin/exam-param/marker");
|
|
|
|
- *
|
|
|
|
- * ExamInfoVO scan = new ExamInfoVO(); scan.setName("扫描进度");
|
|
|
|
- * scan.setAttr("已扫描 " + scanCount + " 个考生");
|
|
|
|
- * scan.setUrl("/admin/exam/scan");
|
|
|
|
- *
|
|
|
|
- * ExamInfoVO mark = new ExamInfoVO(); mark.setName("评卷进度");
|
|
|
|
- * mark.setAttr("已评完 " + markedCount + " 个考生");
|
|
|
|
- * mark.setUrl("/admin/exam/mark");
|
|
|
|
- *
|
|
|
|
- * // ExamInfoVO objective = new ExamInfoVO(); //
|
|
|
|
- * objective.setName("客观题"); // objective.setAttr("已设置 " +
|
|
|
|
- * objectiveCount + " 个科目"); //
|
|
|
|
- * objective.setUrl("/admin/exam-param/objective"); // // ExamInfoVO
|
|
|
|
- * subjective = new ExamInfoVO(); // subjective.setName("主观题"); //
|
|
|
|
- * subjective.setAttr("已设置 " + subjectiveCount + " 个科目"); //
|
|
|
|
- * subjective.setUrl("/admin/exam-param/subjective");
|
|
|
|
- *
|
|
|
|
- * voList.add(student); voList.add(subject); voList.add(campus);
|
|
|
|
- * voList.add(marker); voList.add(scan); voList.add(mark); //
|
|
|
|
- * voList.add(objective); // voList.add(subjective);
|
|
|
|
- * model.addAttribute("exam", exam); model.addAttribute("list", voList);
|
|
|
|
- * return "modules/exam/examInfo";
|
|
|
|
- */
|
|
|
|
- }
|
|
|
|
|
|
+ @RequestMapping("/view/{examId}")
|
|
|
|
+ @AuthRequire({ Auth.EXAM_VIEW_SELF })
|
|
|
|
+ public String view(Model model, HttpServletRequest request,@PathVariable Integer examId) {
|
|
|
|
+ StmmsSession session = RequestUtils.getSession(request);
|
|
|
|
+ session.setParameter("examId", examId.toString());
|
|
|
|
+ return "redirect:/admin/exam-param/student";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping("/view/{examId}/info")
|
|
|
|
+ @AuthRequire({ Auth.EXAM_VIEW_SELF })
|
|
|
|
+ public String info(Model model, HttpServletRequest request,@PathVariable Integer examId) {
|
|
|
|
+ StmmsSession session = RequestUtils.getSession(request);
|
|
|
|
+ session.setParameter("examId", examId.toString());
|
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
|
+ long studentCount = examStudentService.countByExamId(exam.getId());
|
|
|
|
+ long subjectCount = examSubjectService.count(examId);
|
|
|
|
+ long campusCount = examStudentService.countCampusByExam(examId);
|
|
|
|
+ long markerCount = markerService.countByExam(exam.getId());
|
|
|
|
+ long scanCount = examStudentService.countByExamIdAndUpload(examId, true);
|
|
|
|
+ long markedCount = libraryService.countByExamAndStatus(examId,LibraryStatus.MARKED);
|
|
|
|
+
|
|
|
|
+ List<ExamInfoVO> voList = new ArrayList<ExamInfoVO>();
|
|
|
|
+
|
|
|
|
+ ExamInfoVO student = new ExamInfoVO();
|
|
|
|
+ student.setName("考生");
|
|
|
|
+ student.setAttr("共导入 " + studentCount + " 个考生");
|
|
|
|
+ student.setUrl("/admin/exam-param/student");
|
|
|
|
+
|
|
|
|
+ ExamInfoVO subject = new ExamInfoVO();
|
|
|
|
+ subject.setName("科目");
|
|
|
|
+ subject.setAttr("共导入 " + subjectCount + " 个科目");
|
|
|
|
+ subject.setUrl("/admin/exam-param/paper");
|
|
|
|
+
|
|
|
|
+ ExamInfoVO campus = new ExamInfoVO();
|
|
|
|
+ campus.setName("学习中心");
|
|
|
|
+ campus.setAttr("共导入 " + campusCount + " 个学习中心");
|
|
|
|
+ campus.setUrl("/admin/exam-param/student");
|
|
|
|
+
|
|
|
|
+ ExamInfoVO marker = new ExamInfoVO();
|
|
|
|
+ marker.setName("评卷员");
|
|
|
|
+ marker.setAttr("已创建 " + markerCount + " 个评卷员");
|
|
|
|
+ marker.setUrl("/admin/exam-param/marker");
|
|
|
|
+
|
|
|
|
+ ExamInfoVO scan = new ExamInfoVO();
|
|
|
|
+ scan.setName("扫描进度");
|
|
|
|
+ scan.setAttr("已扫描 " + scanCount + " 个考生");
|
|
|
|
+ scan.setUrl("/admin/exam/scan");
|
|
|
|
+
|
|
|
|
+ ExamInfoVO mark = new ExamInfoVO();
|
|
|
|
+ mark.setName("评卷进度");
|
|
|
|
+ mark.setAttr("已评完 " + markedCount + " 个考生");
|
|
|
|
+ mark.setUrl("/admin/exam/mark");
|
|
|
|
+
|
|
|
|
+ // ExamInfoVO objective = new ExamInfoVO();
|
|
|
|
+ // objective.setName("客观题");
|
|
|
|
+ // objective.setAttr("已设置 " + objectiveCount + " 个科目");
|
|
|
|
+ // objective.setUrl("/admin/exam-param/objective");
|
|
|
|
+ // ExamInfoVO subjective = new ExamInfoVO();
|
|
|
|
+ // subjective.setName("主观题");
|
|
|
|
+ // subjective.setAttr("已设置 " + subjectiveCount + " 个科目");
|
|
|
|
+ // subjective.setUrl("/admin/exam-param/subjective");
|
|
|
|
+
|
|
|
|
+ voList.add(student);
|
|
|
|
+ voList.add(subject);
|
|
|
|
+ voList.add(campus);
|
|
|
|
+ voList.add(marker);
|
|
|
|
+ voList.add(scan);
|
|
|
|
+ voList.add(mark);
|
|
|
|
+ // voList.add(objective);
|
|
|
|
+ // voList.add(subjective);
|
|
|
|
+ model.addAttribute("exam", exam);
|
|
|
|
+ model.addAttribute("list", voList);
|
|
|
|
+ return "modules/exam/examInfo";
|
|
|
|
+ }
|
|
|
|
|
|
@RequestMapping("/analysisinfo")
|
|
@RequestMapping("/analysisinfo")
|
|
@AuthRequire({ Auth.EXAM_VIEW_SELF })
|
|
@AuthRequire({ Auth.EXAM_VIEW_SELF })
|