Browse Source

add: 批次状态为计算中时 分析试卷参数不能更改

caozixuan 3 years ago
parent
commit
a9e06e6e06

+ 6 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradeBatchPaperServiceImpl.java

@@ -175,6 +175,12 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
         if (gradeBatchPaperList.stream().anyMatch(e -> GradeAnalyzePaperStatusEnum.CALCULATING.equals(e.getStatus()))) {
             throw ExceptionResultEnum.ERROR.exception("选择的试卷有正在计算的分析课程");
         }
+        List<Long> batchIdList = gradeBatchPaperList.stream().map(GradeBatchPaper::getBatchId).distinct().collect(Collectors.toList());
+        if (batchIdList.size() > 0){
+            if (gradeBatchService.list(new QueryWrapper<GradeBatch>().lambda().in(GradeBatch::getId, batchIdList)).stream().anyMatch(e -> GradeAnalyzePaperStatusEnum.CALCULATING.equals(e.getStatus()))){
+                throw ExceptionResultEnum.ERROR.exception("所选择的试卷所属的批次正在计算中不能更改");
+            }
+        }
     }
 
     /**