|
@@ -7,6 +7,8 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
+import java.util.function.Function;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import cn.com.qmth.scancentral.bean.answersave.*;
|
|
|
import cn.com.qmth.scancentral.entity.*;
|
|
@@ -501,7 +503,9 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
return vo;
|
|
|
}
|
|
|
ExamEntity exam = examService.getById(entity.getExamId());
|
|
|
- if (exam.getScanByPackage() != null && exam.getScanByPackage()) {
|
|
|
+ //整袋提交无需校验
|
|
|
+ if (exam.getScanByPackage() != null && exam.getScanByPackage()
|
|
|
+ && scanCount==null && assignedCount==null) {
|
|
|
checkStudentCount(entity);
|
|
|
}
|
|
|
List<BatchPaperEntity> saveList = new ArrayList<BatchPaperEntity>();
|
|
@@ -1001,12 +1005,11 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
}
|
|
|
|
|
|
Map<String,AnswerPackageStudent> answerPackageStudentMap = new HashMap<>();
|
|
|
- Map<String,StudentEntity> studentMap = new HashMap<>();
|
|
|
+ Map<String,StudentEntity> studentMap = ss.stream().collect(Collectors.toMap(e->e.getExamNumber(), Function.identity()));
|
|
|
Integer assignedCount = 0;
|
|
|
for (AnswerPackageStudent packageStudent:domain.getStudents()) {
|
|
|
String examNumber = packageStudent.getExamNumber();
|
|
|
- StudentEntity student = studentService.findByExamAndSubjectCodeAndExamNumber(batch.getExamId(),
|
|
|
- domain.getSubjectCode(), examNumber);
|
|
|
+ StudentEntity student = studentMap.get(examNumber);
|
|
|
if (student == null) {
|
|
|
throw new ParameterException("考生信息未找到");
|
|
|
}
|
|
@@ -1019,9 +1022,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
throw new ParameterException("卡格式张数不一致");
|
|
|
}
|
|
|
answerPackageStudentMap.put(examNumber,packageStudent);
|
|
|
- studentMap.put(examNumber,student);
|
|
|
}
|
|
|
-
|
|
|
List<OmrGroupEntity> gs = omrGroupService.findByExamIdAndSubjectCodeAndFixed(exam.getId(),
|
|
|
domain.getSubjectCode(),true);
|
|
|
|
|
@@ -1060,9 +1061,6 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().lock();
|
|
|
try {
|
|
|
// studentService.updateStudentAndPaper(user, student.getId(), studentPaperList);
|
|
|
- for (StudentPaperEntity studentPaper : studentPaperList) {
|
|
|
- studentPaper.setStudentId(student.getId());
|
|
|
- }
|
|
|
// 清空原有绑定关系
|
|
|
studentPaperService.removeByStudentId(student.getId());
|
|
|
// 保存绑定关系
|
|
@@ -1089,9 +1087,10 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
assignedCount++;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
for (OmrGroupEntity g : gs) {
|
|
|
concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).writeLock().lock();
|
|
|
- omrGroupService.updateTotalCount(g.getId());
|
|
|
+ g.setTotalCount(omrTaskService.countByGroupId(g.getId()));
|
|
|
concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).writeLock().unlock();
|
|
|
}
|
|
|
|