|
@@ -132,7 +132,6 @@ public class StageControlService {
|
|
|
private void enterScoreStage(MarkSubject markSubject) {
|
|
|
Long workId = markSubject.getWorkId();
|
|
|
Subject subject = markSubject.getSubject();
|
|
|
- this.isPtFull(workId,subject);
|
|
|
List<MarkUser> markers = markUserRepo.findByWorkIdAndSubjectAndRole(workId, subject, Role.MARKER);
|
|
|
List<MarkUser> levelMarkers = markers.stream().filter(m -> m.getMarkRight() == MarkRight.ALLOW_ALL || m.getMarkRight() == MarkRight.ALLOW_SCORING).collect(Collectors.toList());
|
|
|
if (levelMarkers.size() == 0) {
|
|
@@ -144,6 +143,7 @@ public class StageControlService {
|
|
|
statusMap.put(markSubject.getId(), false);
|
|
|
throw new RuntimeException("没有分档完成");
|
|
|
}
|
|
|
+ this.isPtFull(workId,markSubject);
|
|
|
Sort sort = new Sort("questionId");
|
|
|
List<Paper> papers = paperRepo.findByWorkIdAndSubject(workId, subject, sort);
|
|
|
List<MarkerGroup> markerGroups = markerGroupRepo.findByWorkIdAndSubject(workId, subject);
|
|
@@ -159,24 +159,26 @@ public class StageControlService {
|
|
|
* @param workId
|
|
|
* @param markSubject
|
|
|
*/
|
|
|
- private void isPtFull(Long workId,Subject subject) {
|
|
|
+ private void isPtFull(Long workId,MarkSubject markSubject) {
|
|
|
//控制分档比例
|
|
|
List<Level> levels = levelRepo.findByWorkId(workId);
|
|
|
for (Level targetLevel : levels) {
|
|
|
int pt = targetLevel.getPt();
|
|
|
- int count = markTaskRepo.countByWorkIdAndSubjectAndStageAndResult(workId, subject, MarkStage.LEVEL, targetLevel.getCode());
|
|
|
- int total = markTaskRepo.countByWorkIdAndSubjectAndStage(workId, subject, MarkStage.LEVEL);
|
|
|
+ int count = markTaskRepo.countByWorkIdAndSubjectAndStageAndResult(workId, markSubject.getSubject(), MarkStage.LEVEL, targetLevel.getCode());
|
|
|
+ int total = markTaskRepo.countByWorkIdAndSubjectAndStage(workId, markSubject.getSubject(), MarkStage.LEVEL);
|
|
|
|
|
|
if ((count + 1.0D) / total * 1.0D > pt / 100.D) {
|
|
|
+ statusMap.put(markSubject.getId(), false);
|
|
|
throw new RuntimeException(targetLevel.getCode() + "档已满,占比总阀值已达" + pt + "%。");
|
|
|
}
|
|
|
//判断考点阀值是否已满
|
|
|
int kdpt = targetLevel.getKdpt();
|
|
|
- List<ExamQuestion> examQuestions = examQuestionRepo.findByWorkIdAndSubject(workId, subject);
|
|
|
+ List<ExamQuestion> examQuestions = examQuestionRepo.findByWorkIdAndSubject(workId, markSubject.getSubject());
|
|
|
for (ExamQuestion examQuestion : examQuestions) {
|
|
|
- int kdcount = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(workId, subject, MarkStage.LEVEL, examQuestion.getId(), targetLevel.getCode());
|
|
|
- int kdtotal = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionId(workId, subject, MarkStage.LEVEL, examQuestion.getId());
|
|
|
+ int kdcount = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(workId, markSubject.getSubject(), MarkStage.LEVEL, examQuestion.getId(), targetLevel.getCode());
|
|
|
+ int kdtotal = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionId(workId, markSubject.getSubject(), MarkStage.LEVEL, examQuestion.getId());
|
|
|
if ((kdcount + 1.0D) / kdtotal * 1.0D > kdpt / 100.D) {
|
|
|
+ statusMap.put(markSubject.getId(), false);
|
|
|
throw new RuntimeException(targetLevel.getCode() + "档已满,考点阀值已达" + kdpt + "%。");
|
|
|
}
|
|
|
}
|