|
@@ -976,8 +976,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String,StudentEntity> validate(AnswerPackageDomain domain, User user) {
|
|
|
- BatchEntity batch = getById(domain.getBatchId());
|
|
|
+ public Map<String,StudentEntity> validate(BatchEntity batch,AnswerPackageDomain domain, User user) {
|
|
|
ExamEntity exam = examService.getById(batch.getExamId());
|
|
|
if (exam == null) {
|
|
|
throw ParameterExceptions.EXAM_NOT_FOUND;
|
|
@@ -1045,8 +1044,6 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
paper.setAssigned(answerPaper.getAssigned());
|
|
|
// 保存paper与page到数据库
|
|
|
paperService.savePaperAndPages(paper, answerPaper.buildPageList(null));
|
|
|
- // 记录paper与batch关联关系
|
|
|
- batchPaperService.update(batch, paper, student.getId(), paperNumber, false);
|
|
|
studentPaperList.add(new StudentPaperEntity(student.getId(), paperNumber, paper.getId()));
|
|
|
}
|
|
|
result.put(examNumber,studentPaperList);
|
|
@@ -1056,7 +1053,8 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void deleteRelation(Map<String, StudentEntity> studentMap) {
|
|
|
+ public void deleteRelation(BatchEntity batch,Map<String, StudentEntity> studentMap) {
|
|
|
+ batchPaperService.deleteByBatchId(batch.getId());
|
|
|
for (StudentEntity student: studentMap.values()) {
|
|
|
studentPaperService.removeByStudentId(student.getId());
|
|
|
omrTaskService.deleteByStudentIdAndGroupId(student.getId(),null,false);
|
|
@@ -1080,8 +1078,15 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
examRoom = student.getExamRoom();
|
|
|
concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().lock();
|
|
|
try {
|
|
|
+ List<StudentPaperEntity> studentPaperList = studentPaperMap.get(student.getExamNumber());
|
|
|
+ // 记录paper与batch关联关系
|
|
|
+ for (StudentPaperEntity studentPaper:studentPaperList) {
|
|
|
+ PaperEntity paper = paperService.getById(studentPaper.getPaperId());
|
|
|
+ batchPaperService.update(batch, paper, student.getId(), studentPaper.getPaperNumber(), false);
|
|
|
+ }
|
|
|
// 更新绑定关系
|
|
|
- studentPaperService.saveOrUpdateBatchByMultiId(studentPaperMap.get(student.getExamNumber()));
|
|
|
+ studentPaperService.saveOrUpdateBatchByMultiId(studentPaperList);
|
|
|
+
|
|
|
// 更新考生状态
|
|
|
student = studentService.updateStudentByPaper(user, student.getId(), false);
|
|
|
if(student.getAssigned()){
|