|
@@ -266,10 +266,18 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
// scoreDetailDto.setStatusDisplay("正常");
|
|
|
// }
|
|
|
|
|
|
- if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus()) && BasicExamStudentStatusEnum.N.equals(scoreDetailDto.getStudentStatus())) {
|
|
|
+ // 扫描状态
|
|
|
+ if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus())) {
|
|
|
scoreDetailDto.setStudentStatusDisplay(ScanStatus.UNEXIST.getName());
|
|
|
+ } else if (BasicExamStudentStatusEnum.M.equals(scoreDetailDto.getStudentStatus()) || scoreDetailDto.getAbsent() || scoreDetailDto.getOmrAbsent() || scoreDetailDto.getManualAbsent()) {
|
|
|
+ scoreDetailDto.setStudentStatusDisplay("缺考");
|
|
|
} else {
|
|
|
- scoreDetailDto.setStudentStatusDisplay(scoreDetailDto.getStudentStatus() != null ? scoreDetailDto.getStudentStatus().getName() : null);
|
|
|
+ scoreDetailDto.setStudentStatusDisplay("正常");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 违纪状态
|
|
|
+ if (BasicExamStudentStatusEnum.B.equals(scoreDetailDto.getStudentStatus()) || scoreDetailDto.getBreach() || scoreDetailDto.getOmrBreach() || scoreDetailDto.getManualBreach()) {
|
|
|
+ scoreDetailDto.setBreachDisplay("违纪");
|
|
|
}
|
|
|
|
|
|
// 主观题检查标记
|
|
@@ -292,30 +300,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
|
|
|
/**
|
|
|
* 评卷管理/成绩检查/成绩详情导出
|
|
|
- *
|
|
|
- * @param examId
|
|
|
- * @param paperNumber
|
|
|
- * @param college
|
|
|
- * @param majorName
|
|
|
- * @param teachClassName
|
|
|
- * @param className
|
|
|
- * @param teacher
|
|
|
- * @param filter
|
|
|
- * @param status
|
|
|
- * @param breach
|
|
|
- * @param startScore
|
|
|
- * @param endScore
|
|
|
- * @param subjectiveStartScore
|
|
|
- * @param subjectiveEndScore
|
|
|
- * @param objectiveStartScore
|
|
|
- * @param objectiveEndScore
|
|
|
- * @param subScore
|
|
|
- * @param objectiveScoreRateLt
|
|
|
- * @param studentName
|
|
|
- * @param studentCode
|
|
|
- * @param orderType
|
|
|
- * @param orderField
|
|
|
- * @return
|
|
|
*/
|
|
|
@Override
|
|
|
public List<StudentScoreDetailDto> pageStudentScoreExport(Long examId, String paperNumber, String college, String majorName, String teachClassName, String className, String teacher, Integer filter, String status, Boolean breach, Double startScore, Double endScore, Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore, Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode, String secretNumber, String orderType, String orderField) {
|
|
@@ -370,8 +354,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
|
|
|
HttpServletResponse response = ServletUtil.getResponse();
|
|
|
//生成表头
|
|
|
- String[] columnName = new String[]{"学生姓名", "学号", "学院", "班级", "课程代码", "课程名称", "状态", "客观分", "主观分",
|
|
|
- "成绩"};
|
|
|
+ String[] columnName = new String[]{"姓名", "学号", "学院", "教学班", "行政班", "课程代码", "课程名称", "状态", "违纪状态", "客观分", "主观分", "成绩"};
|
|
|
List<MarkQuestion> oQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
|
|
|
List<MarkQuestion> sQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, false);
|
|
|
List<String> columnNameList = new ArrayList<>(Arrays.asList(columnName));
|
|
@@ -390,10 +373,25 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
valueList.add(s.getStudentName());
|
|
|
valueList.add(s.getStudentCode());
|
|
|
valueList.add(s.getCollegeName());
|
|
|
+ valueList.add(s.getTeachClassName());
|
|
|
valueList.add(s.getClassName());
|
|
|
valueList.add(s.getCourseCode());
|
|
|
valueList.add(s.getCourseName());
|
|
|
- valueList.add(Objects.nonNull(s.getStudentStatus()) ? s.getStudentStatus().getName() : null);
|
|
|
+ // 扫描状态
|
|
|
+ if (ScanStatus.UNEXIST.equals(s.getScanStatus())) {
|
|
|
+ valueList.add(ScanStatus.UNEXIST.getName());
|
|
|
+ } else if (BasicExamStudentStatusEnum.M.equals(s.getStudentStatus()) || s.getAbsent() || s.getOmrAbsent() || s.getManualAbsent()) {
|
|
|
+ valueList.add("缺考");
|
|
|
+ } else {
|
|
|
+ valueList.add("正常");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 违纪状态
|
|
|
+ if (BasicExamStudentStatusEnum.B.equals(s.getStudentStatus()) || s.getBreach() || s.getOmrBreach() || s.getManualBreach()) {
|
|
|
+ valueList.add("违纪");
|
|
|
+ } else {
|
|
|
+ valueList.add("");
|
|
|
+ }
|
|
|
valueList.add(s.getObjectiveScore() == null ? "" : s.getObjectiveScore().toString());
|
|
|
valueList.add(s.getSubjectiveScore() == null ? "" : s.getSubjectiveScore().toString());
|
|
|
valueList.add(s.getTotalScore() == null ? "" : s.getTotalScore().toString());
|
|
@@ -546,9 +544,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (student == null) {
|
|
|
throw new ParameterException("找不到对应的考生");
|
|
|
}
|
|
|
+
|
|
|
Long examId = student.getExamId();
|
|
|
String paperNumber = student.getPaperNumber();
|
|
|
- AbInfoVo abInfoVo = this.baseMapper.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
|
|
|
+ AbInfoVo abInfoVo = this.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
|
|
|
|
|
|
// 重置状态
|
|
|
student.setIncomplete(false);
|
|
@@ -562,7 +561,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
// 获取paper详情更新考生状态
|
|
|
ScanPaper paper = scanPaperService.getById(studentPaper.getPaperId());
|
|
|
// 二次识别不进人工绑定检查
|
|
|
- if(omrAssigned) {
|
|
|
+ if (omrAssigned) {
|
|
|
student.setAssigned(paper.getAssigned());
|
|
|
student.setAssignConfirmed(false);
|
|
|
}
|
|
@@ -584,12 +583,32 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
student.setObjectiveScoreList(null);
|
|
|
}
|
|
|
} else {
|
|
|
+ // 缺考时,校验缺考检查任务是否做完
|
|
|
+ if(page.getAbsent().getResult() ) {
|
|
|
+ if (student.getOmrAbsent() && !student.getOmrAbsentChecked()){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("缺考检查任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ // 缺考时,校验人工绑定任务是否做完
|
|
|
+ if (student.getAssigned() && !student.getAssignConfirmed()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("人工绑定任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ // 缺考时,校验卷型检查任务是否做完
|
|
|
+ if (PaperTypeCheckStatus.WAITING.equals(student.getPaperTypeCheckStatus())) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("卷型检查任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ // 缺考时,校验客观题检查任务是否全部做完
|
|
|
+ if (page.getAbsent() != null && page.getAbsent().getResult()) {
|
|
|
+ if (scanOmrTaskService.getStudentTaskCount(studentId, OmrTaskStatus.WAITING) > 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("客观题检查任务未完成,不能更新为缺考");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 人工指定后,识别缺考未处理的数据,不再处理,已处理的,不变
|
|
|
if (!student.getOmrAbsentChecked()) {
|
|
|
student.setOmrAbsent(false);
|
|
|
}
|
|
|
student.setManualAbsent(page.getAbsent() != null && page.getAbsent().getResult());
|
|
|
- student.setManualBreach(page.getBreach() != null && page.getBreach().getResult());
|
|
|
}
|
|
|
student.setAbsent(student.getOmrAbsent() || (student.getManualAbsent() != null && student.getManualAbsent()));
|
|
|
student.setBreach(student.getOmrBreach() || (student.getManualBreach() != null && student.getManualBreach()));
|
|
@@ -676,13 +695,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
this.countUploadedByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber()));
|
|
|
markPaperService.updateAbsentCount(student.getExamId(), student.getPaperNumber(),
|
|
|
this.countAbsentByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber()));
|
|
|
- // 更新考生管理中考生状态
|
|
|
- this.updateBasicExamStudentStatus(student.getId());
|
|
|
if (updateOmrTask) {
|
|
|
// 清除识别对照任务
|
|
|
scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
|
|
|
// 重新生成识别对照任务
|
|
|
- scanOmrTaskService.saveTask(student.getId());
|
|
|
+ if (!student.getManualAbsent()) {
|
|
|
+ scanOmrTaskService.saveTask(student.getId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1085,7 +1104,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
throw ExceptionResultEnum.ERROR.exception("考生不是未扫描状态");
|
|
|
}
|
|
|
LambdaUpdateWrapper<MarkStudent> lw = new LambdaUpdateWrapper<>();
|
|
|
- lw.set(MarkStudent::getScanStatus, status);
|
|
|
+ lw.set(MarkStudent::getScanStatus, ScanStatus.UNEXIST);
|
|
|
lw.set(MarkStudent::getManualAbsent, ScanStatus.MANUAL_ABSENT.equals(status));
|
|
|
lw.set(MarkStudent::getAbsent, student.getOmrAbsent() || ScanStatus.MANUAL_ABSENT.equals(status));
|
|
|
lw.set(MarkStudent::getMissScan, false);
|
|
@@ -1094,8 +1113,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
|
|
|
this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
|
|
|
|
|
|
- // 更新考生管理中考生状态
|
|
|
- this.updateBasicExamStudentStatus(student.getId());
|
|
|
return AbsentManualUpdateVo.create(status);
|
|
|
}
|
|
|
|
|
@@ -1122,18 +1139,16 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
scanOmrTaskService.deleteByStudentId(student.getExamId(), student.getId());
|
|
|
}
|
|
|
// 更新识别缺考值
|
|
|
- updatePaperPageData(student.getId(), omrAbsent, null);
|
|
|
+ updatePaperPageData(student.getId(), omrAbsent, null, null);
|
|
|
|
|
|
markPaperService.updateUploadCount(examId, student.getPaperNumber(),
|
|
|
this.countUploadedByExamIdAndPaperNumber(examId, student.getPaperNumber()));
|
|
|
markPaperService.updateAbsentCount(examId, student.getPaperNumber(),
|
|
|
this.countAbsentByExamIdAndPaperNumber(examId, student.getPaperNumber()));
|
|
|
- // 更新考生管理状态
|
|
|
- this.updateBasicExamStudentStatus(student.getId());
|
|
|
return UpdateTimeVo.create();
|
|
|
}
|
|
|
|
|
|
- private void updatePaperPageData(Long studentId, Boolean omrAbsent, String paperType) {
|
|
|
+ private void updatePaperPageData(Long studentId, Boolean omrAbsent, Boolean breach, String paperType) {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
// 更改试卷和考生绑定关系的卷型
|
|
|
ScanStudentPaper scanStudentPaper = scanStudentPaperService.findByStudentIdAndPaperNumber(studentId, 1);
|
|
@@ -1151,6 +1166,12 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
scanPaperPage.getAbsent().setResult(omrAbsent);
|
|
|
}
|
|
|
}
|
|
|
+ // 更新识别违纪结果
|
|
|
+ if (breach != null) {
|
|
|
+ if (scanPaperPage.getBreach() != null) {
|
|
|
+ scanPaperPage.getBreach().setResult(breach);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 更新识别卷型结果
|
|
|
if (StringUtils.isNotBlank(paperType)) {
|
|
|
if (scanPaperPage.getPaperType() != null) {
|
|
@@ -1317,7 +1338,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
log.debug("导出Excel结束");
|
|
|
|
|
|
String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
|
|
|
- FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName);
|
|
|
+ FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser.getPassword())));
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
} finally {
|
|
@@ -2051,13 +2072,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
|
|
|
@Override
|
|
|
public MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper
|
|
|
- markPaper, Set<String> secretNumberSet) {
|
|
|
+ markPaper, Set<String> secretNumberSet, boolean containPaperType) {
|
|
|
MarkStudent markStudent = this.findByBasicStudentId(basicExamStudent.getId());
|
|
|
if (markStudent == null) {
|
|
|
if (MarkPaperStatus.FINISH.equals(markPaper.getStatus())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷编号[" + markPaper.getPaperNumber() + "]已结束阅卷,不允许新增考生");
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(basicExamStudent.getPaperType())) {
|
|
|
+ if (containPaperType && StringUtils.isBlank(basicExamStudent.getPaperType())) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("卷型必须");
|
|
|
+ } else {
|
|
|
markStudent = new MarkStudent(SystemConstant.getDbUuid(), basicExamStudent.getExamId(), basicExamStudent.getId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), markPaper.getCoursePaperId(), markPaper.getSerialNumber(), basicExamStudent.getPaperType(), basicExamStudent.getStudentCode(), "", basicExamStudent.getExamPlace(), basicExamStudent.getExamRoom(), basicExamStudent.getExamStartTime(), basicExamStudent.getExamEndTime(), markPaper.getUserId());
|
|
|
if (markStudent.getSecretNumber() == null) {
|
|
|
markStudent.randomSecretNumber();
|
|
@@ -2180,8 +2203,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
lw.eq(MarkStudent::getId, student.getId());
|
|
|
this.update(lw);
|
|
|
|
|
|
- // 更新考生管理状态
|
|
|
- this.updateBasicExamStudentStatus(student.getId());
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -2211,11 +2232,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void updateBasicExamStudentStatus(Long markStudentId) {
|
|
|
+ public void updateBasicExamStudentPaperType(Long markStudentId) {
|
|
|
MarkStudent markStudent = this.getById(markStudentId);
|
|
|
- if (markStudent != null && markStudent.getBasicStudentId() != null) {
|
|
|
- BasicExamStudentStatusEnum status = markStudent.getAbsent() || markStudent.getOmrAbsent() ? BasicExamStudentStatusEnum.M : BasicExamStudentStatusEnum.N;
|
|
|
- this.baseMapper.updateBasicExamStudentStatus(status.name(), markStudent.getBasicStudentId());
|
|
|
+ if (markStudent != null && StringUtils.isNotBlank(markStudent.getPaperType()) && markStudent.getBasicStudentId() != null) {
|
|
|
+ this.baseMapper.updateBasicExamStudentPaperType(markStudent.getPaperType(), markStudent.getBasicStudentId());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2288,13 +2308,37 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
@Override
|
|
|
public UpdateTimeVo disposePaperTypeCheck(Long studentId, String paperType) {
|
|
|
// 更新识别缺考值
|
|
|
- updatePaperPageData(studentId, null, paperType);
|
|
|
+ updatePaperPageData(studentId, null, null, paperType);
|
|
|
|
|
|
// 更改考生卷型和卷型检查状态
|
|
|
UpdateWrapper<MarkStudent> markStudentUpdateWrapper = new UpdateWrapper<>();
|
|
|
markStudentUpdateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getPaperType, paperType)
|
|
|
.set(MarkStudent::getPaperTypeCheckStatus, PaperTypeCheckStatus.PROCESSED);
|
|
|
this.update(markStudentUpdateWrapper);
|
|
|
+ // 更新考生管理卷型
|
|
|
+ updateBasicExamStudentPaperType(studentId);
|
|
|
+ // 客观题统分
|
|
|
+ this.calculateObjectiveScore(this.getById(studentId));
|
|
|
+ return UpdateTimeVo.create();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AbInfoVo findExamTaskPaperTypeOpenStatus(Long examId, String paperNumber) {
|
|
|
+ return this.baseMapper.findExamTaskPaperTypeOpenStatus(examId, paperNumber);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public UpdateTimeVo breachUpdate(Long studentId, Boolean breach) {
|
|
|
+ // 更新识别缺考值
|
|
|
+ updatePaperPageData(studentId, null, breach, null);
|
|
|
+
|
|
|
+ // 更改考生卷型和卷型检查状态(更新人工指定违纪状态时,识别违纪改为false)
|
|
|
+ UpdateWrapper<MarkStudent> markStudentUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ markStudentUpdateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getManualBreach, breach)
|
|
|
+ .set(MarkStudent::getOmrBreach, false)
|
|
|
+ .set(MarkStudent::getBreach, breach)
|
|
|
+ .set(MarkStudent::getPaperTypeCheckStatus, PaperTypeCheckStatus.PROCESSED);
|
|
|
+ this.update(markStudentUpdateWrapper);
|
|
|
return UpdateTimeVo.create();
|
|
|
}
|
|
|
|