|
@@ -8,6 +8,7 @@ import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -25,6 +26,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
import cn.com.qmth.stmms.admin.dto.RejectResult;
|
|
|
import cn.com.qmth.stmms.admin.vo.InspectedSubjectVO;
|
|
|
+import cn.com.qmth.stmms.biz.exam.bean.InspectWorkVo;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
@@ -33,6 +35,7 @@ import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
|
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.InspectHistoryService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.InspectedService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.query.ExamSubjectSearchQuery;
|
|
|
import cn.com.qmth.stmms.biz.file.service.FileService;
|
|
@@ -49,6 +52,7 @@ import cn.com.qmth.stmms.common.enums.LogType;
|
|
|
import cn.com.qmth.stmms.common.enums.Role;
|
|
|
import cn.com.qmth.stmms.common.enums.SelectiveStatus;
|
|
|
import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
|
|
|
+import cn.com.qmth.stmms.common.utils.ExportExcel;
|
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
@@ -63,6 +67,9 @@ public class InspectedController extends BaseExamController {
|
|
|
|
|
|
@Autowired
|
|
|
private InspectedService inspectedService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private InspectHistoryService inspectHistoryService;
|
|
|
|
|
|
@Autowired
|
|
|
private ExamQuestionService questionService;
|
|
@@ -157,17 +164,21 @@ public class InspectedController extends BaseExamController {
|
|
|
@Logging(menu = "开始考生复核", type = LogType.QUERY)
|
|
|
@RequestMapping(value = "/getTask", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public Task getTask(HttpServletRequest request, RedirectAttributes redirectAttributes, ExamStudentSearchQuery query,
|
|
|
+ public Task getTask(HttpServletRequest request, RedirectAttributes ra, ExamStudentSearchQuery query,
|
|
|
@RequestParam(required = false, defaultValue = "false") SelectiveStatus selectiveStatus,
|
|
|
@RequestParam(required = false) Integer mainNumber, @RequestParam(required = false) Double mainStartScore,
|
|
|
@RequestParam(required = false) Double mainEndScore, @RequestParam(required = false) Double questionScore,
|
|
|
@RequestParam(required = false) Integer studentId) {
|
|
|
int examId = getSessionExamId(request);
|
|
|
WebUser wu = RequestUtils.getWebUser(request);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
Task task = null;
|
|
|
if (studentId != null) {
|
|
|
+ ExamStudent student = studentService.findById(studentId);
|
|
|
+ if(exam.getInspectUnrepeated()&&inspectHistoryService.existByStudentIdAndUserId(studentId, wu.getId())) {
|
|
|
+ throw new RuntimeException("考试已设置为全卷多次复核时不能为同一账号");
|
|
|
+ }
|
|
|
releaseStudent(studentId);
|
|
|
- ExamStudent student = studentService.findById(studentId);
|
|
|
if (inspectedService.applyStudent(student, wu.getId())) {
|
|
|
task = taskService.build(student);
|
|
|
}
|
|
@@ -177,6 +188,9 @@ public class InspectedController extends BaseExamController {
|
|
|
if (student == null) {
|
|
|
return null;
|
|
|
}
|
|
|
+ if(exam.getInspectUnrepeated()&&inspectHistoryService.existByStudentIdAndUserId(studentId, wu.getId())) {
|
|
|
+ throw new RuntimeException("考试已设置为全卷多次复核时不能为同一账号");
|
|
|
+ }
|
|
|
releaseStudent(student.getId());
|
|
|
if (inspectedService.applyStudent(student, wu.getId())) {
|
|
|
task = taskService.build(student);
|
|
@@ -194,6 +208,8 @@ public class InspectedController extends BaseExamController {
|
|
|
query.setSubjectCode(subjectList.get(0).getCode());
|
|
|
}
|
|
|
query.setInspected(false);
|
|
|
+ query.setInspectUnrepeated(exam.getInspectUnrepeated());
|
|
|
+ query.setInspectorId(wu.getId());
|
|
|
list = inspectedService
|
|
|
.findByQuery(query, SubjectiveStatus.MARKED, mainNumber, mainStartScore, mainEndScore,selectiveStatus);
|
|
|
if (list.isEmpty()) {
|
|
@@ -542,4 +558,44 @@ public class InspectedController extends BaseExamController {
|
|
|
model.addAttribute("subjectList", getExamSubject(examId, wu));
|
|
|
return "modules/exam/inspectedInfo";
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "list/export", method = RequestMethod.POST)
|
|
|
+ public String exportListFile(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ RedirectAttributes redirectAttributes) {
|
|
|
+// Integer examId = getSessionExamId(request);
|
|
|
+// Exam exam = examService.findById(examId);
|
|
|
+// if (ExamType.MULTI_MEDIA.equals(exam.getType())) {
|
|
|
+// return "modules/exam/permission";
|
|
|
+// }
|
|
|
+// WebUser wu = RequestUtils.getWebUser(request);
|
|
|
+// try {
|
|
|
+// List<ScoreVerifyVo> list = scoreVerifyService.findFlagged(examId,wu.getId());
|
|
|
+// String fileName = "标记卷数据.xlsx";
|
|
|
+// new ExportExcel("标记卷数据", ScoreVerifyVo.class).setDataList(list).write(response, fileName)
|
|
|
+// .dispose();
|
|
|
+// return null;
|
|
|
+// } catch (Exception e) {
|
|
|
+// addMessage(redirectAttributes, "导出数据失败" + e.getMessage());
|
|
|
+// }
|
|
|
+ return "redirect:/admin/exam/inspected/list";
|
|
|
+ }
|
|
|
+ @RequestMapping(value = "work/export", method = RequestMethod.POST)
|
|
|
+ public String exportWorkFile(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ RedirectAttributes redirectAttributes) {
|
|
|
+ Integer examId = getSessionExamId(request);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
+ if (ExamType.MULTI_MEDIA.equals(exam.getType())) {
|
|
|
+ return "modules/exam/permission";
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ List<InspectWorkVo> list = inspectHistoryService.findInspectWork(examId);
|
|
|
+ String fileName = "复核工作量.xlsx";
|
|
|
+ new ExportExcel("复核工作量", InspectWorkVo.class).setDataList(list).write(response, fileName)
|
|
|
+ .dispose();
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ addMessage(redirectAttributes, "导出数据失败" + e.getMessage());
|
|
|
+ }
|
|
|
+ return "redirect:/admin/exam/inspected/list";
|
|
|
+ }
|
|
|
}
|