Kaynağa Gözat

分档 等 提示

nikang 6 yıl önce
ebeveyn
işleme
3c82039919

+ 4 - 4
stmms-ms-core/src/main/java/cn/com/qmth/stmms/ms/core/repository/MarkTaskRepo.java

@@ -119,13 +119,13 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
      */
     Long countByPaperId(Long id);
 
-	int countByWorkIdAndSubjectAndStageAndResult(Long workId,MarkSubject markSubject, MarkStage level, String code);
+	int countByWorkIdAndSubjectAndStageAndResult(Long workId,Subject markSubject, MarkStage level, String code);
 
-	int countByWorkIdAndSubjectAndStage(Long workId, MarkSubject markSubject,MarkStage level);
+	int countByWorkIdAndSubjectAndStage(Long workId, Subject markSubject,MarkStage level);
 
-	int countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(Long workId, MarkSubject markSubject, MarkStage level, Long id,String code);
+	int countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(Long workId, Subject subject, MarkStage level, Long id,String code);
 
-	int countByWorkIdAndSubjectAndStageAndQuestionId(Long workId,MarkSubject markSubject, MarkStage level, Long id);
+	int countByWorkIdAndSubjectAndStageAndQuestionId(Long workId,Subject subject, MarkStage level, Long id);
 
 	List<MarkTask> findByWorkIdAndSecretNumber(Long workId, String secretNumber);
 

+ 7 - 7
stmms-ms-marking/src/main/java/cn/com/qmth/stmms/ms/marking/service/StageControlService.java

@@ -131,8 +131,8 @@ public class StageControlService {
      */
     private void enterScoreStage(MarkSubject markSubject) {
         Long workId = markSubject.getWorkId();
-        this.isPtFull(workId,markSubject);
         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) {
@@ -159,23 +159,23 @@ public class StageControlService {
      * @param workId
      * @param markSubject
      */
-	private void isPtFull(Long workId,MarkSubject markSubject) {
+	private void isPtFull(Long workId,Subject subject) {
 		//控制分档比例
         List<Level> levels = levelRepo.findByWorkId(workId);
         for (Level targetLevel : levels) {
         	int pt = targetLevel.getPt();
-        	int count = markTaskRepo.countByWorkIdAndSubjectAndStageAndResult(workId, markSubject, MarkStage.LEVEL, targetLevel.getCode());
-        	int total = markTaskRepo.countByWorkIdAndSubjectAndStage(workId, markSubject, MarkStage.LEVEL);
+        	int count = markTaskRepo.countByWorkIdAndSubjectAndStageAndResult(workId, subject, MarkStage.LEVEL, targetLevel.getCode());
+        	int total = markTaskRepo.countByWorkIdAndSubjectAndStage(workId, subject, MarkStage.LEVEL);
         	
         	if ((count + 1.0D) / total * 1.0D > pt / 100.D) {
         		throw new RuntimeException(targetLevel.getCode() + "档已满,占比总阀值已达" + pt + "%。");
         	}
         	//判断考点阀值是否已满
         	int kdpt = targetLevel.getKdpt();
-        	List<ExamQuestion> examQuestions = examQuestionRepo.findByWorkIdAndSubject(workId, markSubject.getSubject());
+        	List<ExamQuestion> examQuestions = examQuestionRepo.findByWorkIdAndSubject(workId, subject);
         	for (ExamQuestion examQuestion : examQuestions) {
-        		int kdcount = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(workId, markSubject, MarkStage.LEVEL, examQuestion.getId(), targetLevel.getCode());
-        		int kdtotal = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionId(workId, markSubject,  MarkStage.LEVEL, examQuestion.getId());
+        		int kdcount = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(workId, subject, MarkStage.LEVEL, examQuestion.getId(), targetLevel.getCode());
+        		int kdtotal = markTaskRepo.countByWorkIdAndSubjectAndStageAndQuestionId(workId, subject,  MarkStage.LEVEL, examQuestion.getId());
         		if ((kdcount + 1.0D) / kdtotal * 1.0D > kdpt / 100.D) {
         			throw new RuntimeException(targetLevel.getCode() + "档已满,考点阀值已达" + kdpt + "%。");
         		}