|
@@ -1,10 +1,8 @@
|
|
|
package cn.com.qmth.stmms.ms.marking.api;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.commons.web.PageableDTO;
|
|
|
-import cn.com.qmth.stmms.ms.core.domain.ExamQuestion;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.Paper;
|
|
|
-import cn.com.qmth.stmms.ms.core.domain.enums.TrialEnum;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.task.MarkTask;
|
|
|
import cn.com.qmth.stmms.ms.core.repository.ExamQuestionRepo;
|
|
|
import cn.com.qmth.stmms.ms.core.repository.MarkTaskRepo;
|
|
@@ -19,7 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
-import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -200,41 +197,6 @@ public class PaperApi {
|
|
|
};
|
|
|
|
|
|
Page<Paper> papers = paperRepo.findAll(specification, pageable);
|
|
|
-// if (Objects.isNull(papers) || papers.getContent().size() == 0) {
|
|
|
-// if (Objects.nonNull(isSample) && isSample) {
|
|
|
-// ExamQuestion examQuestion = examQuestionRepo.findOne(questionId);
|
|
|
-// if (examQuestion.getTest() == TrialEnum.DEFAULT.getId()) {
|
|
|
-// pageable = new PageRequest(0, 1, Sort.Direction.DESC, "updatedOn");
|
|
|
-// specification = (root, query, builder) -> {
|
|
|
-// List<Predicate> predicates = new ArrayList<>();
|
|
|
-// if (Objects.isNull(level)) {
|
|
|
-// predicates.add(builder.isNull(root.get("level")));
|
|
|
-// } else {
|
|
|
-// predicates.add(builder.equal(root.get("level"), level));
|
|
|
-// }
|
|
|
-// if (arbi != null) {
|
|
|
-// predicates.add(builder.equal(root.get("isArbitrated"), arbi));
|
|
|
-// }
|
|
|
-// if (reject != null) {
|
|
|
-// predicates.add(builder.equal(root.get("isRejected"), reject));
|
|
|
-// }
|
|
|
-// if (isSample != null) {
|
|
|
-// predicates.add(builder.equal(root.get("isSample"), isSample));
|
|
|
-// }
|
|
|
-// if (markedLogic != null) {
|
|
|
-// predicates.add(builder.equal(root.get("markedLogic"), markedLogic));
|
|
|
-// }
|
|
|
-// //空白卷不展示
|
|
|
-// predicates.add(builder.equal(root.get("isMissing"), false));
|
|
|
-// predicates.add(builder.equal(root.get("subject"), examQuestion.getSubject()));
|
|
|
-// predicates.add(builder.equal(root.get("test"), TrialEnum.START_TRIAL.getId()));
|
|
|
-// predicates.add(builder.equal(root.get("areaCode"), examQuestion.getAreaCode()));
|
|
|
-// return builder.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
-// };
|
|
|
-// papers = paperRepo.findAll(specification, pageable);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
List<PaperDTO> paperDTOs = new ArrayList<>();
|
|
|
papers.forEach(p -> {
|
|
|
paperDTOs.add(paperAssembler.toDTO(p));
|
|
@@ -302,6 +264,7 @@ public class PaperApi {
|
|
|
markTaskRepo.findByPaperIdAndStage(paperId, stage).forEach(o -> {
|
|
|
markTaskDTOs.add(markTaskAssembler.toDTO(o));
|
|
|
});
|
|
|
+ Collections.sort(markTaskDTOs, Comparator.comparing(MarkTaskDTO::getMarker));
|
|
|
return markTaskDTOs;
|
|
|
}
|
|
|
|