|
@@ -77,6 +77,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
import java.awt.*;
|
|
|
import java.awt.color.ColorSpace;
|
|
|
+import java.awt.geom.FlatteningPathIterator;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.awt.image.ColorConvertOp;
|
|
|
import java.io.*;
|
|
@@ -178,8 +179,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
@Override
|
|
|
public void updateSubjectiveStatusAndScore(Long studentId, SubjectiveStatus status) {
|
|
|
UpdateWrapper<MarkStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.lambda().set(MarkStudent::getSubjectiveStatus, status).
|
|
|
- set(MarkStudent::getSubjectiveScore, null)
|
|
|
+ updateWrapper.lambda().set(MarkStudent::getSubjectiveStatus, status)
|
|
|
+ .set(MarkStudent::getSubjectiveScore, null)
|
|
|
+ .set(MarkStudent::getAiMarkAbnormal, false)
|
|
|
.set(MarkStudent::getSubjectiveScoreList, null)
|
|
|
.set(MarkStudent::getCheckUserId, null)
|
|
|
.set(MarkStudent::getCheckTime, null)
|
|
@@ -331,6 +333,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // AI评卷异常
|
|
|
+ if (scoreDetailDto.getAiMarkAbnormal()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[" + scoreDetailDto.getStudentName() + "]AI评卷任务异常,请人工给分后再导出");
|
|
|
+ }
|
|
|
+
|
|
|
// 格式化分数
|
|
|
scoreDetailDto.setObjectiveScore(Calculator.round(scoreDetailDto.getObjectiveScore(), 1));
|
|
|
scoreDetailDto.setSubjectiveScore(Calculator.round(scoreDetailDto.getSubjectiveScore(), 1));
|
|
@@ -690,6 +697,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
ScanAnswerCard answerCard = answerCardService.findByExamAndNumber(student.getExamId(),
|
|
|
student.getCardNumber());
|
|
|
student.setUpload(true);
|
|
|
+ student.setUploadTime(System.currentTimeMillis());
|
|
|
student.setIncomplete(paperCount != answerCard.getPaperCount());
|
|
|
student.setScanStatus(ScanStatus.SCANNED);
|
|
|
student.setMissScan(false);
|
|
@@ -1438,6 +1446,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
List<ArchiveStudentVo> ret = baseMapper.studentList(sysUser.getSchoolId(), query, dpr);
|
|
|
|
|
|
for (ArchiveStudentVo s : ret) {
|
|
|
+ // AI评卷异常
|
|
|
+ if (s.getAiMarkAbnormal()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[" + s.getStudentName() + "]AI评卷任务异常,请人工给分后再导出");
|
|
|
+ }
|
|
|
List<CellValue> valueList = new ArrayList<>();
|
|
|
valueList.add(CellValue.of(s.getStudentName()));
|
|
|
valueList.add(CellValue.of(s.getStudentCode()));
|
|
@@ -1911,7 +1923,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
if (CollectionUtils.isNotEmpty(studentIdList)) {
|
|
|
markArchiveStudents = markArchiveStudentService.listByStudentIds(studentIdList);
|
|
|
}
|
|
|
- if(CollectionUtils.isNotEmpty(markArchiveStudents)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(markArchiveStudents)) {
|
|
|
for (MarkArchiveStudent markArchiveStudent : markArchiveStudents) {
|
|
|
List<TaskQuestion> taskQuestionList = JSON.parseArray(markArchiveStudent.getSubjectiveQuestions(), TaskQuestion.class);
|
|
|
Map<Integer, Double> listMap = taskQuestionList.stream().collect(Collectors.groupingBy(m -> m.getMainNumber(), Collectors.summingDouble(n -> n.getMarkerScore())));
|
|
@@ -1920,8 +1932,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
}
|
|
|
}
|
|
|
MarkArchiveStudent markArchiveStudent = markArchiveStudents.get(0);
|
|
|
- if(markArchiveStudent!= null) {
|
|
|
- if(StringUtils.isNotBlank(markArchiveStudent.getObjectiveQuestions())) {
|
|
|
+ if (markArchiveStudent != null) {
|
|
|
+ if (StringUtils.isNotBlank(markArchiveStudent.getObjectiveQuestions())) {
|
|
|
List<StudentObjectiveAnswerDto> taskQuestions = JSON.parseArray(markArchiveStudent.getObjectiveQuestions(), StudentObjectiveAnswerDto.class);
|
|
|
for (StudentObjectiveAnswerDto taskQuestion : taskQuestions) {
|
|
|
MarkQuestion markQuestion = new MarkQuestion();
|
|
@@ -1933,7 +1945,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
questionDatasource.add(markQuestion);
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(markArchiveStudent.getSubjectiveQuestions())) {
|
|
|
+ if (StringUtils.isNotBlank(markArchiveStudent.getSubjectiveQuestions())) {
|
|
|
List<TaskQuestion> taskQuestions = JSON.parseArray(markArchiveStudent.getSubjectiveQuestions(), TaskQuestion.class);
|
|
|
for (TaskQuestion taskQuestion : taskQuestions) {
|
|
|
MarkQuestion markQuestion = new MarkQuestion();
|
|
@@ -2754,4 +2766,18 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
public List<MarkAiScoreDto> findScoreByAiMark(Long examId, String paperNumber) {
|
|
|
return this.baseMapper.findScoreByAiMark(examId, paperNumber);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Long> listAiMarkAbnormal(Long examId, String paperNumber) {
|
|
|
+ return this.baseMapper.listAiMarkAbnormal(examId, paperNumber);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int countByExamIdAndPaperNumberAndAiMarkAbnormal(Long examId, String paperNumber, boolean aiMarkAbnormal) {
|
|
|
+ QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().eq(MarkStudent::getExamId, examId)
|
|
|
+ .eq(MarkStudent::getPaperNumber, paperNumber)
|
|
|
+ .eq(MarkStudent::getAiMarkAbnormal, aiMarkAbnormal);
|
|
|
+ return this.count(queryWrapper);
|
|
|
+ }
|
|
|
}
|