yin hai 7 meses
pai
achega
e51ff6ccd4

+ 1 - 1
src/main/java/cn/com/qmth/scancentral/service/StudentService.java

@@ -66,7 +66,7 @@ public interface StudentService extends IService<StudentEntity> {
 
     void pictureCopy(StudentUploadVo vo);
 
-    StudentEntity updateStudentByPaper(User user, Long id, boolean updateOmrTask);
+    StudentEntity updateStudentByPaper(User user, Long id, boolean updateOmrTask, boolean updateAssignedCount);
 
     void updateStudentAndPaper(User user, Long id, List<StudentPaperEntity> studentPaperList);
 

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

@@ -1085,7 +1085,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
             // 更新绑定关系
             studentPaperService.saveOrUpdateBatchByMultiId(studentPaperList);
             // 更新考生状态
-            student = studentService.updateStudentByPaper(user, student.getId(), false);
+            student = studentService.updateStudentByPaper(user, student.getId(), false,true);
             if(student.getAssigned()){
                 assignedCount++;
             }

+ 1 - 1
src/main/java/cn/com/qmth/scancentral/service/impl/OmrTaskServiceImpl.java

@@ -754,7 +754,7 @@ public class OmrTaskServiceImpl extends ServiceImpl<OmrTaskDao, OmrTaskEntity> i
             }
         }
         paperService.savePaperAndPages(paper, pages);
-        studentService.updateStudentByPaper(user, sp.getStudentId(), false);
+        studentService.updateStudentByPaper(user, sp.getStudentId(), false,false);
     }
 
     private boolean setResult(OmrGroupEntity group, OmrTaskItem item, String result) {

+ 8 - 6
src/main/java/cn/com/qmth/scancentral/service/impl/StudentServiceImpl.java

@@ -263,7 +263,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
         // 保存绑定关系
         studentPaperService.saveOrUpdateBatchByMultiId(studentPaperList);
         // 更新考生状态
-        updateStudentByPaper(user, id, true);
+        updateStudentByPaper(user, id, true,true);
     }
 
     /**
@@ -274,7 +274,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
     @Override
     @Transactional
     // @Lockable(name = LockType.STUDENT, key = "#id")
-    public StudentEntity updateStudentByPaper(@NotNull User user, @NotNull Long id, @NotNull boolean updateOmrTask) {
+    public StudentEntity updateStudentByPaper(@NotNull User user, @NotNull Long id, @NotNull boolean updateOmrTask, boolean updateAssignedCount) {
         StudentEntity student = baseMapper.selectById(id);
         if (student == null) {
             throw new ParameterException("找不到对应的考生");
@@ -380,7 +380,9 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                 }
             }
         }
-        this.updateAssignedCheckCount(student.getId(), true);
+        if(updateAssignedCount){
+            this.updateAssignedCheckCount(student.getId(), true);
+        }
         return student;
     }
 
@@ -1160,7 +1162,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                 }
                 paperService.savePaperAndPages(paper, pages);
             }
-            updateStudentByPaper(user, student.getId(), true);
+            updateStudentByPaper(user, student.getId(), true,false);
             return AnswerRefixVo.create();
         } finally {
             concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
@@ -1195,7 +1197,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                 }
                 paperService.savePaperAndPages(paperEntity, pages);
             }
-            updateStudentByPaper(user, student.getId(), false);
+            updateStudentByPaper(user, student.getId(), false,false);
             return UpdateTimeVo.create();
         } finally {
             concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
@@ -1251,7 +1253,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                 throw new ParameterException("未找到page信息结果");
             }
             paperService.savePaperAndPages(paperEntity, pages);
-            updateStudentByPaper(user, student.getId(), false);
+            updateStudentByPaper(user, student.getId(), false,false);
             return UpdateTimeVo.create();
         } finally {
             concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();