|
@@ -1,19 +1,9 @@
|
|
|
package cn.com.qmth.stmms.admin.exam;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.LinkedList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
-import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
-import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -23,19 +13,16 @@ import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
-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.bind.annotation.*;
|
|
|
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
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.ArbitrateHistory;
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.ArbitrationDTO;
|
|
|
-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.Task;
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.*;
|
|
|
import cn.com.qmth.stmms.biz.mark.query.ArbitrateHistorySearchQuery;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.ArbitrateHistoryService;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
|
|
@@ -45,13 +32,7 @@ import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
|
import cn.com.qmth.stmms.common.annotation.RoleRequire;
|
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
|
-import cn.com.qmth.stmms.common.enums.ArbitrateType;
|
|
|
-import cn.com.qmth.stmms.common.enums.HistoryStatus;
|
|
|
-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.Role;
|
|
|
+import cn.com.qmth.stmms.common.enums.*;
|
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
@@ -195,11 +176,12 @@ public class ArbitrateController extends BaseExamController {
|
|
|
List<CollationLabel> list = collationLabelService.list(examId);
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
try {
|
|
|
- setting.accumulate("collationLabelList",mapper.writeValueAsString(list));
|
|
|
+ setting.accumulate("collationLabelList", mapper.writeValueAsString(list));
|
|
|
} catch (JsonProcessingException e) {
|
|
|
log.error("MarkController-整理异常获取出错", e);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void setMode(JSONObject setting, MarkGroup group, Exam exam) {
|
|
|
MarkMode mode = null;
|
|
|
boolean forceMode = false;
|
|
@@ -242,20 +224,32 @@ public class ArbitrateController extends BaseExamController {
|
|
|
@RequestParam(required = false) String reason) {
|
|
|
JSONObject obj = new JSONObject();
|
|
|
WebUser wu = RequestUtils.getWebUser(request);
|
|
|
+ if (ids.length > 20) {
|
|
|
+ obj.accumulate("success", false);
|
|
|
+ obj.accumulate("message", "一次支持打回最多20条");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
int count = 0;
|
|
|
- for (Integer historyId: ids) {
|
|
|
+ for (Integer historyId : ids) {
|
|
|
ArbitrateHistory history = arbitrateService.findById(historyId);
|
|
|
- MarkGroup group = groupService.findOne(history.getExamId(), history.getSubjectCode(), history.getGroupNumber());
|
|
|
+ MarkGroup group = groupService.findOne(history.getExamId(), history.getSubjectCode(),
|
|
|
+ history.getGroupNumber());
|
|
|
if (history != null && group != null
|
|
|
&& subjectCheck(history.getSubjectCode(), RequestUtils.getWebUser(request))) {
|
|
|
if (!ArbitrateType.QUESTION.equals(group.getArbitrateType())) {
|
|
|
+ if (ids.length == 1) {
|
|
|
+ obj.accumulate("success", false);
|
|
|
+ obj.accumulate("message", "仅支持小题仲裁模式打回");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
continue;
|
|
|
-// obj.accumulate("success", false);
|
|
|
-// obj.accumulate("message", "仅支持小题仲裁模式打回");
|
|
|
} else if (history.getStatus() != HistoryStatus.WAITING) {
|
|
|
+ if (ids.length == 1) {
|
|
|
+ obj.accumulate("success", false);
|
|
|
+ obj.accumulate("message", "该仲裁卷已被处理");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
continue;
|
|
|
-// obj.accumulate("success", false);
|
|
|
-// obj.accumulate("message", "该仲裁卷已被处理");
|
|
|
} else {
|
|
|
try {
|
|
|
lockService.watch(LockType.EXAM_SUBJECT, history.getExamId(), history.getSubjectCode());
|
|
@@ -265,11 +259,11 @@ public class ArbitrateController extends BaseExamController {
|
|
|
markService.backArbitrate(historyId, wu.getUser().getId(), reason);
|
|
|
releaseTask(history.getId());
|
|
|
count++;
|
|
|
-// obj.accumulate("success", true);
|
|
|
+ // obj.accumulate("success", true);
|
|
|
} catch (Exception e) {
|
|
|
log.error("ArbitrateController-打回仲裁卷出错", e);
|
|
|
-// obj.accumulate("success", false);
|
|
|
-// obj.accumulate("message", "仲裁任务打回失败");
|
|
|
+ // obj.accumulate("success", false);
|
|
|
+ // obj.accumulate("message", "仲裁任务打回失败");
|
|
|
} finally {
|
|
|
lockService.unlock(LockType.STUDENT, history.getStudentId());
|
|
|
lockService.unwatch(LockType.GROUP, history.getExamId(), history.getSubjectCode(),
|
|
@@ -279,9 +273,9 @@ public class ArbitrateController extends BaseExamController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(count>0){
|
|
|
+ if (count > 0) {
|
|
|
obj.accumulate("success", true);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
obj.accumulate("success", false);
|
|
|
obj.accumulate("message", "仲裁任务打回失败");
|
|
|
}
|