|
@@ -1,73 +1,46 @@
|
|
package cn.com.qmth.stmms.mark;
|
|
package cn.com.qmth.stmms.mark;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-
|
|
|
|
-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.admin.utils.SessionExamUtils;
|
|
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.model.ExamSubject;
|
|
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.MarkGroup;
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
-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.exam.service.*;
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
-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.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.model.*;
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
-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.mark.service.*;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
import cn.com.qmth.stmms.common.controller.BaseController;
|
|
import cn.com.qmth.stmms.common.controller.BaseController;
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
-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.enums.*;
|
|
import cn.com.qmth.stmms.common.session.model.StmmsSession;
|
|
import cn.com.qmth.stmms.common.session.model.StmmsSession;
|
|
import cn.com.qmth.stmms.common.session.service.SessionService;
|
|
import cn.com.qmth.stmms.common.session.service.SessionService;
|
|
import cn.com.qmth.stmms.common.utils.Md5EncryptUtils;
|
|
import cn.com.qmth.stmms.common.utils.Md5EncryptUtils;
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
-
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
+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.ArrayList;
|
|
|
|
+import java.util.Calendar;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Controller
|
|
@Controller
|
|
@RequestMapping("/mark")
|
|
@RequestMapping("/mark")
|
|
@@ -162,7 +135,8 @@ public class MarkController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/subject-select", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/subject-select", method = RequestMethod.POST)
|
|
- public ModelAndView select(HttpServletRequest request, HttpServletResponse response, @RequestParam Integer markerId) {
|
|
|
|
|
|
+ public ModelAndView select(HttpServletRequest request, HttpServletResponse response,
|
|
|
|
+ @RequestParam Integer markerId) {
|
|
User user = RequestUtils.getWebUser(request).getUser();
|
|
User user = RequestUtils.getWebUser(request).getUser();
|
|
ModelAndView modelAndView = new ModelAndView("modules/mark/subjectSelectAp");
|
|
ModelAndView modelAndView = new ModelAndView("modules/mark/subjectSelectAp");
|
|
Calendar rightNow = Calendar.getInstance();
|
|
Calendar rightNow = Calendar.getInstance();
|
|
@@ -234,7 +208,8 @@ public class MarkController extends BaseController {
|
|
markerService.save(marker);
|
|
markerService.save(marker);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ModelAndView view = new ModelAndView(mode == MarkMode.TRACK ? "modules/mark/markTrack" : "modules/mark/markNew");
|
|
|
|
|
|
+ ModelAndView view = new ModelAndView(
|
|
|
|
+ mode == MarkMode.TRACK ? "modules/mark/markTrack" : "modules/mark/markNew");
|
|
view.addObject("forceMode", forceMode);
|
|
view.addObject("forceMode", forceMode);
|
|
view.addObject("sheetView", group.isSheetView());
|
|
view.addObject("sheetView", group.isSheetView());
|
|
view.addObject("enableAllZero", group.isEnableAllZero());
|
|
view.addObject("enableAllZero", group.isEnableAllZero());
|
|
@@ -391,8 +366,9 @@ public class MarkController extends BaseController {
|
|
List<MarkLibrary> list = new ArrayList<MarkLibrary>();
|
|
List<MarkLibrary> list = new ArrayList<MarkLibrary>();
|
|
// 需要判断评卷员是否绑定了班级
|
|
// 需要判断评卷员是否绑定了班级
|
|
long classCount = markerClassService.countByUserIdAndExamId(marker.getUserId(), marker.getExamId());
|
|
long classCount = markerClassService.countByUserIdAndExamId(marker.getUserId(), marker.getExamId());
|
|
- list = libraryService.findUnMarked(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber(),
|
|
|
|
- marker.getId(), marker.getUserId(), classCount > 0, retry, 20);
|
|
|
|
|
|
+ list = libraryService
|
|
|
|
+ .findUnMarked(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber(), marker.getId(),
|
|
|
|
+ marker.getUserId(), classCount > 0, retry, 20);
|
|
if (list.isEmpty()) {
|
|
if (list.isEmpty()) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -413,8 +389,9 @@ public class MarkController extends BaseController {
|
|
int retry = 1;
|
|
int retry = 1;
|
|
Task task = null;
|
|
Task task = null;
|
|
while (task == null) {
|
|
while (task == null) {
|
|
- List<TrialLibrary> list = trialService.findUnMarkedLibrary(marker.getExamId(), marker.getSubjectCode(),
|
|
|
|
- marker.getGroupNumber(), marker.getId(), retry, 10);
|
|
|
|
|
|
+ List<TrialLibrary> list = trialService
|
|
|
|
+ .findUnMarkedLibrary(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber(),
|
|
|
|
+ marker.getId(), retry, 10);
|
|
if (list.isEmpty()) {
|
|
if (list.isEmpty()) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -467,7 +444,7 @@ public class MarkController extends BaseController {
|
|
public Object history(HttpServletRequest request, @RequestParam int pageNumber, @RequestParam int pageSize,
|
|
public Object history(HttpServletRequest request, @RequestParam int pageNumber, @RequestParam int pageSize,
|
|
@RequestParam String order, @RequestParam String sort,
|
|
@RequestParam String order, @RequestParam String sort,
|
|
@RequestParam(required = false, defaultValue = "false") Boolean isTag,
|
|
@RequestParam(required = false, defaultValue = "false") Boolean isTag,
|
|
- @RequestParam(required = false) Integer studentId) throws Exception {
|
|
|
|
|
|
+ @RequestParam(required = false) String secretNumber) throws Exception {
|
|
Marker marker = RequestUtils.getWebUser(request).getMarker();
|
|
Marker marker = RequestUtils.getWebUser(request).getMarker();
|
|
List<Task> list = new ArrayList<>();
|
|
List<Task> list = new ArrayList<>();
|
|
Direction d = Direction.DESC;
|
|
Direction d = Direction.DESC;
|
|
@@ -492,6 +469,7 @@ public class MarkController extends BaseController {
|
|
query.addStatus(LibraryStatus.MARKED);
|
|
query.addStatus(LibraryStatus.MARKED);
|
|
query.addStatus(LibraryStatus.INSPECTED);
|
|
query.addStatus(LibraryStatus.INSPECTED);
|
|
query.setGroupNumber(marker.getGroupNumber());
|
|
query.setGroupNumber(marker.getGroupNumber());
|
|
|
|
+ query.setSecretNumber(secretNumber);
|
|
query.setPageNumber(pageNumber);
|
|
query.setPageNumber(pageNumber);
|
|
query.setPageSize(pageSize);
|
|
query.setPageSize(pageSize);
|
|
if (querySort != null) {
|
|
if (querySort != null) {
|
|
@@ -499,9 +477,6 @@ public class MarkController extends BaseController {
|
|
} else {
|
|
} else {
|
|
query.orderByMarkerTimeDesc();
|
|
query.orderByMarkerTimeDesc();
|
|
}
|
|
}
|
|
- if (studentId != null) {
|
|
|
|
- query.setStudentId(studentId);
|
|
|
|
- }
|
|
|
|
list = taskService.findByQuery(query);
|
|
list = taskService.findByQuery(query);
|
|
for (Task task : list) {
|
|
for (Task task : list) {
|
|
task.setPrevious(true);
|
|
task.setPrevious(true);
|
|
@@ -509,12 +484,14 @@ public class MarkController extends BaseController {
|
|
} else if (group != null && group.getStatus() == MarkStatus.TRIAL) {
|
|
} else if (group != null && group.getStatus() == MarkStatus.TRIAL) {
|
|
// 试评查找给分历史记录
|
|
// 试评查找给分历史记录
|
|
List<TrialHistory> historyList = new ArrayList<TrialHistory>();
|
|
List<TrialHistory> historyList = new ArrayList<TrialHistory>();
|
|
- if (studentId != null) {
|
|
|
|
- historyList = trialService.findHistory(marker.getExamId(), marker.getSubjectCode(),
|
|
|
|
- marker.getGroupNumber(), marker.getId(), studentId, pageNumber, pageSize, querySort);
|
|
|
|
|
|
+ if (secretNumber != null) {
|
|
|
|
+ historyList = trialService
|
|
|
|
+ .findHistory(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber(),
|
|
|
|
+ marker.getId(), secretNumber, pageNumber, pageSize, querySort);
|
|
} else {
|
|
} else {
|
|
- historyList = trialService.findHistory(marker.getExamId(), marker.getSubjectCode(),
|
|
|
|
- marker.getGroupNumber(), marker.getId(), pageNumber, pageSize, querySort, null);
|
|
|
|
|
|
+ historyList = trialService
|
|
|
|
+ .findHistory(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber(),
|
|
|
|
+ marker.getId(), pageNumber, pageSize, querySort, null);
|
|
}
|
|
}
|
|
for (TrialHistory history : historyList) {
|
|
for (TrialHistory history : historyList) {
|
|
TrialLibrary library = trialService.findLibrary(history.getLibraryId());
|
|
TrialLibrary library = trialService.findLibrary(history.getLibraryId());
|