|
@@ -29,6 +29,7 @@ import com.qmth.teachcloud.common.enums.PageSizeEnum;
|
|
|
import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
|
import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
|
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
|
+import com.qmth.teachcloud.common.enums.scan.ExceptionPaperType;
|
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
|
|
|
import com.qmth.teachcloud.common.service.FileUploadService;
|
|
@@ -167,6 +168,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
private ScanBatchPaperService scanBatchPaperService;
|
|
|
@Resource
|
|
|
private BasicCourseService basicCourseService;
|
|
|
+ @Resource
|
|
|
+ private ScanPaperTypeCheckService scanPaperTypeCheckService;
|
|
|
|
|
|
@Override
|
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
@@ -499,24 +502,25 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
vo.setId(exam.getId());
|
|
|
vo.setName(exam.getName());
|
|
|
CheckTask ct = vo.getCheckTask();
|
|
|
- ct.setUnexistCount(
|
|
|
- getCount(examId, ScanStatus.UNEXIST, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
+ ct.setUnexistCount(getCount(examId, ScanStatus.UNEXIST, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
ct.setUnexistCheckedCount(
|
|
|
getCount(examId, ScanStatus.MANUAL_ABSENT, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
- ct.setMissScanCount(
|
|
|
- getMissScanCount(examId, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
+ ct.setMissScanCount(getMissScanCount(examId, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
ct.setAssignedCount(getAssignedCount(examId, false, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
ct.setAssignedCheckedCount(
|
|
|
getAssignedCount(examId, true, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
- ct.setAbsentCheckCount(
|
|
|
- getOmrAbsentCount(examId, false, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
- ct.setAbsentCheckedCount(
|
|
|
- getOmrAbsentCount(examId, true, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
- ct.setObjectiveCheckCount(scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId,
|
|
|
- OmrTaskStatus.WAITING.name(), dpr));
|
|
|
- ct.setObjectiveCheckedCount(scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId,
|
|
|
- OmrTaskStatus.PROCESSED.name(), dpr));
|
|
|
+ ct.setAbsentCheckCount(getOmrAbsentCount(examId, false, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
+ ct.setAbsentCheckedCount(getOmrAbsentCount(examId, true, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
+ ct.setObjectiveCheckCount(
|
|
|
+ scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId, OmrTaskStatus.WAITING.name(), dpr));
|
|
|
+ ct.setObjectiveCheckedCount(
|
|
|
+ scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId, OmrTaskStatus.PROCESSED.name(), dpr));
|
|
|
ct.setIncompleteCount(getIncompleteCount(examId, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
|
|
|
+
|
|
|
+ ct.setPaperTypeCheckCount(
|
|
|
+ scanPaperTypeCheckService.getPaperTypeCheckCount(examId, courseId, coursePaperId, OmrTaskStatus.WAITING, dpr));
|
|
|
+ ct.setPaperTypeCheckedCount(
|
|
|
+ scanPaperTypeCheckService.getPaperTypeCheckCount(examId, courseId, coursePaperId, OmrTaskStatus.PROCESSED, dpr));
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
@@ -559,12 +563,47 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
student.setObjectiveScoreList(null);
|
|
|
}
|
|
|
// student.setDevice(batchService.findByPaperId(paper.getId()).getDevice());
|
|
|
+ ExceptionPaperType exceptionPaperType = null;
|
|
|
+ // 根据卷型识别结果更新考生卷型,如果卷型识别结果异常则添加到卷型检查中
|
|
|
+ String paperType = page.getPaperType();
|
|
|
+ student.setPaperType(paperType);
|
|
|
+ if (!SystemConstant.strNotNull(paperType)) {
|
|
|
+ // 卷型为空
|
|
|
+ exceptionPaperType = ExceptionPaperType.NONE;
|
|
|
+ } else if (!paperType.matches("[A-Z#]+")) {
|
|
|
+ // 未识别到卷型
|
|
|
+ exceptionPaperType = ExceptionPaperType.NONE;
|
|
|
+ } else if (paperType.length() > 1) {
|
|
|
+ // 多卷型
|
|
|
+ exceptionPaperType = ExceptionPaperType.MULTIPLE;
|
|
|
+ } else if ("#".equals(paperType)) {
|
|
|
+ // 没有识别到卷型
|
|
|
+ exceptionPaperType = ExceptionPaperType.NONE;
|
|
|
+ }
|
|
|
+
|
|
|
+ scanPaperTypeCheckService.remove(new QueryWrapper<ScanPaperTypeCheck>().lambda().eq(ScanPaperTypeCheck::getStudentId, student.getId()));
|
|
|
+ if (Objects.nonNull(exceptionPaperType)) {
|
|
|
+ ScanPaperTypeCheck check = new ScanPaperTypeCheck();
|
|
|
+
|
|
|
+ check.setExamId(paper.getExamId());
|
|
|
+ check.setExceptionPaperType(exceptionPaperType);
|
|
|
+ check.setPaperType(paperType);
|
|
|
+ check.setStudentId(studentId);
|
|
|
+ check.setPaperIndex(1);
|
|
|
+ check.setPaperId(paper.getId());
|
|
|
+ check.setCardNumber(paper.getCardNumber());
|
|
|
+ check.setStatus(OmrTaskStatus.WAITING);
|
|
|
+ check.setUserId(userId);
|
|
|
+ check.setId(SystemConstant.getDbUuid());
|
|
|
+ check.setCreatorId(userId);
|
|
|
+
|
|
|
+ scanPaperTypeCheckService.save(check);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
List<ScanPaperPage> scanPaperPages = scanPaperPageService.listByPaperId(studentPaper.getPaperId());
|
|
|
for (ScanPaperPage scanPaperPage : scanPaperPages) {
|
|
|
- if (scanPaperPage.getQuestion() != null
|
|
|
- && CollectionUtils.isNotEmpty(scanPaperPage.getQuestion().getResult())) {
|
|
|
+ if (scanPaperPage.getQuestion() != null && CollectionUtils.isNotEmpty(scanPaperPage.getQuestion().getResult())) {
|
|
|
for (String s : scanPaperPage.getQuestion().getResult()) {
|
|
|
if (s.startsWith("?")) {
|
|
|
s = s.replace("?", "");
|