瀏覽代碼

美术阅卷11月新增需求-修复打分阶段分档配置BUG

wangliang 5 年之前
父節點
當前提交
f8314ab753

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

@@ -198,5 +198,5 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
     MarkTask findByPaperIdAndMarkerId(Long paperId, Long markId);
 
     @Query("select max(mt.batchNo) from MarkTask mt where mt.questionId = ?1")
-    long findByQuestionId(Long questionId);
+    Long findByQuestionId(Long questionId);
 }

+ 1 - 1
stmms-ms-core/src/main/java/cn/com/qmth/stmms/ms/core/repository/PaperRepo.java

@@ -267,7 +267,7 @@ public interface PaperRepo extends JpaRepository<Paper, Long>, JpaSpecificationE
     int countByWorkIdAndSubjectAndLevelNotNullAndIsMissingFalseAndActiveTrueAndTest(Long workId, Subject subject, int test);
 
     @Query("select max(p.batchNo) from Paper p where p.questionId = ?1")
-    long findByQuestionId(Long questionId);
+    Long findByQuestionId(Long questionId);
 
 //    List<Paper> findByWorkIdAndSubjectAndInspectRange(Long workId, Subject subject, Long inspectRange);
 }

+ 6 - 4
stmms-ms-marking/src/main/java/cn/com/qmth/stmms/ms/marking/api/MarkTaskApi.java

@@ -86,16 +86,18 @@ public class MarkTaskApi {
                 predicates.add(builder.isNull(root.get("result")));
             } else if (stage == MarkStage.LEVEL) {
                 //查询
-                long batchNo = paperRepo.findByQuestionId(questionId);
+                Long batchNo = paperRepo.findByQuestionId(questionId);
                 predicates.add(builder.equal(root.get("result"), level));
                 if (!Objects.isNull(batchNo)) {
                     predicates.add(builder.equal(root.get("paper").get("batchNo"), batchNo));
                 }
             } else if (stage == MarkStage.SCORE) {
                 //查询
-                long batchNo = markTaskRepo.findByQuestionId(questionId);
-                if (!Objects.isNull(batchNo)) {
-                    predicates.add(builder.equal(root.get("batchNo"), batchNo));
+                if (!scoreConfig.isEnable()) {
+                    Long batchNo = markTaskRepo.findByQuestionId(questionId);
+                    if (!Objects.isNull(batchNo)) {
+                        predicates.add(builder.equal(root.get("batchNo"), batchNo));
+                    }
                 }
                 predicates.add(builder.isNotNull(root.get("result")));
             }

+ 1 - 1
stmms-ms-marking/src/main/java/cn/com/qmth/stmms/ms/marking/api/PaperApi.java

@@ -167,7 +167,7 @@ public class PaperApi {
                             @RequestParam(required = false) Boolean reject,
                             Pageable pageable) {
         //查询最大批次号
-//        long batchNo = paperRepo.findByQuestionId(questionId);
+//        Long batchNo = paperRepo.findByQuestionId(questionId);
         Specification<Paper> specification = (root, query, builder) -> {
             List<Predicate> predicates = new ArrayList<>();
             predicates.add(builder.equal(root.get("questionId"), questionId));