|
@@ -483,7 +483,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public BatchFinishVo batchFinish(Long id) {
|
|
|
+ public BatchFinishVo batchFinish(Long id, Integer scanCount,Integer assignedCount) {
|
|
|
BatchEntity entity = this.getById(id);
|
|
|
if (entity == null) {
|
|
|
throw new ParameterException("批次不存在");
|
|
@@ -533,9 +533,14 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
entity.setCheckStatus(CheckStatus.WAITING);
|
|
|
}
|
|
|
entity.setStatus(BatchStatus.FINISH);
|
|
|
+ if(scanCount!=null && assignedCount!=null){
|
|
|
+ entity.setAssignedCount(assignedCount);
|
|
|
+ entity.setScanCount(scanCount);
|
|
|
+ }else{
|
|
|
+ updateAssignedCount(entity.getId());
|
|
|
+ updateScanCount(entity.getId());
|
|
|
+ }
|
|
|
this.saveOrUpdate(entity);
|
|
|
- updateAssignedCount(entity.getId());
|
|
|
- updateScanCount(entity.getId());
|
|
|
BatchFinishVo vo = new BatchFinishVo();
|
|
|
vo.setStatus(entity.getStatus());
|
|
|
vo.setUpdateTime(System.currentTimeMillis());
|
|
@@ -997,6 +1002,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
|
|
|
Map<String,AnswerPackageStudent> answerPackageStudentMap = new HashMap<>();
|
|
|
Map<String,StudentEntity> studentMap = new HashMap<>();
|
|
|
+ Integer assignedCount = 0;
|
|
|
for (AnswerPackageStudent packageStudent:domain.getStudents()) {
|
|
|
String examNumber = packageStudent.getExamNumber();
|
|
|
StudentEntity student = studentService.findByExamAndSubjectCodeAndExamNumber(batch.getExamId(),
|
|
@@ -1022,7 +1028,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
for (String examNumber:studentMap.keySet()) {
|
|
|
AnswerPackageStudent answerPackageStudent = answerPackageStudentMap.get(examNumber);
|
|
|
StudentEntity student = studentMap.get(examNumber);
|
|
|
-// boolean studentAssigned = false;
|
|
|
+ boolean studentAssigned = false;
|
|
|
List<StudentPaperEntity> studentPaperList = new ArrayList<>();
|
|
|
for (AnswerPaper answerPaper : answerPackageStudent.getPapers()) {
|
|
|
// 验证page数量
|
|
@@ -1044,7 +1050,7 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
batchPaperService.update(batch, paper, student.getId(), paperNumber, false);
|
|
|
// 创建student与paper的关联关系
|
|
|
studentPaperList.add(new StudentPaperEntity(student.getId(), paperNumber, paper.getId()));
|
|
|
-// studentAssigned = studentAssigned || paper.getAssigned();
|
|
|
+ studentAssigned = studentAssigned || paper.getAssigned();
|
|
|
// 更新批次统计数量,改到finish的时候更新
|
|
|
// updateAssignedCount(batch.getId());
|
|
|
// updateScanCount(batch.getId());
|
|
@@ -1079,14 +1085,17 @@ public class BatchServiceImpl extends ServiceImpl<BatchDao, BatchEntity> impleme
|
|
|
}
|
|
|
// }
|
|
|
}
|
|
|
+ if(studentAssigned){
|
|
|
+ assignedCount++;
|
|
|
+ }
|
|
|
}
|
|
|
for (OmrGroupEntity g : gs) {
|
|
|
- concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).readLock().lock();
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).writeLock().lock();
|
|
|
omrGroupService.updateTotalCount(g.getId());
|
|
|
- concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).readLock().unlock();
|
|
|
+ concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).writeLock().unlock();
|
|
|
}
|
|
|
|
|
|
- this.batchFinish(batch.getId());
|
|
|
+ this.batchFinish(batch.getId(),studentMap.size(),assignedCount);
|
|
|
|
|
|
LambdaUpdateWrapper<BatchEntity> lw = new LambdaUpdateWrapper<>();
|
|
|
lw.set(BatchEntity::getStatus, BatchStatus.DISCARD);
|