yin 8 月之前
父节点
当前提交
00f63236db

+ 2 - 3
src/main/java/cn/com/qmth/scancentral/dao/StudentDao.java

@@ -79,9 +79,8 @@ public interface StudentDao extends BaseMapper<StudentEntity> {
 
     IPage<AnswerQueryVo> queryAssignedCheckPage(Page<AnswerQueryVo> page, @Param("query") AssignedQueryDomain query);
 
-    List<AnswerQueryVo> findUnCheck(@Param("examId") Long examId, @Param("subjectCode") String subjectCode,
-                                    @Param("checkCount") int checkCount,@Param("pageNumber") int pageNumber,
-            @Param("pageSize") int pageSize);
+    IPage<AnswerQueryVo> findUnCheck(Page<AnswerQueryVo> page,@Param("examId") Long examId, @Param("subjectCode") String subjectCode,
+                                    @Param("checkCount") int checkCount);
 
     IPage<AnswerQueryVo> getAssignedCheckTaskHistory(Page<AnswerQueryVo> page,@Param("examId") Long examId, @Param("subjectCode") String subjectCode,
             @Param("userId") Long userId);

+ 1 - 1
src/main/java/cn/com/qmth/scancentral/enums/OmrType.java

@@ -4,7 +4,7 @@ public enum OmrType {
 
     FILL_AREA("填涂"),
 
-    BARCODE("二维码");
+    BARCODE("码");
 
     private String name;
 

+ 2 - 5
src/main/java/cn/com/qmth/scancentral/exception/NotFoundExceptions.java

@@ -15,10 +15,7 @@ public class NotFoundExceptions {
     public static final NotFoundException NO_CHECK_IMAGE_TASK = new NotFoundException(102, "no check image task",
             "没有图片审核任务", null);
 
-    public static final NotFoundException NO_STUDENT_ANSWER_TASK = new NotFoundException(101, "no student answer task",
-            "没有数据检查任务", null);
-
-    public static final NotFoundException NO_STUDENT_ANSWER_GROUP = new NotFoundException(101,
-            "no student answer group", "没有数据抽查任务组", null);
+    public static final NotFoundException NO_CHECK_ASSIGNED_TASK = new NotFoundException(103,
+            "no check assgined task", "没有复核校验任务", null);
 
 }

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

@@ -2001,7 +2001,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
 
     @Override
     public AnswerQueryVo getAssignedCheckTask(Long examId, String subjectCode, User user) {
-        int retry = 0;
+        int retry = 1;
         AnswerQueryVo task = null;
         int checkCount = 0;
         if (Role.AUDITOR.equals(user.getRole())) {
@@ -2010,11 +2010,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             checkCount = 1;
         }
         while (task == null) {
-            List<AnswerQueryVo> list = this.findUnCheck(examId, subjectCode, checkCount, retry * 20, 20);
-            if (list.isEmpty()) {
+            IPage<AnswerQueryVo> list = this.findUnCheck(examId, subjectCode, checkCount, retry, 20);
+            if (list.getRecords().isEmpty()) {
                 break;
             }
-            for (AnswerQueryVo t : list) {
+            for (AnswerQueryVo t : list.getRecords()) {
                 StudentEntity student = this.getById(t.getId());
                 if (this.apply(student, user.getAccount())) {
                     task = toTaskVo(t);
@@ -2026,14 +2026,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             }
         }
         if (task == null) {
-            throw NotFoundExceptions.NO_STUDENT_ANSWER_TASK;
+            throw NotFoundExceptions.NO_CHECK_ASSIGNED_TASK;
         }
         return task;
     }
 
-    private List<AnswerQueryVo> findUnCheck(Long examId, String subjectCode, int checkCount, int pageNumber,
+    private IPage<AnswerQueryVo> findUnCheck(Long examId, String subjectCode, int checkCount, int pageNumber,
             int pageSize) {
-        return this.baseMapper.findUnCheck(examId, subjectCode, checkCount, pageNumber, pageSize);
+        return this.baseMapper.findUnCheck(new Page<>(pageNumber,pageSize),examId, subjectCode, checkCount);
     }
 
     private AnswerQueryVo toTaskVo(AnswerQueryVo t) {

+ 0 - 1
src/main/resources/mapper/StudentMapper.xml

@@ -589,7 +589,6 @@
           and t.assigned_check_count = #{checkCount}
           and t.assigned = 1
         order by t.id
-            limit #{pageNumber}, #{pageSize}
     </select>