|
@@ -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) {
|