|
@@ -531,26 +531,19 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
|
|
|
@Override
|
|
|
public ScanOmrTaskStatusDto getStatus(Long examId, Long userId) {
|
|
|
ScanOmrTaskStatusDto status = new ScanOmrTaskStatusDto();
|
|
|
-// status.setFinishCount(this.getCountByExamAndStatusAndUserId(examId, userId, OmrTaskStatus.PROCESSED));
|
|
|
-// status.setTodoCount(this.getCountByExamAndStatus(examId, OmrTaskStatus.WAITING));
|
|
|
+ status.setFinishCount(this.getFinishStudentCountByExamAndUserId(examId, userId));
|
|
|
+ status.setTodoCount(this.getTodoStudentCountByExam(examId));
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int getStudentCountByExamAndStatusAndUserId(Long examId, Long userId, OmrTaskStatus status) {
|
|
|
- QueryWrapper<ScanOmrTask> wrapper = new QueryWrapper<>();
|
|
|
- LambdaQueryWrapper<ScanOmrTask> lw = wrapper.lambda();
|
|
|
- lw.eq(ScanOmrTask::getUserId, userId);
|
|
|
- lw.eq(ScanOmrTask::getExamId, examId);
|
|
|
- return this.count(wrapper);
|
|
|
+ public int getFinishStudentCountByExamAndUserId(Long examId, Long userId) {
|
|
|
+ return this.baseMapper.getStudentCountByExamAndStatusAndUserId(examId,userId,OmrTaskStatus.PROCESSED);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int getStudentCountByExamAndStatus(Long examId, OmrTaskStatus status) {
|
|
|
- QueryWrapper<ScanOmrTask> wrapper = new QueryWrapper<>();
|
|
|
- LambdaQueryWrapper<ScanOmrTask> lw = wrapper.lambda();
|
|
|
- lw.eq(ScanOmrTask::getExamId, examId);
|
|
|
- return this.count(wrapper);
|
|
|
+ public int getTodoStudentCountByExam(Long examId) {
|
|
|
+ return this.baseMapper.getStudentCountByExamAndStatus(examId,OmrTaskStatus.WAITING);
|
|
|
}
|
|
|
|
|
|
@Transactional
|