|
@@ -5,14 +5,7 @@ import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
@@ -118,7 +111,6 @@ import cn.com.qmth.scancentral.support.SpringContextHolder;
|
|
|
import cn.com.qmth.scancentral.support.TaskLock;
|
|
|
import cn.com.qmth.scancentral.support.TaskLockUtil;
|
|
|
import cn.com.qmth.scancentral.util.BatchGetDataUtil;
|
|
|
-import cn.com.qmth.scancentral.util.BatchSetDataUtil;
|
|
|
import cn.com.qmth.scancentral.util.MD5Util;
|
|
|
import cn.com.qmth.scancentral.util.PageUtil;
|
|
|
import cn.com.qmth.scancentral.vo.AbsentInfoVo;
|
|
@@ -263,7 +255,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
// 保存绑定关系
|
|
|
studentPaperService.saveOrUpdateBatchByMultiId(studentPaperList);
|
|
|
// 更新考生状态
|
|
|
- updateStudentByPaper(user, id, true,true);
|
|
|
+ updateStudentByPaper(user, id, true, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -274,7 +266,8 @@ 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, boolean updateAssignedCount) {
|
|
|
+ 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("找不到对应的考生");
|
|
@@ -371,7 +364,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
if (CollectionUtils.isNotEmpty(gs)) {
|
|
|
for (OmrGroupEntity g : gs) {
|
|
|
concurrentService.getReadWriteLock(LockType.OMR_GROUP + "-" + g.getId()).readLock().lock();
|
|
|
- omrTaskService.deleteByStudentIdAndGroupId(g.getId(), student.getId(),true);
|
|
|
+ omrTaskService.deleteByStudentIdAndGroupId(g.getId(), student.getId(), true);
|
|
|
// 默认分组重新生成识别对照任务,其他任务不生成
|
|
|
if (g.getFixed()) {
|
|
|
omrTaskService.saveTask(g, student.getId());
|
|
@@ -380,7 +373,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(updateAssignedCount){
|
|
|
+ if (updateAssignedCount) {
|
|
|
this.updateAssignedCheckCount(student.getId(), true);
|
|
|
}
|
|
|
return student;
|
|
@@ -1162,7 +1155,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
}
|
|
|
paperService.savePaperAndPages(paper, pages);
|
|
|
}
|
|
|
- updateStudentByPaper(user, student.getId(), true,false);
|
|
|
+ updateStudentByPaper(user, student.getId(), true, false);
|
|
|
return AnswerRefixVo.create();
|
|
|
} finally {
|
|
|
concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
|
|
@@ -1197,7 +1190,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
}
|
|
|
paperService.savePaperAndPages(paperEntity, pages);
|
|
|
}
|
|
|
- updateStudentByPaper(user, student.getId(), false,false);
|
|
|
+ updateStudentByPaper(user, student.getId(), false, false);
|
|
|
return UpdateTimeVo.create();
|
|
|
} finally {
|
|
|
concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
|
|
@@ -1253,7 +1246,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
throw new ParameterException("未找到page信息结果");
|
|
|
}
|
|
|
paperService.savePaperAndPages(paperEntity, pages);
|
|
|
- updateStudentByPaper(user, student.getId(), false,false);
|
|
|
+ updateStudentByPaper(user, student.getId(), false, false);
|
|
|
return UpdateTimeVo.create();
|
|
|
} finally {
|
|
|
concurrentService.getReadWriteLock(LockType.STUDENT + "-" + student.getId()).writeLock().unlock();
|
|
@@ -1308,8 +1301,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
if (!ExamMode.CET.equals(exam.getMode())) {
|
|
|
throw new StatusException("该考试不是CET");
|
|
|
}
|
|
|
- List<ExportCetVo> dataList = baseMapper
|
|
|
- .listCetMarkingPage(query);
|
|
|
+ List<ExportCetVo> dataList = baseMapper.listCetMarkingPage(query);
|
|
|
if (CollectionUtils.isNotEmpty(dataList)) {
|
|
|
String imageTransferDir = sysProperty.getTransferDir();
|
|
|
Map<String, List<QuestionEntity>> structs = new HashMap<>();
|
|
@@ -1317,27 +1309,31 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
List<Long> ids = dataList.stream().map(e -> e.getId()).collect(Collectors.toList());
|
|
|
List<PaperPageCetVo> totalpages = paperPageService.listByStudentIds(ids);
|
|
|
List<PaperCetVo> totalpapers = paperService.findByStudentIds(ids);
|
|
|
- for (ExportCetVo vo: dataList) {
|
|
|
+ for (ExportCetVo vo : dataList) {
|
|
|
Map<Long, List<PaperPageCetVo>> totalpagesmap = ofPage(totalpages);
|
|
|
Map<Long, List<PaperCetVo>> totalpapersmap = ofPaper(totalpapers);
|
|
|
disposeStudent(vo, paperTypeBarcodeContents, totalpagesmap.get(vo.getId()),
|
|
|
- totalpapersmap.get(vo.getId()), imageTransferDir, structs, cardMap);
|
|
|
- }
|
|
|
-// new BatchSetDataUtil<ExportCetVo>() {
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// protected void setData(List<ExportCetVo> dataList) {
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// }.setDataForBatch(iPage, 200);
|
|
|
+ totalpapersmap.get(vo.getId()), imageTransferDir, structs, cardMap);
|
|
|
+ }
|
|
|
+ // new BatchSetDataUtil<ExportCetVo>() {
|
|
|
+ //
|
|
|
+ // @Override
|
|
|
+ // protected void setData(List<ExportCetVo> dataList) {
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // }.setDataForBatch(iPage, 200);
|
|
|
}
|
|
|
- return iPage;
|
|
|
+ return dataList;
|
|
|
}
|
|
|
|
|
|
private void disposeStudent(ExportCetVo student, List<String> paperTypeBarcodeContents, List<PaperPageCetVo> pages,
|
|
|
List<PaperCetVo> papers, String imageTransferDir, Map<String, List<QuestionEntity>> structs,
|
|
|
Map<Integer, AnswerCardEntity> cardMap) {
|
|
|
+ pages = pages.stream().sorted(Comparator.comparingInt(PaperPageCetVo::getPaperNumber).thenComparingInt(PaperPageCetVo::getPageIndex))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ papers = papers.stream().sorted(Comparator.comparingInt(PaperCetVo::getPaperNumber))
|
|
|
+ .collect(Collectors.toList());
|
|
|
int subjectCodeVal = Integer.valueOf(student.getSubjectCode());
|
|
|
if (subjectCodeVal > 2) {
|
|
|
if (student.getExamStatus().equals(ExamStatus.ABSENT)) {
|
|
@@ -2036,7 +2032,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
Long pageSize, User user) {
|
|
|
IPage<AnswerQueryVo> result = this.baseMapper.getAssignedCheckTaskHistory(new Page<>(pageNumber, pageSize),
|
|
|
examId, subjectCode, user.getId());
|
|
|
- SubjectEntity subject = subjectService.findByExamIdAndCode(examId,subjectCode);
|
|
|
+ SubjectEntity subject = subjectService.findByExamIdAndCode(examId, subjectCode);
|
|
|
for (AnswerQueryVo t : result.getRecords()) {
|
|
|
t.setSubjectName(subject.getName());
|
|
|
t = toTaskVo(t);
|
|
@@ -2058,7 +2054,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
|
|
|
} else {
|
|
|
checkCount = 1;
|
|
|
}
|
|
|
- SubjectEntity subject = subjectService.findByExamIdAndCode(examId,subjectCode);
|
|
|
+ SubjectEntity subject = subjectService.findByExamIdAndCode(examId, subjectCode);
|
|
|
while (task == null) {
|
|
|
IPage<AnswerQueryVo> list = this.findUnCheck(examId, subjectCode, checkCount, retry, 20);
|
|
|
if (list.getRecords().isEmpty()) {
|