yin 8 mesi fa
parent
commit
74b1551118

+ 1 - 2
install/mysql/init/scan_central_db.sql

@@ -304,7 +304,6 @@ CREATE TABLE IF NOT EXISTS `sc_paper`
     `page_count`        int          NOT NULL,
     `mismatch`          bit(1)       NOT NULL,
     `assigned`          bit(1)       NOT NULL,
-    `assigned_suspect`  bit(1)       NOT NULL,
     `question_filled`   bit(1)       NOT NULL,
     `subjective_filled` bit(1)       NOT NULL,
     `omr_exam_number`   varchar(255) NOT NULL,
@@ -561,7 +560,7 @@ CREATE TABLE IF NOT EXISTS `sc_mark_site`
     UNIQUE KEY `exam_subject_paper` (`exam_id`, `subject_code`, `paper_type`)
 ) ENGINE = InnoDB
   DEFAULT CHARSET = utf8mb4;
-  
+
 INSERT INTO `sc_question` (`subject_code`,`objective`,`main_number`, `sub_number`, `main_title`) VALUES ('1',0,1,'1','作文');
 INSERT INTO `sc_question` (`subject_code`,`objective`,`main_number`, `sub_number`, `main_title`) VALUES ('1',1,2,'1','听力');
 INSERT INTO `sc_question` (`subject_code`,`objective`,`main_number`, `sub_number`, `main_title`) VALUES ('1',1,2,'2','听力');

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

@@ -41,9 +41,9 @@ public class AuditorController extends BaseController {
 
     @ApiOperation(value = "审核员任务获取")
     @RequestMapping(value = "/check/assigned/task/get", method = RequestMethod.POST)
-    public AnswerQueryVo get(@RequestParam Long examId) {
+    public AnswerQueryVo get(@RequestParam Long examId,@RequestParam String subjectCode) {
         User user = getAccessUser();
-        return studentService.getAssignedCheckTask(examId, user.getAccount());
+        return studentService.getAssignedCheckTask(examId,subjectCode, user);
     }
 
     @ApiOperation(value = "审核员任务历史")

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

@@ -1,5 +1,29 @@
 package cn.com.qmth.scancentral.controller.admin;
 
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.task.AsyncTaskExecutor;
+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;
+import com.qmth.boot.core.concurrent.service.ConcurrentService;
+import com.qmth.boot.core.exception.ParameterException;
+import com.qmth.boot.core.exception.ReentrantException;
+import com.qmth.boot.tools.excel.ExcelWriter;
+import com.qmth.boot.tools.excel.enums.ExcelType;
+import com.qmth.boot.tools.iterator.PageListIterator;
+
 import cn.com.qmth.scancentral.bean.AssignedQueryDomain;
 import cn.com.qmth.scancentral.bean.User;
 import cn.com.qmth.scancentral.controller.BaseController;
@@ -18,33 +42,12 @@ import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExamRoomExport;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExport;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
-import com.qmth.boot.api.annotation.Aac;
-import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.boot.core.concurrent.service.ConcurrentService;
-import com.qmth.boot.core.exception.ParameterException;
-import com.qmth.boot.core.exception.ReentrantException;
-import com.qmth.boot.tools.excel.ExcelWriter;
-import com.qmth.boot.tools.excel.enums.ExcelType;
-import com.qmth.boot.tools.iterator.PageListIterator;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import net.sf.json.JSONObject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.task.AsyncTaskExecutor;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 @RestController
-@Api(tags = "人工绑定校验接口")
+@Api(tags = "复核校验接口")
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/admin/check/assigned")
 @Aac(strict = false, auth = true)
 public class CheckAssignedController extends BaseController {
@@ -108,35 +111,35 @@ public class CheckAssignedController extends BaseController {
         writer.output(response.getOutputStream());
     }
 
-    @ApiOperation(value = "审核员任务获取")
+    @ApiOperation(value = "管理员任务获取")
     @RequestMapping(value = "task/get", method = RequestMethod.POST)
-    public AnswerQueryVo get(@RequestParam Long examId) {
+    public AnswerQueryVo get(@RequestParam Long examId, @RequestParam String subjectCode) {
         User user = getAccessUser();
-        return studentService.getAssignedCheckTask(examId, user.getAccount());
+        return studentService.getAssignedCheckTask(examId,subjectCode, user);
     }
 
-    @ApiOperation(value = "审核员任务历史")
+    @ApiOperation(value = "管理员任务历史")
     @RequestMapping(value = "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 = "审核员任务提交")
+    @ApiOperation(value = "管理员任务提交")
     @RequestMapping(value = "task/save", method = RequestMethod.POST)
     public AssignedTaskSaveVo submit(@Validated @RequestBody AssginedTaskResult result) {
         User user = getAccessUser();
         return studentService.submitAssignedCheckTask(result, user);
     }
 
-    @ApiOperation(value = "答题卡扫描图片检查任务状态")
+    @ApiOperation(value = "管理员任务状态")
     @PostMapping("task/status")
     public TaskStatusVo status(@RequestParam Long examId) {
         User user = getAccessUser();
         return studentService.getAssignedCheckTaskStatus(examId, user);
     }
 
-    @ApiOperation(value = "审核员任务释放")
+    @ApiOperation(value = "管理员任务释放")
     @PostMapping("task/release")
     public Object release(@RequestParam Long examId) {
         User user = getAccessUser();
@@ -181,13 +184,4 @@ public class CheckAssignedController extends BaseController {
         return result;
     }
 
-    @ApiOperation(value = "复核校验概况")
-    @RequestMapping(value = "/overview", method = RequestMethod.POST)
-    public JSONObject overview(@RequestParam Long examId, @RequestParam String subjectCode) {
-        JSONObject result = new JSONObject();
-        result.put("finishCount", 0);
-        result.put("todoCount", 0);
-        return result;
-    }
-
 }

+ 5 - 18
src/main/java/cn/com/qmth/scancentral/dao/StudentDao.java

@@ -12,17 +12,7 @@ import cn.com.qmth.scancentral.bean.AbsentQueryDomain;
 import cn.com.qmth.scancentral.bean.AnswerQueryDomain;
 import cn.com.qmth.scancentral.bean.AssignedQueryDomain;
 import cn.com.qmth.scancentral.entity.StudentEntity;
-import cn.com.qmth.scancentral.vo.AbsentInfoVo;
-import cn.com.qmth.scancentral.vo.AbsentQueryVo;
-import cn.com.qmth.scancentral.vo.AnswerExportVo;
-import cn.com.qmth.scancentral.vo.CampusVo;
-import cn.com.qmth.scancentral.vo.ExamSiteVo;
-import cn.com.qmth.scancentral.vo.ExportCetMarkingQueryVo;
-import cn.com.qmth.scancentral.vo.ExportCetVo;
-import cn.com.qmth.scancentral.vo.ImportStudentQueryVo;
-import cn.com.qmth.scancentral.vo.ImportStudentVo;
-import cn.com.qmth.scancentral.vo.ScanAnswerInfoVo;
-import cn.com.qmth.scancentral.vo.StudentUploadVo;
+import cn.com.qmth.scancentral.vo.*;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryParam;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExamRoomExport;
@@ -32,11 +22,7 @@ import cn.com.qmth.scancentral.vo.examroom.ExamRoomScannedVo;
 import cn.com.qmth.scancentral.vo.imagecheck.ImageCheckDetailVo;
 import cn.com.qmth.scancentral.vo.imagecheck.ImageCheckQuery;
 import cn.com.qmth.scancentral.vo.imagecheck.ImageCheckVo;
-import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
-import cn.com.qmth.scancentral.vo.student.StudentExamRoomVo;
-import cn.com.qmth.scancentral.vo.student.StudentPageQuery;
-import cn.com.qmth.scancentral.vo.student.StudentPageVo;
-import cn.com.qmth.scancentral.vo.student.StudentVo;
+import cn.com.qmth.scancentral.vo.student.*;
 import cn.com.qmth.scancentral.vo.studentimport.StudentCountVo;
 import cn.com.qmth.scancentral.vo.subject.SubjectScanProgressVo;
 
@@ -93,8 +79,9 @@ public interface StudentDao extends BaseMapper<StudentEntity> {
 
     IPage<AnswerQueryVo> queryAssignedCheckPage(Page<AnswerQueryVo> page, @Param("query") AssignedQueryDomain query);
 
-    List<AnswerQueryVo> findUnCheck(@Param("examId") Long examId, @Param("pageNumber") int pageNumber,
-            @Param("pageSize") int pageSize, @Param("checkCount") int checkCount);
+    List<AnswerQueryVo> findUnCheck(@Param("examId") Long examId, @Param("subjectCode") String subjectCode,
+                                    @Param("checkCount") int checkCount,@Param("pageNumber") int pageNumber,
+            @Param("pageSize") int pageSize);
 
     List<AnswerQueryVo> getAssignedCheckTaskHistory(@Param("id") Long id, @Param("pageSize") Long pageSize,
             @Param("userId") Long userId, @Param("examId") Long examId);

+ 10 - 9
src/main/java/cn/com/qmth/scancentral/entity/PaperEntity.java

@@ -1,8 +1,9 @@
 package cn.com.qmth.scancentral.entity;
 
-import cn.com.qmth.scancentral.entity.base.AuditingEntity;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import cn.com.qmth.scancentral.entity.base.AuditingEntity;
+
 // 题卡扫描结果
 @TableName("sc_paper")
 public class PaperEntity extends AuditingEntity {
@@ -21,7 +22,7 @@ public class PaperEntity extends AuditingEntity {
 
     private Boolean assigned;
 
-    private Boolean assignedSuspect;
+//    private Boolean assignedSuspect;
 
     private Boolean questionFilled;
 
@@ -101,11 +102,11 @@ public class PaperEntity extends AuditingEntity {
         this.omrExamNumber = omrExamNumber;
     }
 
-    public Boolean getAssignedSuspect() {
-        return assignedSuspect;
-    }
-
-    public void setAssignedSuspect(Boolean assignedSuspect) {
-        this.assignedSuspect = assignedSuspect;
-    }
+//    public Boolean getAssignedSuspect() {
+//        return assignedSuspect;
+//    }
+//
+//    public void setAssignedSuspect(Boolean assignedSuspect) {
+//        this.assignedSuspect = assignedSuspect;
+//    }
 }

+ 8 - 6
src/main/java/cn/com/qmth/scancentral/service/PaperService.java

@@ -1,5 +1,12 @@
 package cn.com.qmth.scancentral.service;
 
+import java.util.List;
+
+import org.springframework.web.multipart.MultipartFile;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.boot.core.collection.PageResult;
+
 import cn.com.qmth.scancentral.bean.MismatchQueryDomain;
 import cn.com.qmth.scancentral.bean.MismatchToggleDomain;
 import cn.com.qmth.scancentral.bean.User;
@@ -13,11 +20,6 @@ import cn.com.qmth.scancentral.vo.answerquery.StudentPaperVo;
 import cn.com.qmth.scancentral.vo.mismatchquery.MismatchQueryVo;
 import cn.com.qmth.scancentral.vo.paper.PaperCetVo;
 import cn.com.qmth.scancentral.vo.paper.PaperVo;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.boot.core.collection.PageResult;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
 
 /**
  * 鉴权
@@ -50,7 +52,7 @@ public interface PaperService extends IService<PaperEntity> {
 
     List<PaperCetVo> findByStudentIds(List<Long> studentIds);
 
-    void updatePaperAssignedSuspect(Long id, Integer number, Boolean assignedSuspect);
+//    void updatePaperAssignedSuspect(Long id, Integer number, Boolean assignedSuspect);
 
     List<StudentPaperVo> listByBatchIdAndStudentId(Long batchId, Long studentId);
 }

+ 5 - 41
src/main/java/cn/com/qmth/scancentral/service/StudentService.java

@@ -10,45 +10,14 @@ import org.springframework.web.multipart.MultipartFile;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.boot.core.collection.PageResult;
 
-import cn.com.qmth.scancentral.bean.AbsentQueryDomain;
-import cn.com.qmth.scancentral.bean.AnswerDeleteDomain;
-import cn.com.qmth.scancentral.bean.AnswerQueryDomain;
-import cn.com.qmth.scancentral.bean.AssignedQueryDomain;
-import cn.com.qmth.scancentral.bean.ImportCetAbsentDomain;
-import cn.com.qmth.scancentral.bean.ImportStudentDomain;
-import cn.com.qmth.scancentral.bean.PageDeleteDomain;
-import cn.com.qmth.scancentral.bean.User;
+import cn.com.qmth.scancentral.bean.*;
 import cn.com.qmth.scancentral.bean.omredit.OmrEditDomain;
 import cn.com.qmth.scancentral.bean.omredit.OmrFieldEditDomain;
 import cn.com.qmth.scancentral.bean.refix.AnswerRefixDomain;
 import cn.com.qmth.scancentral.entity.StudentEntity;
 import cn.com.qmth.scancentral.entity.StudentPaperEntity;
-import cn.com.qmth.scancentral.enums.ExamStatus;
-import cn.com.qmth.scancentral.enums.ExamStatusCheckMode;
-import cn.com.qmth.scancentral.enums.GroupType;
-import cn.com.qmth.scancentral.enums.ImageCheckStatus;
-import cn.com.qmth.scancentral.enums.OP;
-import cn.com.qmth.scancentral.enums.ScanStatus;
-import cn.com.qmth.scancentral.enums.UploadStatus;
-import cn.com.qmth.scancentral.vo.AbsentInfoVo;
-import cn.com.qmth.scancentral.vo.AbsentManualImportVo;
-import cn.com.qmth.scancentral.vo.AbsentQueryVo;
-import cn.com.qmth.scancentral.vo.AnswerDeleteVo;
-import cn.com.qmth.scancentral.vo.AnswerExportK12Vo;
-import cn.com.qmth.scancentral.vo.AnswerExportVo;
-import cn.com.qmth.scancentral.vo.AnswerRefixVo;
-import cn.com.qmth.scancentral.vo.CampusVo;
-import cn.com.qmth.scancentral.vo.ExamSiteVo;
-import cn.com.qmth.scancentral.vo.ExportCetMarkingQueryVo;
-import cn.com.qmth.scancentral.vo.ExportCetVo;
-import cn.com.qmth.scancentral.vo.ImportBreachResult;
-import cn.com.qmth.scancentral.vo.ImportResult;
-import cn.com.qmth.scancentral.vo.ImportStudentQueryVo;
-import cn.com.qmth.scancentral.vo.ImportStudentVo;
-import cn.com.qmth.scancentral.vo.PaperDeleteVo;
-import cn.com.qmth.scancentral.vo.ScanAnswerInfoVo;
-import cn.com.qmth.scancentral.vo.StudentUploadVo;
-import cn.com.qmth.scancentral.vo.UpdateTimeVo;
+import cn.com.qmth.scancentral.enums.*;
+import cn.com.qmth.scancentral.vo.*;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryParam;
 import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssginedTaskResult;
@@ -57,12 +26,7 @@ import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExport;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.examroom.ExamRoomScannedQuery;
 import cn.com.qmth.scancentral.vo.examroom.ExamRoomScannedVo;
-import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
-import cn.com.qmth.scancentral.vo.student.StudentExamRoomVo;
-import cn.com.qmth.scancentral.vo.student.StudentPageQuery;
-import cn.com.qmth.scancentral.vo.student.StudentPageVo;
-import cn.com.qmth.scancentral.vo.student.StudentQuery;
-import cn.com.qmth.scancentral.vo.student.StudentVo;
+import cn.com.qmth.scancentral.vo.student.*;
 import cn.com.qmth.scancentral.vo.studentimport.StudentCountVo;
 import cn.com.qmth.scancentral.vo.subject.SubjectScanProgressVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
@@ -199,7 +163,7 @@ public interface StudentService extends IService<StudentEntity> {
 
     List<AnswerQueryVo> getAssignedCheckTaskHistory(Long id, Long pageSize, User user);
 
-    AnswerQueryVo getAssignedCheckTask(Long examId, String account);
+    AnswerQueryVo getAssignedCheckTask(Long examId,String subjectCode, User user);
 
     StudentAnswerVo studentAnswer(Long batchId, Long studentId);
 

+ 40 - 37
src/main/java/cn/com/qmth/scancentral/service/impl/PaperServiceImpl.java

@@ -1,5 +1,33 @@
 package cn.com.qmth.scancentral.service.impl;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.validation.constraints.NotNull;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.boot.core.collection.PageResult;
+import com.qmth.boot.core.concurrent.service.ConcurrentService;
+import com.qmth.boot.core.exception.ParameterException;
+import com.qmth.boot.core.exception.StatusException;
+import com.qmth.boot.core.fss.store.FileStore;
+
 import cn.com.qmth.scancentral.bean.MismatchQueryDomain;
 import cn.com.qmth.scancentral.bean.MismatchToggleDomain;
 import cn.com.qmth.scancentral.bean.User;
@@ -19,31 +47,6 @@ import cn.com.qmth.scancentral.vo.mismatchquery.MismatchQueryVo;
 import cn.com.qmth.scancentral.vo.mismatchquery.PaperPageDO;
 import cn.com.qmth.scancentral.vo.paper.PaperCetVo;
 import cn.com.qmth.scancentral.vo.paper.PaperVo;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.boot.core.collection.PageResult;
-import com.qmth.boot.core.concurrent.service.ConcurrentService;
-import com.qmth.boot.core.exception.ParameterException;
-import com.qmth.boot.core.exception.StatusException;
-import com.qmth.boot.core.fss.store.FileStore;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.constraints.NotNull;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
 
 @Service
 public class PaperServiceImpl extends ServiceImpl<PaperDao, PaperEntity> implements PaperService {
@@ -436,18 +439,18 @@ public class PaperServiceImpl extends ServiceImpl<PaperDao, PaperEntity> impleme
         return this.baseMapper.findByStudentIds(studentIds);
     }
 
-    @Override
-    @Transactional
-    public void updatePaperAssignedSuspect(Long id, Integer number, Boolean assignedSuspect) {
-        StudentPaperEntity sp = studentPaperService.findByStudentIdAndPaperNumber(id, number);
-        if (sp == null) {
-            throw new ParameterException("未找到绑定扫描结果");
-        }
-        LambdaUpdateWrapper<PaperEntity> lw = new LambdaUpdateWrapper<>();
-        lw.set(PaperEntity::getAssignedSuspect, assignedSuspect);
-        lw.eq(PaperEntity::getId, sp.getPaperId());
-        this.update(lw);
-    }
+//    @Override
+//    @Transactional
+//    public void updatePaperAssignedSuspect(Long id, Integer number, Boolean assignedSuspect) {
+//        StudentPaperEntity sp = studentPaperService.findByStudentIdAndPaperNumber(id, number);
+//        if (sp == null) {
+//            throw new ParameterException("未找到绑定扫描结果");
+//        }
+//        LambdaUpdateWrapper<PaperEntity> lw = new LambdaUpdateWrapper<>();
+//        lw.set(PaperEntity::getAssignedSuspect, assignedSuspect);
+//        lw.eq(PaperEntity::getId, sp.getPaperId());
+//        this.update(lw);
+//    }
 
     @Override
     public List<StudentPaperVo> listByBatchIdAndStudentId(Long batchId, Long studentId) {

+ 27 - 100
src/main/java/cn/com/qmth/scancentral/service/impl/StudentServiceImpl.java

@@ -1,20 +1,8 @@
 package cn.com.qmth.scancentral.service.impl;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
+import java.io.*;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import javax.validation.constraints.NotNull;
@@ -47,14 +35,7 @@ import com.qmth.boot.tools.excel.ExcelReader;
 import com.qmth.boot.tools.excel.enums.ExcelType;
 import com.qmth.boot.tools.uuid.FastUUID;
 
-import cn.com.qmth.scancentral.bean.AbsentQueryDomain;
-import cn.com.qmth.scancentral.bean.AnswerDeleteDomain;
-import cn.com.qmth.scancentral.bean.AnswerQueryDomain;
-import cn.com.qmth.scancentral.bean.AssignedQueryDomain;
-import cn.com.qmth.scancentral.bean.ImportCetAbsentDomain;
-import cn.com.qmth.scancentral.bean.ImportStudentDomain;
-import cn.com.qmth.scancentral.bean.PageDeleteDomain;
-import cn.com.qmth.scancentral.bean.User;
+import cn.com.qmth.scancentral.bean.*;
 import cn.com.qmth.scancentral.bean.answersave.ArrayResult;
 import cn.com.qmth.scancentral.bean.answersave.BoolResult;
 import cn.com.qmth.scancentral.bean.answersave.StringResult;
@@ -66,91 +47,29 @@ import cn.com.qmth.scancentral.bean.refix.PageRefixDomain;
 import cn.com.qmth.scancentral.bean.refix.PaperRefixDomain;
 import cn.com.qmth.scancentral.config.SysProperty;
 import cn.com.qmth.scancentral.dao.StudentDao;
-import cn.com.qmth.scancentral.entity.AnswerCardEntity;
-import cn.com.qmth.scancentral.entity.ExamEntity;
-import cn.com.qmth.scancentral.entity.OmrGroupEntity;
-import cn.com.qmth.scancentral.entity.PaperEntity;
-import cn.com.qmth.scancentral.entity.PaperPageEntity;
-import cn.com.qmth.scancentral.entity.QuestionEntity;
-import cn.com.qmth.scancentral.entity.StudentEntity;
-import cn.com.qmth.scancentral.entity.StudentPaperEntity;
-import cn.com.qmth.scancentral.entity.SubjectEntity;
-import cn.com.qmth.scancentral.entity.UserEntity;
-import cn.com.qmth.scancentral.enums.ExamMode;
-import cn.com.qmth.scancentral.enums.ExamStatus;
-import cn.com.qmth.scancentral.enums.ExamStatusCheckMode;
-import cn.com.qmth.scancentral.enums.GroupType;
-import cn.com.qmth.scancentral.enums.ImageCheckStatus;
-import cn.com.qmth.scancentral.enums.LockType;
-import cn.com.qmth.scancentral.enums.OP;
-import cn.com.qmth.scancentral.enums.OmrField;
-import cn.com.qmth.scancentral.enums.Role;
-import cn.com.qmth.scancentral.enums.ScanStatus;
-import cn.com.qmth.scancentral.enums.UploadStatus;
+import cn.com.qmth.scancentral.entity.*;
+import cn.com.qmth.scancentral.enums.*;
 import cn.com.qmth.scancentral.exception.NotFoundExceptions;
 import cn.com.qmth.scancentral.exception.ParameterExceptions;
 import cn.com.qmth.scancentral.model.ManualAbsentImportDTO;
-import cn.com.qmth.scancentral.service.AnswerCardService;
-import cn.com.qmth.scancentral.service.AnswerCardSubjectService;
-import cn.com.qmth.scancentral.service.AssignedCheckHistoryService;
-import cn.com.qmth.scancentral.service.BatchService;
-import cn.com.qmth.scancentral.service.ExamService;
-import cn.com.qmth.scancentral.service.FileService;
-import cn.com.qmth.scancentral.service.OmrGroupService;
-import cn.com.qmth.scancentral.service.OmrTaskService;
-import cn.com.qmth.scancentral.service.PaperPageService;
-import cn.com.qmth.scancentral.service.PaperService;
-import cn.com.qmth.scancentral.service.QuestionService;
-import cn.com.qmth.scancentral.service.StudentPaperService;
-import cn.com.qmth.scancentral.service.StudentService;
-import cn.com.qmth.scancentral.service.SubjectService;
-import cn.com.qmth.scancentral.service.ToolExportService;
-import cn.com.qmth.scancentral.service.UserService;
+import cn.com.qmth.scancentral.service.*;
 import cn.com.qmth.scancentral.support.TaskLock;
 import cn.com.qmth.scancentral.support.TaskLockUtil;
 import cn.com.qmth.scancentral.util.BatchGetDataUtil;
 import cn.com.qmth.scancentral.util.BatchSetDataUtil;
 import cn.com.qmth.scancentral.util.MD5Util;
 import cn.com.qmth.scancentral.util.PageUtil;
-import cn.com.qmth.scancentral.vo.AbsentInfoVo;
-import cn.com.qmth.scancentral.vo.AbsentManualImportVo;
-import cn.com.qmth.scancentral.vo.AbsentQueryVo;
-import cn.com.qmth.scancentral.vo.AnswerDeleteVo;
-import cn.com.qmth.scancentral.vo.AnswerExportK12Vo;
-import cn.com.qmth.scancentral.vo.AnswerExportVo;
-import cn.com.qmth.scancentral.vo.AnswerRefixVo;
-import cn.com.qmth.scancentral.vo.CampusVo;
-import cn.com.qmth.scancentral.vo.ExamSiteVo;
-import cn.com.qmth.scancentral.vo.ExportCetMarkingQueryVo;
-import cn.com.qmth.scancentral.vo.ExportCetVo;
-import cn.com.qmth.scancentral.vo.ImportBreachResult;
-import cn.com.qmth.scancentral.vo.ImportResult;
-import cn.com.qmth.scancentral.vo.ImportStudentQueryVo;
-import cn.com.qmth.scancentral.vo.ImportStudentVo;
-import cn.com.qmth.scancentral.vo.PaperDeleteVo;
-import cn.com.qmth.scancentral.vo.ScanAnswerInfoVo;
-import cn.com.qmth.scancentral.vo.StudentUploadVo;
-import cn.com.qmth.scancentral.vo.UpdateTimeVo;
-import cn.com.qmth.scancentral.vo.answerquery.AnswerPageVo;
-import cn.com.qmth.scancentral.vo.answerquery.AnswerPaperVo;
-import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryParam;
-import cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo;
-import cn.com.qmth.scancentral.vo.answerquery.StudentPaperVo;
+import cn.com.qmth.scancentral.vo.*;
+import cn.com.qmth.scancentral.vo.answerquery.*;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssginedTaskResult;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExamRoomExport;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExport;
-import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskResultPaper;
 import cn.com.qmth.scancentral.vo.assginedcheck.AssignedTaskSaveVo;
 import cn.com.qmth.scancentral.vo.examroom.ExamRoomScannedQuery;
 import cn.com.qmth.scancentral.vo.examroom.ExamRoomScannedVo;
 import cn.com.qmth.scancentral.vo.paper.PaperCetVo;
 import cn.com.qmth.scancentral.vo.paper.PaperPageCetVo;
-import cn.com.qmth.scancentral.vo.student.StudentAnswerVo;
-import cn.com.qmth.scancentral.vo.student.StudentExamRoomVo;
-import cn.com.qmth.scancentral.vo.student.StudentPageQuery;
-import cn.com.qmth.scancentral.vo.student.StudentPageVo;
-import cn.com.qmth.scancentral.vo.student.StudentQuery;
-import cn.com.qmth.scancentral.vo.student.StudentVo;
+import cn.com.qmth.scancentral.vo.student.*;
 import cn.com.qmth.scancentral.vo.studentimport.StudentCountVo;
 import cn.com.qmth.scancentral.vo.subject.SubjectScanProgressVo;
 import cn.com.qmth.scancentral.vo.task.TaskStatusVo;
@@ -266,7 +185,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             // 获取paper详情更新考生状态
             PaperEntity paper = paperService.getById(studentPaper.getPaperId());
             student.setAssigned(student.getAssigned() || paper.getAssigned());
-            student.setAssignedSuspect(student.getAssignedSuspect() || paper.getAssignedSuspect());
+//            student.setAssignedSuspect(student.getAssignedSuspect() || paper.getAssignedSuspect());
             student.setQuestionFilled(student.getQuestionFilled() || paper.getQuestionFilled());
             student.setSubjectiveFilled(student.getSubjectiveFilled() || paper.getSubjectiveFilled());
             student.setCardNumber(paper.getCardNumber());
@@ -1942,10 +1861,12 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
         concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().lock();
         try {
             assignedCheckHistoryService.save(user.getId(), student.getId(), student.getExamId());
-            for (AssignedTaskResultPaper paper : result.getPapers()) {
-                paperService.updatePaperAssignedSuspect(student.getId(), paper.getNumber(), paper.getAssignedSuspect());
-            }
-            updateStudentByPaper(user, student.getId(), false);
+//            for (AssignedTaskResultPaper paper : result.getPapers()) {
+//                paperService.updatePaperAssignedSuspect(student.getId(), paper.getNumber(), result.getAssignedSuspect());
+//            }
+//            updateStudentByPaper(user, student.getId(), false);
+            student.setAbsentSuspect(result.getAssignedSuspect());
+            saveOrUpdate(student);
             updateAssignedCheckCount(student.getId(), false);
         } finally {
             concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
@@ -1968,17 +1889,23 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
     }
 
     @Override
-    public AnswerQueryVo getAssignedCheckTask(Long examId, String account) {
+    public AnswerQueryVo getAssignedCheckTask(Long examId,String subjectCode, User user) {
         int retry = 0;
         AnswerQueryVo task = null;
+        int checkCount = 0;
+        if (Role.AUDITOR.equals(user.getRole())) {
+            checkCount = 0;
+        }else{
+            checkCount = 1;
+        }
         while (task == null) {
-            List<AnswerQueryVo> list = this.findUnCheck(examId, retry * 20, 20, 0);
+            List<AnswerQueryVo> list = this.findUnCheck(examId,subjectCode,checkCount, retry * 20, 20);
             if (list.isEmpty()) {
                 break;
             }
             for (AnswerQueryVo t : list) {
                 StudentEntity student = this.getById(t.getId());
-                if (this.apply(student, account)) {
+                if (this.apply(student, user.getAccount())) {
                     task = toTaskVo(t);
                     break;
                 }
@@ -1993,8 +1920,8 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
         return task;
     }
 
-    private List<AnswerQueryVo> findUnCheck(Long examId, int pageNumber, int pageSize, int checkCount) {
-        return this.baseMapper.findUnCheck(examId, pageNumber, pageSize, checkCount);
+    private List<AnswerQueryVo> findUnCheck(Long examId,String subjectCode,int checkCount, int pageNumber, int pageSize) {
+        return this.baseMapper.findUnCheck(examId,subjectCode, checkCount,pageNumber, pageSize );
     }
 
     private AnswerQueryVo toTaskVo(AnswerQueryVo t) {

+ 30 - 23
src/main/java/cn/com/qmth/scancentral/vo/assginedcheck/AssginedTaskResult.java

@@ -1,19 +1,19 @@
 package cn.com.qmth.scancentral.vo.assginedcheck;
 
-import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import java.util.List;
 
 public class AssginedTaskResult {
 
     @NotNull(message = "考生ID不能为空")
     private Long id;
 
-    @Valid
-    @NotNull(message = "papers不能为空")
-    @Size(min = 1, message = "papers不能为空")
-    private List<AssignedTaskResultPaper> papers;
+    @NotNull(message = "assignedSuspect")
+    private Boolean assignedSuspect;
+
+//    @Valid
+//    @NotNull(message = "papers不能为空")
+//    @Size(min = 1, message = "papers不能为空")
+//    private List<AssignedTaskResultPaper> papers;
 
     public Long getId() {
         return id;
@@ -23,23 +23,30 @@ public class AssginedTaskResult {
         this.id = id;
     }
 
-    public List<AssignedTaskResultPaper> getPapers() {
-        return papers;
-    }
-
-    public AssignedTaskResultPaper findPaper(Integer number) {
-        if (papers != null) {
-            for (AssignedTaskResultPaper vo : papers) {
-                if (vo.getNumber().equals(number)) {
-                    return vo;
-                }
-            }
-        }
-        return null;
+//    public List<AssignedTaskResultPaper> getPapers() {
+//        return papers;
+//    }
+//
+//    public AssignedTaskResultPaper findPaper(Integer number) {
+//        if (papers != null) {
+//            for (AssignedTaskResultPaper vo : papers) {
+//                if (vo.getNumber().equals(number)) {
+//                    return vo;
+//                }
+//            }
+//        }
+//        return null;
+//    }
+//
+//    public void setPages(List<AssignedTaskResultPaper> papers) {
+//        this.papers = papers;
+//    }
+
+    public Boolean getAssignedSuspect() {
+        return assignedSuspect;
     }
 
-    public void setPages(List<AssignedTaskResultPaper> papers) {
-        this.papers = papers;
+    public void setAssignedSuspect(Boolean assignedSuspect) {
+        this.assignedSuspect = assignedSuspect;
     }
-
 }

+ 18 - 19
src/main/resources/mapper/StudentMapper.xml

@@ -108,7 +108,7 @@
                 #{st}
             </foreach>
         </if>
-        
+
         <if test="query.examNumber != null and query.examNumber !=''">
             and t.exam_number=#{query.examNumber}
         </if>
@@ -175,12 +175,12 @@
                 and t.paper_type='?'
             </if>
         </if>
-         <if test="query.hasFilled != null">
+        <if test="query.hasFilled != null">
             <if test="query.hasFilled">
-            	and (t.question_filled=1 or  t.subjective_filled=1)
+                and (t.question_filled=1 or t.subjective_filled=1)
             </if>
             <if test="!query.hasFilled">
-            	and t.question_filled=0  and t.subjective_filled=0
+                and t.question_filled=0 and t.subjective_filled=0
             </if>
         </if>
         order by t.id
@@ -363,11 +363,11 @@
         <if test="query.subjectCode != null and query.subjectCode !=''">
             and t.subject_code=#{query.subjectCode}
         </if>
-          and t.status = 'SCANNED'
-          and t.file_upload_status = 'UPLOADED'
+        and t.status = 'SCANNED'
+        and t.file_upload_status = 'UPLOADED'
         order by t.id
     </select>
-    
+
     <select id="countCetMarking" resultType="int">
         select count(1)
         from sc_student t
@@ -585,6 +585,7 @@
                                                t.card_number = c.number
                  left join sc_subject s on s.code = t.subject_code and s.exam_id = t.exam_id
         where t.exam_id = #{examId}
+          and t.subject_code = #{subjectCode}
           and t.assigned_check_count = #{checkCount}
           and t.assigned = 1
         order by t.id
@@ -722,9 +723,8 @@
         from sc_student
         where exam_id = #{examId}
           and file_upload_status = 'UPLOADED'
-          and image_check_status in('WAITING','FAILED')
-          and id > #{startId}
-        limit #{batchSize}
+          and image_check_status in ('WAITING', 'FAILED')
+          and id > #{startId} limit #{batchSize}
     </select>
 
     <select id="countImageCheck" resultType="cn.com.qmth.scancentral.vo.imagecheck.ImageCheckVo">
@@ -769,7 +769,7 @@
                stu.exam_site,
                stu.exam_room
         from sc_student stu
-        left join sc_subject sb on sb.exam_id=stu.exam_id and sb.code=stu.subject_code
+                 left join sc_subject sb on sb.exam_id = stu.exam_id and sb.code = stu.subject_code
         where stu.exam_id = #{examId}
           and stu.subject_code = #{subjectCode}
           and stu.assigned = 1
@@ -778,14 +778,13 @@
     </select>
     <select id="getStudentVo"
             resultType="cn.com.qmth.scancentral.vo.student.StudentAnswerVo">
-        select
-        t.*,
-        c.paper_count cardPaperCount,
-        s.name subjectName
+        select t.*,
+               c.paper_count cardPaperCount,
+               s.name        subjectName
         from sc_student t
-        left join sc_answer_card c on t.exam_id=c.exam_id and
-        t.card_number=c.number
-        left join sc_subject s on s.code=t.subject_code and s.exam_id=t.exam_id
-        where t.id=#{studentId}
+                 left join sc_answer_card c on t.exam_id = c.exam_id and
+                                               t.card_number = c.number
+                 left join sc_subject s on s.code = t.subject_code and s.exam_id = t.exam_id
+        where t.id = #{studentId}
     </select>
 </mapper>