|
@@ -1076,41 +1076,33 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
campusCode = student.getCampusCode();
|
|
|
examSite = student.getExamSite();
|
|
|
examRoom = student.getExamRoom();
|
|
|
- concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().lock();
|
|
|
- try {
|
|
|
- List<StudentPaperEntity> studentPaperList = studentPaperMap.get(student.getExamNumber());
|
|
|
-
|
|
|
- for (StudentPaperEntity studentPaper:studentPaperList) {
|
|
|
- PaperEntity paper = paperService.getById(studentPaper.getPaperId());
|
|
|
- batchPaperService.update(batch, paper, student.getId(), studentPaper.getPaperNumber(), false);
|
|
|
- }
|
|
|
-
|
|
|
- studentPaperService.saveOrUpdateBatchByMultiId(studentPaperList);
|
|
|
-
|
|
|
-
|
|
|
- student = studentService.updateStudentByPaper(user, student.getId(), false);
|
|
|
- if(student.getAssigned()){
|
|
|
- assignedCount++;
|
|
|
- }
|
|
|
-
|
|
|
- for (OmrGroupEntity g : gs) {
|
|
|
- if(g.getFixed()){
|
|
|
- List<OmrTaskEntity> list = omrTaskService.buildTask(g, student.getId());
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- omrTaskService.saveBatch(list);
|
|
|
- }
|
|
|
+ List<StudentPaperEntity> studentPaperList = studentPaperMap.get(student.getExamNumber());
|
|
|
+
|
|
|
+ for (StudentPaperEntity studentPaper:studentPaperList) {
|
|
|
+ PaperEntity paper = paperService.getById(studentPaper.getPaperId());
|
|
|
+ batchPaperService.update(batch, paper, student.getId(), studentPaper.getPaperNumber(), false);
|
|
|
+ }
|
|
|
+
|
|
|
+ studentPaperService.saveOrUpdateBatchByMultiId(studentPaperList);
|
|
|
+
|
|
|
+ student = studentService.updateStudentByPaper(user, student.getId(), false);
|
|
|
+ if(student.getAssigned()){
|
|
|
+ assignedCount++;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OmrGroupEntity g : gs) {
|
|
|
+ if(g.getFixed()){
|
|
|
+ List<OmrTaskEntity> list = omrTaskService.buildTask(g, student.getId());
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ omrTaskService.saveBatch(list);
|
|
|
}
|
|
|
}
|
|
|
- } finally {
|
|
|
- concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (OmrGroupEntity g : gs) {
|
|
|
- concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).writeLock().lock();
|
|
|
g.setTotalCount(omrTaskService.countByGroupId(g.getId()));
|
|
|
omrGroupService.saveOrUpdate(g);
|
|
|
- concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).writeLock().unlock();
|
|
|
}
|
|
|
|
|
|
this.batchFinish(batch.getId(),studentMap.size(),assignedCount);
|