|
@@ -29,7 +29,6 @@ import com.qmth.teachcloud.common.enums.PageSizeEnum;
|
|
import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
|
|
import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
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.BasicCourseService;
|
|
import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
|
|
import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
|
|
import com.qmth.teachcloud.common.service.FileUploadService;
|
|
import com.qmth.teachcloud.common.service.FileUploadService;
|
|
@@ -47,6 +46,7 @@ import com.qmth.teachcloud.mark.bean.student.AbsentManualUpdateVo;
|
|
import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
|
|
import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
|
|
import com.qmth.teachcloud.mark.bean.student.StudentQuery;
|
|
import com.qmth.teachcloud.mark.bean.student.StudentQuery;
|
|
import com.qmth.teachcloud.mark.bean.student.StudentVo;
|
|
import com.qmth.teachcloud.mark.bean.student.StudentVo;
|
|
|
|
+import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
|
|
import com.qmth.teachcloud.mark.dto.UnexistStudentDto;
|
|
import com.qmth.teachcloud.mark.dto.UnexistStudentDto;
|
|
import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
|
|
import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
|
|
import com.qmth.teachcloud.mark.dto.mark.ScoreInfo;
|
|
import com.qmth.teachcloud.mark.dto.mark.ScoreInfo;
|
|
@@ -54,10 +54,7 @@ import com.qmth.teachcloud.mark.dto.mark.ScoreItem;
|
|
import com.qmth.teachcloud.mark.dto.mark.manage.Task;
|
|
import com.qmth.teachcloud.mark.dto.mark.manage.Task;
|
|
import com.qmth.teachcloud.mark.dto.mark.score.*;
|
|
import com.qmth.teachcloud.mark.dto.mark.score.*;
|
|
import com.qmth.teachcloud.mark.entity.*;
|
|
import com.qmth.teachcloud.mark.entity.*;
|
|
-import com.qmth.teachcloud.mark.enums.ExamStatus;
|
|
|
|
-import com.qmth.teachcloud.mark.enums.LockType;
|
|
|
|
-import com.qmth.teachcloud.mark.enums.MarkTaskStatus;
|
|
|
|
-import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
|
|
|
|
|
|
+import com.qmth.teachcloud.mark.enums.*;
|
|
import com.qmth.teachcloud.mark.lock.LockService;
|
|
import com.qmth.teachcloud.mark.lock.LockService;
|
|
import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
|
|
import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
|
|
import com.qmth.teachcloud.mark.params.MarkHeaderResult;
|
|
import com.qmth.teachcloud.mark.params.MarkHeaderResult;
|
|
@@ -168,8 +165,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
private ScanBatchPaperService scanBatchPaperService;
|
|
private ScanBatchPaperService scanBatchPaperService;
|
|
@Resource
|
|
@Resource
|
|
private BasicCourseService basicCourseService;
|
|
private BasicCourseService basicCourseService;
|
|
- @Resource
|
|
|
|
- private ScanPaperTypeCheckService scanPaperTypeCheckService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
@@ -492,6 +487,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
return baseMapper.selectCountByQuery(markStudent, dpr);
|
|
return baseMapper.selectCountByQuery(markStudent, dpr);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private int getPaperTypeCheckCount(Long examId, Long courseId, String coursePaperId, PaperTypeCheckStatus status, DataPermissionRule dpr) {
|
|
|
|
+ MarkStudent markStudent = new MarkStudent();
|
|
|
|
+ markStudent.setExamId(examId);
|
|
|
|
+ markStudent.setCourseId(courseId);
|
|
|
|
+ markStudent.setCoursePaperId(coursePaperId);
|
|
|
|
+ markStudent.setPaperTypeCheckStatus(status);
|
|
|
|
+ return baseMapper.selectCountByQuery(markStudent, dpr);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public ScanExamCheckInfoVo checkInfo(BasicExam exam, Long courseId, String coursePaperId) {
|
|
public ScanExamCheckInfoVo checkInfo(BasicExam exam, Long courseId, String coursePaperId) {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
@@ -517,10 +521,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId, OmrTaskStatus.PROCESSED.name(), dpr));
|
|
scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId, OmrTaskStatus.PROCESSED.name(), dpr));
|
|
ct.setIncompleteCount(getIncompleteCount(examId, courseId, coursePaperId, MarkPaperStatus.FORMAL, 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));
|
|
|
|
|
|
+ ct.setPaperTypeCheckCount(getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.WAITING, dpr));
|
|
|
|
+ ct.setPaperTypeCheckedCount(getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.PROCESSED, dpr));
|
|
return vo;
|
|
return vo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -534,6 +536,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
if (student == null) {
|
|
if (student == null) {
|
|
throw new ParameterException("找不到对应的考生");
|
|
throw new ParameterException("找不到对应的考生");
|
|
}
|
|
}
|
|
|
|
+ Long examId = student.getExamId();
|
|
|
|
+ String paperNumber = student.getPaperNumber();
|
|
|
|
+ Boolean openAb = this.baseMapper.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
|
|
|
|
+
|
|
// 重置状态
|
|
// 重置状态
|
|
student.setIncomplete(false);
|
|
student.setIncomplete(false);
|
|
student.setAssigned(false);
|
|
student.setAssigned(false);
|
|
@@ -563,42 +569,34 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
student.setObjectiveScoreList(null);
|
|
student.setObjectiveScoreList(null);
|
|
}
|
|
}
|
|
// student.setDevice(batchService.findByPaperId(paper.getId()).getDevice());
|
|
// student.setDevice(batchService.findByPaperId(paper.getId()).getDevice());
|
|
- ExceptionPaperType exceptionPaperType = null;
|
|
|
|
|
|
+
|
|
|
|
+ PaperTypeCheckStatus paperTypeCheckStatus = PaperTypeCheckStatus.NORMAL;
|
|
// 根据卷型识别结果更新考生卷型,如果卷型识别结果异常则添加到卷型检查中
|
|
// 根据卷型识别结果更新考生卷型,如果卷型识别结果异常则添加到卷型检查中
|
|
String paperType = page.getPaperType();
|
|
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;
|
|
|
|
- }
|
|
|
|
|
|
+ if (!openAb) {
|
|
|
|
+ // 不开启卷型默认A卷 正常
|
|
|
|
+ paperType = "A";
|
|
|
|
+ } else {
|
|
|
|
+ if (!SystemConstant.strNotNull(paperType)) {
|
|
|
|
+ // 卷型为空 (正常不会出现这种情况)
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("开启卷型的试卷未检测到识别的卷型");
|
|
|
|
+ }
|
|
|
|
+ if (!paperType.matches("[A-Z#]+")) {
|
|
|
|
+ // 未识别到卷型 (正常不会出现这种情况)
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("卷型识别错误");
|
|
|
|
+ }
|
|
|
|
+ if (paperType.length() > 1) {
|
|
|
|
+ // 多卷型
|
|
|
|
+ paperTypeCheckStatus = PaperTypeCheckStatus.WAITING;
|
|
|
|
+ }
|
|
|
|
+ if ("#".equals(paperType)) {
|
|
|
|
+ // 没有识别到卷型
|
|
|
|
+ paperTypeCheckStatus = PaperTypeCheckStatus.WAITING;
|
|
|
|
+ }
|
|
|
|
|
|
- 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);
|
|
|
|
}
|
|
}
|
|
|
|
+ student.setPaperType(paperType);
|
|
|
|
+ student.setPaperTypeCheckStatus(paperTypeCheckStatus);
|
|
}
|
|
}
|
|
|
|
|
|
List<ScanPaperPage> scanPaperPages = scanPaperPageService.listByPaperId(studentPaper.getPaperId());
|
|
List<ScanPaperPage> scanPaperPages = scanPaperPageService.listByPaperId(studentPaper.getPaperId());
|
|
@@ -2192,4 +2190,16 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
public MarkStudentVo getDetailById(Long studentId) {
|
|
public MarkStudentVo getDetailById(Long studentId) {
|
|
return this.baseMapper.getDetailById(studentId);
|
|
return this.baseMapper.getDetailById(studentId);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ScanOmrTaskStatusDto getStatus(Long examId, Long courseId, String coursePaperId) {
|
|
|
|
+ DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission();
|
|
|
|
+ Integer todoCount = this.getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.WAITING,
|
|
|
|
+ dpr);
|
|
|
|
+ Integer finishCount = this.getPaperTypeCheckCount(examId, courseId, coursePaperId, PaperTypeCheckStatus.PROCESSED, dpr);
|
|
|
|
+ ScanOmrTaskStatusDto result = new ScanOmrTaskStatusDto();
|
|
|
|
+ result.setTodoCount(todoCount);
|
|
|
|
+ result.setFinishCount(finishCount);
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|