|
@@ -281,9 +281,10 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
|
PathSequenceVo pathSequenceVo = null;
|
|
|
try {
|
|
|
// 将图片复制到学号目录下,并删除原图片
|
|
|
- pathSequenceVo = copyImageToStudentCode(paperLibrary, studentId, UploadFileEnum.IMAGE);
|
|
|
+ pathSequenceVo = copyImageToStudentCode(paperLibrary, task, studentId, UploadFileEnum.IMAGE);
|
|
|
} catch (Exception e) {
|
|
|
log.error("纠错操作复制图片失败");
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("纠错失败");
|
|
|
}
|
|
|
|
|
|
// 更新绑定考生ID
|
|
@@ -315,8 +316,8 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private PathSequenceVo copyImageToStudentCode(PaperLibrary paperLibrary, Long studentId, UploadFileEnum uploadFileEnum) {
|
|
|
- PaperScanTask paperScanTask = paperScanTaskService.getById(paperLibrary.getPaperScanTaskId());
|
|
|
+ private PathSequenceVo copyImageToStudentCode(PaperLibrary paperLibrary, PaperScanTask task, Long studentId, UploadFileEnum uploadFileEnum) {
|
|
|
+ PaperScanTask paperScanTask = paperScanTaskService.getById(task.getId());
|
|
|
BasicSchool basicSchool = basicSchoolService.getById(paperScanTask.getSchoolId());
|
|
|
BasicExam basicExam = basicExamService.getById(paperScanTask.getExamId());
|
|
|
BasicSemester basicSemester = basicSemesterService.getById(basicExam.getSemesterId());
|
|
@@ -333,8 +334,9 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
|
// 根目录
|
|
|
boolean isAllCopy = true;
|
|
|
List<FilePathVo> objects = new ArrayList<>();
|
|
|
- int sequence = businessCacheService.getSequence(paperScanTask.getId(), examStudent.getStudentCode());
|
|
|
- String sequenceStr = String.valueOf(sequence);
|
|
|
+// int sequence = businessCacheService.getSequence(paperScanTask.getId(), examStudent.getStudentCode());
|
|
|
+ int sequence = getStudentMaxSequence(paperScanTask.getId(), null, studentId);
|
|
|
+ String sequenceStr = String.valueOf(sequence + 1);
|
|
|
try {
|
|
|
int idx = 1;
|
|
|
String prefix = examStudent.getStudentCode() + "-" + sequenceStr;
|
|
@@ -368,7 +370,7 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
|
ResultUtil.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
- return isAllCopy ? new PathSequenceVo(JSON.toJSONString(objects), sequence) : null;
|
|
|
+ return isAllCopy ? new PathSequenceVo(JSON.toJSONString(objects), sequence+1) : null;
|
|
|
}
|
|
|
|
|
|
@Override
|