|
@@ -46,6 +46,7 @@ import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -267,6 +268,12 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
if (paperLibrary == null) {
|
|
if (paperLibrary == null) {
|
|
throw ExceptionResultEnum.ERROR.exception("图片数据不存在");
|
|
throw ExceptionResultEnum.ERROR.exception("图片数据不存在");
|
|
}
|
|
}
|
|
|
|
+ ExamStudent student = examStudentService.getById(studentId);
|
|
|
|
+ PaperScanTask task = paperScanTaskService.getByExamIdAndCourseCode(student.getExamId(), student.getCourseCode());
|
|
|
|
+ if (Objects.isNull(task)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考生找不到扫描任务");
|
|
|
|
+ }
|
|
|
|
+
|
|
// 自己绑定自己,直接返回
|
|
// 自己绑定自己,直接返回
|
|
if (paperLibrary.getStudentId() != null && paperLibrary.getStudentId().equals(studentId)) {
|
|
if (paperLibrary.getStudentId() != null && paperLibrary.getStudentId().equals(studentId)) {
|
|
return true;
|
|
return true;
|
|
@@ -283,6 +290,7 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
UpdateWrapper<PaperLibrary> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<PaperLibrary> updateWrapper = new UpdateWrapper<>();
|
|
LambdaUpdateWrapper<PaperLibrary> lambda = updateWrapper.lambda();
|
|
LambdaUpdateWrapper<PaperLibrary> lambda = updateWrapper.lambda();
|
|
lambda.set(PaperLibrary::getStudentId, studentId);
|
|
lambda.set(PaperLibrary::getStudentId, studentId);
|
|
|
|
+ lambda.set(PaperLibrary::getPaperScanTaskId, task.getId());
|
|
if (pathSequenceVo != null) {
|
|
if (pathSequenceVo != null) {
|
|
lambda.set(PaperLibrary::getPath, pathSequenceVo.getPath());
|
|
lambda.set(PaperLibrary::getPath, pathSequenceVo.getPath());
|
|
lambda.set(PaperLibrary::getSequence, pathSequenceVo.getSequence());
|
|
lambda.set(PaperLibrary::getSequence, pathSequenceVo.getSequence());
|
|
@@ -300,10 +308,8 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
examStudentService.clearPdfFilePath(studentId);
|
|
examStudentService.clearPdfFilePath(studentId);
|
|
|
|
|
|
//更新扫描任务扫描考生数量、扫描图片数量
|
|
//更新扫描任务扫描考生数量、扫描图片数量
|
|
- ExamStudent student = examStudentService.getById(studentId);
|
|
|
|
- PaperScanTask task = paperScanTaskService.getByExamIdAndCourseCode(studentId, student.getCourseCode());
|
|
|
|
paperScanTaskService.updateScanCount(paperLibrary.getPaperScanTaskId());
|
|
paperScanTaskService.updateScanCount(paperLibrary.getPaperScanTaskId());
|
|
- if(task != null && !task.getId().equals(paperLibrary.getPaperScanTaskId())) {
|
|
|
|
|
|
+ if(!task.getId().equals(paperLibrary.getPaperScanTaskId())) {
|
|
paperScanTaskService.updateScanCount(task.getId());
|
|
paperScanTaskService.updateScanCount(task.getId());
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|