Browse Source

3.4.5 update-20250423,bug修改

xiaofei 2 months ago
parent
commit
659a2e1604

+ 3 - 0
distributed-print/install/mysql/upgrade/3.4.5.sql

@@ -125,3 +125,6 @@ ADD COLUMN `image_height` INT NULL DEFAULT 0 COMMENT '图片高度' AFTER `image
 -- 2025-04-17
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('1236', '查看任务轨迹', 'MarkTaskTrack', 'LINK', '917', '11', 'AUTH', '1237', '1', '0', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1237', '查看任务轨迹', '/api/admin/mark/task/track', 'URL', '917', '30', 'AUTH', '1', '1', '1');
+
+UPDATE `sys_privilege` SET `name` = '成绩下载(广药)' WHERE (`id` = '545');
+UPDATE `sys_privilege` SET `name` = '成绩下载(广药)' WHERE (`id` = '546');

+ 18 - 16
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkAiQuestionParamController.java

@@ -107,14 +107,17 @@ public class MarkAiQuestionParamController {
                     if (markAiQuestionParam.getMinScore() == 0) {
                         throw ExceptionResultEnum.ERROR.exception("最小分必须大于0");
                     }
-                    MarkAiQuestionPoint markAiQuestionPoint = markAiQuestionParam.getPointList().stream().min(Comparator.comparingDouble(MarkAiQuestionPoint::getScore)).get();
-                    if (markAiQuestionParam.getMinScore() > markAiQuestionPoint.getScore()) {
-                        throw ExceptionResultEnum.ERROR.exception("最小分不能超过得分点的最小分值");
-                    }
-                    // 各知识点得分总和校验
-                    Double sumScore = markAiQuestionParam.getPointList().stream().filter(m -> m.getScore() != null).collect(Collectors.summingDouble(MarkAiQuestionPoint::getScore));
-                    if (sumScore.doubleValue() - markQuestion.getTotalScore().doubleValue() != 0) {
-                        throw ExceptionResultEnum.ERROR.exception("各知识点得分总和必须等于小题满分[" + markQuestion.getTotalScore() + "]分");
+
+                    if (CollectionUtils.isNotEmpty(markAiQuestionParam.getPointList())) {
+                        MarkAiQuestionPoint markAiQuestionPoint = markAiQuestionParam.getPointList().stream().min(Comparator.comparingDouble(MarkAiQuestionPoint::getScore)).get();
+                        if (markAiQuestionParam.getMinScore() > markAiQuestionPoint.getScore()) {
+                            throw ExceptionResultEnum.ERROR.exception("最小分不能超过得分点的最小分值");
+                        }
+                        // 各知识点得分总和校验
+                        Double sumScore = markAiQuestionParam.getPointList().stream().filter(m -> m.getScore() != null).collect(Collectors.summingDouble(MarkAiQuestionPoint::getScore));
+                        if (sumScore.doubleValue() - markQuestion.getTotalScore().doubleValue() != 0) {
+                            throw ExceptionResultEnum.ERROR.exception("各知识点得分总和必须等于小题满分[" + markQuestion.getTotalScore() + "]分");
+                        }
                     }
                     if (Objects.isNull(markAiQuestionParam.getId())) {//新增
                         markAiQuestionParam.insertInfo(sysUser.getId());
@@ -153,9 +156,6 @@ public class MarkAiQuestionParamController {
                     }
                     break;
                 case LEVEL://按档次
-//                    if (CollectionUtils.isEmpty(markAiQuestionParam.getLevelList())) {
-//                        throw ExceptionResultEnum.ERROR.exception("档次信息为空");
-//                    }
                     // 最小分校验
                     if (markAiQuestionParam.getMinScore() == 0) {
                         throw ExceptionResultEnum.ERROR.exception("最小分必须大于0");
@@ -170,10 +170,12 @@ public class MarkAiQuestionParamController {
                             minRangeScore = aiQuestionLevel.getMaxScore();
                         }
                     }
-                    // 档位最大分校验
-                    Double maxScore = markAiQuestionParam.getLevelList().stream().filter(m -> m.getMaxScore() != null).max(Comparator.comparingDouble(MarkAiQuestionLevel::getMaxScore)).get().getMaxScore();
-                    if (maxScore.doubleValue() - markQuestion.getTotalScore().doubleValue() != 0) {
-                        throw ExceptionResultEnum.ERROR.exception("档位最大分必须等于小题满分[" + markQuestion.getTotalScore() + "]分");
+                    if (CollectionUtils.isNotEmpty(markAiQuestionParam.getLevelList())) {
+                        // 档位最大分校验
+                        Double maxScore = markAiQuestionParam.getLevelList().stream().filter(m -> m.getMaxScore() != null).max(Comparator.comparingDouble(MarkAiQuestionLevel::getMaxScore)).get().getMaxScore();
+                        if (maxScore.doubleValue() - markQuestion.getTotalScore().doubleValue() != 0) {
+                            throw ExceptionResultEnum.ERROR.exception("档位最大分必须等于小题满分[" + markQuestion.getTotalScore() + "]分");
+                        }
                     }
                     if (Objects.isNull(markAiQuestionParam.getId())) {//新增
                         markAiQuestionParam.insertInfo(sysUser.getId());
@@ -221,7 +223,7 @@ public class MarkAiQuestionParamController {
             markQuestionService.updateAiMark(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId());
 
             boolean existMarkAiQuestionPointOrLevel = markAiQuestionParamService.existMarkAiQuestionPointOrLevel(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId());
-            int aiMarkedCount = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndTaskNumberAndAiMarkedAndStatusNotIn(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId(), 1, true, Arrays.asList(MarkTaskStatus.MARKED));
+            int aiMarkedCount = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndTaskNumberAndAiMarkedAndStatusNotIn(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId(), 1, true, Arrays.asList(MarkTaskStatus.WAITING));
             if (!existMarkAiQuestionPointOrLevel && aiMarkedCount > 0) {
                 throw ExceptionResultEnum.ERROR.exception("已开始AI评卷,不能删除" + (AiQuestionParamModeStatus.POINT.equals(markAiQuestionParam.getMode()) ? "标答" : AiQuestionParamModeStatus.LEVEL.equals(markAiQuestionParam.getMode()) ? "档次" : ""));
             }