|
@@ -1,22 +1,74 @@
|
|
|
package cn.com.qmth.stmms.mark;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import net.sf.json.JSONArray;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
+
|
|
|
+import org.apache.commons.lang.StringEscapeUtils;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
+import org.springframework.data.domain.Sort.Direction;
|
|
|
+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.servlet.ModelAndView;
|
|
|
+
|
|
|
import cn.com.qmth.stmms.admin.utils.SessionExamUtils;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
+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.ExamSubjectService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkerClassService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkerService;
|
|
|
import cn.com.qmth.stmms.biz.file.service.FileService;
|
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.*;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.MarkResult;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.PictureConfigItem;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.ProblemType;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.SubmitResult;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.Task;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.TrialHistory;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.TrialLibrary;
|
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
|
-import cn.com.qmth.stmms.biz.mark.service.*;
|
|
|
+import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
|
|
|
+import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
|
+import cn.com.qmth.stmms.biz.mark.service.ProblemTypeService;
|
|
|
+import cn.com.qmth.stmms.biz.mark.service.TaskService;
|
|
|
+import cn.com.qmth.stmms.biz.mark.service.TrialService;
|
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
|
import cn.com.qmth.stmms.common.controller.BaseController;
|
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
|
-import cn.com.qmth.stmms.common.enums.*;
|
|
|
+import cn.com.qmth.stmms.common.enums.ExamStatus;
|
|
|
+import cn.com.qmth.stmms.common.enums.ExamType;
|
|
|
+import cn.com.qmth.stmms.common.enums.LibraryStatus;
|
|
|
+import cn.com.qmth.stmms.common.enums.LockType;
|
|
|
+import cn.com.qmth.stmms.common.enums.LogType;
|
|
|
+import cn.com.qmth.stmms.common.enums.MarkMode;
|
|
|
+import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
|
import cn.com.qmth.stmms.common.session.model.StmmsSession;
|
|
|
import cn.com.qmth.stmms.common.session.service.SessionService;
|
|
|
import cn.com.qmth.stmms.common.utils.EncryptUtils;
|
|
@@ -25,26 +77,6 @@ import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
-import net.sf.json.JSONArray;
|
|
|
-import net.sf.json.JSONObject;
|
|
|
-
|
|
|
-import org.apache.commons.lang.StringEscapeUtils;
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.data.domain.Sort;
|
|
|
-import org.springframework.data.domain.Sort.Direction;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.servlet.ModelAndView;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import java.util.*;
|
|
|
-
|
|
|
@Controller
|
|
|
@RequestMapping("/mark")
|
|
|
public class MarkController extends BaseController {
|
|
@@ -184,18 +216,27 @@ public class MarkController extends BaseController {
|
|
|
|
|
|
Marker marker = markerService.findById(markerId);
|
|
|
if (marker == null) {
|
|
|
- modelAndView.addObject("message", "user.login.error.group");
|
|
|
+ modelAndView.addObject("message", "评卷分组不存在");
|
|
|
return modelAndView;
|
|
|
}
|
|
|
Exam exam = examService.findById(marker.getExamId());
|
|
|
modelAndView.addObject("exam", exam);
|
|
|
+ Date now = new Date();
|
|
|
+ if ((exam.getStartTime() != null && now.before(exam.getStartTime()))
|
|
|
+ || (exam.getEndTime() != null && now.after(exam.getEndTime()))) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String start = exam.getStartTime() == null ? "" : " 开始时间:" + sdf.format(exam.getStartTime());
|
|
|
+ String end = exam.getEndTime() == null ? "" : " 结束时间:" + sdf.format(exam.getEndTime());
|
|
|
+ modelAndView.addObject("message", "不在评卷时间范围 " + start + " " + end);
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
MarkGroup group = groupService.findOne(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber());
|
|
|
if (group == null) {
|
|
|
- modelAndView.addObject("message", "user.login.error.group");
|
|
|
+ modelAndView.addObject("message", "评卷分组不存在");
|
|
|
return modelAndView;
|
|
|
}
|
|
|
if (group.getStatus() == MarkStatus.FINISH) {
|
|
|
- modelAndView.addObject("message", "user.login.error.finish");
|
|
|
+ modelAndView.addObject("message", "评卷分组已结束");
|
|
|
return modelAndView;
|
|
|
}
|
|
|
user.setMarkerId(marker.getId());
|