|
@@ -98,14 +98,23 @@ public class MarkTaskApi {
|
|
@RequestParam Long questionId,
|
|
@RequestParam Long questionId,
|
|
@RequestParam(required = false) String areaCode,
|
|
@RequestParam(required = false) String areaCode,
|
|
Pageable pageable) throws Exception {
|
|
Pageable pageable) throws Exception {
|
|
|
|
+ long t0 = System.currentTimeMillis();
|
|
List<MarkTaskDTO> markTaskDTOs = new ArrayList<>();
|
|
List<MarkTaskDTO> markTaskDTOs = new ArrayList<>();
|
|
MarkUser markUser = markUserRepo.findOne(markerId);
|
|
MarkUser markUser = markUserRepo.findOne(markerId);
|
|
Long batchNo = null;
|
|
Long batchNo = null;
|
|
Long scoreBatchNo = null;
|
|
Long scoreBatchNo = null;
|
|
if (stage == MarkStage.LEVEL) {
|
|
if (stage == MarkStage.LEVEL) {
|
|
- batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(workId, markUser.getSubject());
|
|
|
|
|
|
+ List<Object> batchNos = paperRepo.findBatchNoByWorkIdAndSubject(workId, markUser.getSubject().name());
|
|
|
|
+ if(batchNos !=null && batchNos.size() > 0){
|
|
|
|
+ Object object = batchNos.get(0);
|
|
|
|
+ batchNo = Long.valueOf(object.toString());
|
|
|
|
+ }
|
|
} else if (stage == MarkStage.SCORE) {
|
|
} else if (stage == MarkStage.SCORE) {
|
|
- scoreBatchNo = paperRepo.findMaxScoreBatchNoByWorkIdAndSubject(workId, markUser.getSubject());
|
|
|
|
|
|
+ List<Object> batchNos = paperRepo.findScoreBatchNoByWorkIdAndSubject(workId, markUser.getSubject().name());
|
|
|
|
+ if(batchNos !=null && batchNos.size() > 0){
|
|
|
|
+ Object object = batchNos.get(0);
|
|
|
|
+ scoreBatchNo = Long.valueOf(object.toString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Long finalBatchNo = batchNo;
|
|
Long finalBatchNo = batchNo;
|
|
Long finalScoreBatchNo = scoreBatchNo;
|
|
Long finalScoreBatchNo = scoreBatchNo;
|
|
@@ -164,6 +173,7 @@ public class MarkTaskApi {
|
|
Sort sort = new Sort("randomSeq", "randomSeqNew");
|
|
Sort sort = new Sort("randomSeq", "randomSeqNew");
|
|
Pageable pageable1 = new PageRequest(pageable.getPageNumber(), pageable.getPageSize(), sort);
|
|
Pageable pageable1 = new PageRequest(pageable.getPageNumber(), pageable.getPageSize(), sort);
|
|
long t1 = System.currentTimeMillis();
|
|
long t1 = System.currentTimeMillis();
|
|
|
|
+ System.out.println("m0:" + (t1 - t0));
|
|
Page<MarkTask> markTasks = markTaskRepo.findAll(specification, pageable1);
|
|
Page<MarkTask> markTasks = markTaskRepo.findAll(specification, pageable1);
|
|
long t2 = System.currentTimeMillis();
|
|
long t2 = System.currentTimeMillis();
|
|
System.out.println("m1:" + (t2 - t1));
|
|
System.out.println("m1:" + (t2 - t1));
|
|
@@ -183,12 +193,9 @@ public class MarkTaskApi {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- long t3 = System.currentTimeMillis();
|
|
|
|
markTasks.getContent().forEach(m -> {
|
|
markTasks.getContent().forEach(m -> {
|
|
markTaskDTOs.add(markTaskAssembler.toDTO(m));
|
|
markTaskDTOs.add(markTaskAssembler.toDTO(m));
|
|
});
|
|
});
|
|
- long t4 = System.currentTimeMillis();
|
|
|
|
- System.out.println("m2:" + (t4 - t3));
|
|
|
|
if (stage == MarkStage.SCORE && Objects.isNull(level)) {
|
|
if (stage == MarkStage.SCORE && Objects.isNull(level)) {
|
|
// if (Objects.nonNull(scoreConfig) && Objects.nonNull(scoreConfig.getTaskSort()) && Objects.equals("paper", scoreConfig.getTaskSort())) {
|
|
// if (Objects.nonNull(scoreConfig) && Objects.nonNull(scoreConfig.getTaskSort()) && Objects.equals("paper", scoreConfig.getTaskSort())) {
|
|
// Collections.sort(markTaskDTOs, Comparator.comparing(MarkTaskDTO::getPaperId));
|
|
// Collections.sort(markTaskDTOs, Comparator.comparing(MarkTaskDTO::getPaperId));
|