yin 8 luni în urmă
părinte
comite
e6fa390964

+ 19 - 27
src/main/java/cn/com/qmth/scancentral/service/impl/BatchServiceImpl.java

@@ -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());
-                // 记录paper与batch关联关系
-                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());
+            // 记录paper与batch关联关系
+            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);