|
@@ -27,9 +27,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
+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.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.lock.LockService;
|
|
@@ -42,6 +44,7 @@ import cn.com.qmth.stmms.biz.mark.service.TaskService;
|
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
|
import cn.com.qmth.stmms.common.auth.annotation.RoleRequire;
|
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
|
+import cn.com.qmth.stmms.common.enums.ExamType;
|
|
|
import cn.com.qmth.stmms.common.enums.HistoryStatus;
|
|
|
import cn.com.qmth.stmms.common.enums.LockType;
|
|
|
import cn.com.qmth.stmms.common.enums.Role;
|
|
@@ -77,6 +80,9 @@ public class ArbitrateController extends BaseExamController {
|
|
|
@Autowired
|
|
|
private ExamQuestionService questionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ExamService examService;
|
|
|
+
|
|
|
@Value("${slice.image.server}")
|
|
|
private String sliceServer;
|
|
|
|
|
@@ -86,6 +92,9 @@ public class ArbitrateController extends BaseExamController {
|
|
|
@Value("${card.server}")
|
|
|
private String cardServer;
|
|
|
|
|
|
+ @Value("${answer.server}")
|
|
|
+ private String answerServer;
|
|
|
+
|
|
|
// 并发处理互斥锁
|
|
|
private Map<Integer, Integer> currentTaskMap = new HashMap<Integer, Integer>();
|
|
|
|
|
@@ -144,6 +153,11 @@ public class ArbitrateController extends BaseExamController {
|
|
|
model.addAttribute("subject", subjectService.find(group.getExamId(), group.getSubjectCode()));
|
|
|
model.addAttribute("group", group);
|
|
|
model.addAttribute("history", history);
|
|
|
+ model.addAttribute("answerServer", answerServer);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
+ if (ExamType.MULTI_MEDIA.equals(exam.getType())) {
|
|
|
+ return "modules/exam/arbitrateSingleProcessJson";
|
|
|
+ }
|
|
|
return "modules/exam/arbitrateSingleProcess";
|
|
|
}
|
|
|
|
|
@@ -166,6 +180,11 @@ public class ArbitrateController extends BaseExamController {
|
|
|
model.addAttribute("cardServer", cardServer);
|
|
|
model.addAttribute("subject", subjectService.find(group.getExamId(), group.getSubjectCode()));
|
|
|
model.addAttribute("group", group);
|
|
|
+ model.addAttribute("answerServer", answerServer);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
+ if (ExamType.MULTI_MEDIA.equals(exam.getType())) {
|
|
|
+ return "modules/exam/arbitrateBatchProcessJson";
|
|
|
+ }
|
|
|
return "modules/exam/arbitrateBatchProcess";
|
|
|
}
|
|
|
|
|
@@ -218,6 +237,7 @@ public class ArbitrateController extends BaseExamController {
|
|
|
querySort = new Sort(d, "totalScore");
|
|
|
}
|
|
|
MarkGroup group = groupService.findOne(examId, subjectCode, groupNumber);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
List<Task> list = new LinkedList<Task>();
|
|
|
if (subjectCheck(subjectCode, wu) && group != null) {
|
|
|
ArbitrateHistorySearchQuery query = new ArbitrateHistorySearchQuery();
|
|
@@ -238,7 +258,7 @@ public class ArbitrateController extends BaseExamController {
|
|
|
}
|
|
|
query = arbitrateService.findByQuery(query);
|
|
|
for (ArbitrateHistory history : query.getResult()) {
|
|
|
- list.add(taskService.build(history, group));
|
|
|
+ list.add(taskService.build(history, group, exam.getType()));
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
@@ -249,12 +269,13 @@ public class ArbitrateController extends BaseExamController {
|
|
|
@RoleRequire({ Role.SCHOOL_ADMIN, Role.SUBJECT_HEADER })
|
|
|
public Task getSingleTask(HttpServletRequest request, @RequestParam Integer historyId) {
|
|
|
int examId = getSessionExamId(request);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
WebUser wu = RequestUtils.getWebUser(request);
|
|
|
ArbitrateHistory history = arbitrateService.findById(historyId);
|
|
|
if (history != null && history.getExamId().equals(examId) && subjectCheck(history.getSubjectCode(), wu)) {
|
|
|
MarkGroup group = groupService.findOne(history.getExamId(), history.getSubjectCode(),
|
|
|
history.getGroupNumber());
|
|
|
- return taskService.build(history, group);
|
|
|
+ return taskService.build(history, group, exam.getType());
|
|
|
}
|
|
|
Task task = new Task();
|
|
|
task.setExist(false);
|
|
@@ -266,6 +287,7 @@ public class ArbitrateController extends BaseExamController {
|
|
|
@RoleRequire({ Role.SCHOOL_ADMIN, Role.SUBJECT_HEADER })
|
|
|
public Task getTask(HttpServletRequest request, @RequestParam String subjectCode, @RequestParam Integer groupNumber) {
|
|
|
int examId = getSessionExamId(request);
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
WebUser wu = RequestUtils.getWebUser(request);
|
|
|
MarkGroup group = groupService.findOne(examId, subjectCode, groupNumber);
|
|
|
if (subjectCheck(subjectCode, wu) && group != null) {
|
|
@@ -284,7 +306,7 @@ public class ArbitrateController extends BaseExamController {
|
|
|
for (ArbitrateHistory history : query.getResult()) {
|
|
|
// 尝试领取该任务并上锁
|
|
|
if (setCurrent(history.getId(), wu.getUser().getId())) {
|
|
|
- return taskService.build(history, group);
|
|
|
+ return taskService.build(history, group, exam.getType());
|
|
|
} else {
|
|
|
continue;
|
|
|
}
|