|
@@ -16,12 +16,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.teachcloud.common.entity.BasicExam;
|
|
|
import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
|
+import com.qmth.teachcloud.mark.bean.scanexaminfo.CheckTask;
|
|
|
+import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamCheckInfoVo;
|
|
|
import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamInfoVo;
|
|
|
import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
|
+import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
|
|
|
import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
|
|
|
import com.qmth.teachcloud.mark.service.MarkPaperService;
|
|
|
import com.qmth.teachcloud.mark.service.MarkStudentService;
|
|
|
+import com.qmth.teachcloud.mark.service.ScanOmrTaskService;
|
|
|
import com.qmth.teachcloud.mark.service.ScanPackageService;
|
|
|
+import com.qmth.teachcloud.mark.service.ScanPaperService;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -37,6 +42,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
private MarkPaperService markPaperService;
|
|
|
@Autowired
|
|
|
private ScanPackageService scanPackageService;
|
|
|
+ @Autowired
|
|
|
+ private ScanPaperService scanPaperService;
|
|
|
+ @Autowired
|
|
|
+ private ScanOmrTaskService scanOmrTaskService;
|
|
|
|
|
|
@Override
|
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
@@ -83,4 +92,42 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
return baseMapper.selectCount(wrapper);
|
|
|
}
|
|
|
+
|
|
|
+ private int getOmrAbsentCount(Long examId,Boolean checked) {
|
|
|
+ QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
|
|
|
+ LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
|
|
|
+ lw.eq(MarkStudent::getExamId, examId);
|
|
|
+ lw.eq(MarkStudent::getOmrAbsent, true);
|
|
|
+ if(checked!=null) {
|
|
|
+ lw.eq(MarkStudent::getOmrAbsentChecked, checked);
|
|
|
+ }
|
|
|
+ return baseMapper.selectCount(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ private int getIncompleteCount(Long examId) {
|
|
|
+ QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
|
|
|
+ LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
|
|
|
+ lw.eq(MarkStudent::getExamId, examId);
|
|
|
+ lw.eq(MarkStudent::getIncomplete, true);
|
|
|
+ return baseMapper.selectCount(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ScanExamCheckInfoVo checkInfo(BasicExam exam) {
|
|
|
+ Long examId=exam.getId();
|
|
|
+ ScanExamCheckInfoVo vo=new ScanExamCheckInfoVo();
|
|
|
+ vo.setId(exam.getId());
|
|
|
+ vo.setName(exam.getName());
|
|
|
+ CheckTask ct=vo.getCheckTask();
|
|
|
+ ct.setUnexistCount(getCount(examId, ScanStatus.UNEXIST));
|
|
|
+ ct.setUnexistCheckedCount(getCount(examId, ScanStatus.MANUAL_ABSENT));
|
|
|
+ ct.setAssignedCount(scanPaperService.getAssignedCount(examId, false));
|
|
|
+ ct.setAssignedCheckedCount(scanPaperService.getAssignedCount(examId, true));
|
|
|
+ ct.setAbsentCheckCount(getOmrAbsentCount(examId, false));
|
|
|
+ ct.setAbsentCheckedCount(getOmrAbsentCount(examId, true));
|
|
|
+ ct.setObjectiveCheckCount(scanOmrTaskService.getCount(examId, OmrTaskStatus.WAITING));
|
|
|
+ ct.setObjectiveCheckedCount(scanOmrTaskService.getCount(examId, OmrTaskStatus.PROCESSED));
|
|
|
+ ct.setIncompleteCount(getIncompleteCount(examId));
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
}
|