|
@@ -145,7 +145,6 @@ public class ScanBatchServiceImpl extends ServiceImpl<ScanBatchMapper, ScanBatch
|
|
|
if (answerCard == null) {
|
|
|
throw new ParameterException("卡格式信息未找到");
|
|
|
}
|
|
|
- boolean studentAssigned = false;
|
|
|
List<ScanStudentPaper> studentPaperList = new ArrayList<>();
|
|
|
for (AnswerPaper answerPaper : domain.getPapers()) {
|
|
|
// 验证page数量
|
|
@@ -165,19 +164,16 @@ public class ScanBatchServiceImpl extends ServiceImpl<ScanBatchMapper, ScanBatch
|
|
|
scanBatchPaperService.update(batch, paper, student.getId(), paperNumber);
|
|
|
// 创建student与paper的关联关系
|
|
|
studentPaperList.add(new ScanStudentPaper(student.getId(), paperNumber, paper.getId()));
|
|
|
- studentAssigned = studentAssigned || paper.getAssigned();
|
|
|
}
|
|
|
// 更新批次统计数量
|
|
|
updateAssignedCount(batch.getId());
|
|
|
updateScanCount(batch.getId());
|
|
|
- // 没有人工绑定的情况下,直接更新考生扫描状态
|
|
|
- if (!studentAssigned) {
|
|
|
- concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().lock();
|
|
|
- try {
|
|
|
- markStudentService.updateStudentAndPaper(user, student.getId(), studentPaperList);
|
|
|
- } finally {
|
|
|
- concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
|
|
|
- }
|
|
|
+ //直接更新考生扫描状态
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().lock();
|
|
|
+ try {
|
|
|
+ markStudentService.updateStudentAndPaper(user, student.getId(), studentPaperList);
|
|
|
+ } finally {
|
|
|
+ concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
|
|
|
}
|
|
|
return AnswerSaveVo.create(findStudentCountByBatch(batch.getId()));
|
|
|
}
|