yin пре 9 месеци
родитељ
комит
64936e8782

+ 4 - 2
src/main/java/cn/com/qmth/scancentral/bean/BatchCreateDomain.java

@@ -1,8 +1,10 @@
 package cn.com.qmth.scancentral.bean;
 
+import java.util.List;
+
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
-import java.util.List;
 
 public class BatchCreateDomain {
 
@@ -12,7 +14,7 @@ public class BatchCreateDomain {
     @NotNull(message = "准考证号不能为空")
     @Size(min = 1, message = "准考证号不能为空")
     private List<String> examNumbers;
-
+    @NotBlank(message = "subjectCode不能为空")
     private String subjectCode;
 
     public Long getExamId() {

+ 40 - 4
src/main/java/cn/com/qmth/scancentral/controller/admin/AuditorController.java

@@ -1,10 +1,10 @@
 package cn.com.qmth.scancentral.controller.admin;
 
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
-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.RestController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
@@ -12,6 +12,10 @@ import com.qmth.boot.api.constant.ApiConstant;
 import cn.com.qmth.scancentral.bean.User;
 import cn.com.qmth.scancentral.controller.BaseController;
 import cn.com.qmth.scancentral.service.ExamService;
+import cn.com.qmth.scancentral.service.StudentService;
+import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
+import cn.com.qmth.scancentral.vo.assginedcheck.AssginedTaskResult;
+import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.auditor.AuditorOverview;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -25,6 +29,9 @@ public class AuditorController extends BaseController {
     @Autowired
     private ExamService examService;
 
+    @Autowired
+    private StudentService studentService;
+
     @ApiOperation(value = "考试概览数据")
     @RequestMapping(value = "/exam/overview", method = RequestMethod.POST)
     public AuditorOverview overview(@RequestParam Long examId) {
@@ -32,4 +39,33 @@ public class AuditorController extends BaseController {
         return examService.getAuditorOverview(examId, user);
     }
 
+    @ApiOperation(value = "审核员任务获取")
+    @RequestMapping(value = "/check/assigned/task/get", method = RequestMethod.POST)
+    public AnswerQueryVo get(@RequestParam Long examId) {
+        User user = getAccessUser();
+        return studentService.getAssignedCheckTask(examId, user.getAccount());
+    }
+
+    @ApiOperation(value = "审核员任务历史")
+    @RequestMapping(value = "/check/assigned/task/history", method = RequestMethod.POST)
+    public List<AnswerQueryVo> history(@RequestParam Long id, @RequestParam Long pageSize) {
+        User user = getAccessUser();
+        return studentService.getAssignedCheckTaskHistory(id, pageSize, user);
+    }
+
+    @ApiOperation(value = "审核员任务提交")
+    @RequestMapping(value = "/check/assigned/task/save", method = RequestMethod.POST)
+    public AssignedTaskSaveVo submit(@Validated @RequestBody AssginedTaskResult result) {
+        User user = getAccessUser();
+        return studentService.submitAssignedCheckTask(result, user);
+    }
+
+    @ApiOperation(value = "审核员任务释放")
+    @PostMapping("/check/assigned/task/release")
+    public Object release(@RequestParam Long examId) {
+        User user = getAccessUser();
+        studentService.releaseAssignedCheckTaskByUser(examId, user.getAccount());
+        return success(true);
+    }
+
 }

+ 25 - 25
src/main/java/cn/com/qmth/scancentral/controller/admin/CheckAssignedController.java

@@ -140,35 +140,35 @@ public class CheckAssignedController extends BaseController {
      @ApiOperation(value = "重新生成")
      @RequestMapping(value = "/reset", method = RequestMethod.POST)
      public JSONObject reset(@RequestParam Long examId, @RequestParam String subjectCode) {
-     User user = getAccessUser();
-     ExamEntity exam = examService.getById(examId);
-     if (exam == null) {
-     throw ParameterExceptions.EXAM_NOT_FOUND;
-     }
-
-     if (!concurrentService.isLocked(LockType.CHECK_ASSIGNED_RESET + "-" + examId)) {
-     taskExecutor.submit(new CheckAssignedResetThread(examId, subjectCode,
-     studentService, concurrentService));
-     } else {
-     throw new ReentrantException("正在重置,请稍后再试");
-     }
-     JSONObject result = new JSONObject();
-     result.put("updateTime", System.currentTimeMillis());
-     result.put("synching", true);
-     return result;
+         User user = getAccessUser();
+         ExamEntity exam = examService.getById(examId);
+         if (exam == null) {
+            throw ParameterExceptions.EXAM_NOT_FOUND;
+         }
+
+         if (!concurrentService.isLocked(LockType.CHECK_ASSIGNED_RESET + "-" + examId)) {
+            taskExecutor.submit(new CheckAssignedResetThread(examId, subjectCode,
+            studentService, concurrentService));
+         } else {
+            throw new ReentrantException("正在重置,请稍后再试");
+         }
+         JSONObject result = new JSONObject();
+         result.put("updateTime", System.currentTimeMillis());
+         result.put("synching", true);
+         return result;
      }
 
      @ApiOperation(value = "重新生成状态")
      @RequestMapping(value = "/reset/status", method = RequestMethod.POST)
      public Map<String, Object> resetStatus(@RequestParam Long examId, @RequestParam String subjectCode) {
-     User user = getAccessUser();
-     ExamEntity exam = examService.getById(examId);
-     if (exam == null) {
-     throw ParameterExceptions.EXAM_NOT_FOUND;
-     }
-     Map<String, Object> result = new HashMap<String, Object>();
-     result.put("synching",
-     concurrentService.isLocked(LockType.CHECK_ASSIGNED_RESET + "-" + examId));
-     return result;
+        User user = getAccessUser();
+        ExamEntity exam = examService.getById(examId);
+        if (exam == null) {
+            throw ParameterExceptions.EXAM_NOT_FOUND;
+        }
+        Map<String, Object> result = new HashMap<String, Object>();
+        result.put("synching",
+        concurrentService.isLocked(LockType.CHECK_ASSIGNED_RESET + "-" + examId));
+        return result;
      }
 }