|
@@ -103,6 +103,9 @@ public class MarkAiQuestionParamController {
|
|
|
throw ExceptionResultEnum.ERROR.exception("得分点信息为空");
|
|
|
}
|
|
|
|
|
|
+ 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("最小分不能超过得分点的最小分值");
|
|
@@ -153,9 +156,18 @@ public class MarkAiQuestionParamController {
|
|
|
throw ExceptionResultEnum.ERROR.exception("档次信息为空");
|
|
|
}
|
|
|
|
|
|
- MarkAiQuestionLevel markAiQuestionLevel = markAiQuestionParam.getLevelList().stream().min(Comparator.comparingDouble(MarkAiQuestionLevel::getMinScore)).get();
|
|
|
- if (markAiQuestionParam.getMinScore() > markAiQuestionLevel.getMinScore()) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("最小分不能超过档次的最小分值");
|
|
|
+ if (markAiQuestionParam.getMinScore() == 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("最小分必须大于0");
|
|
|
+ }
|
|
|
+ List<MarkAiQuestionLevel> levelList = markAiQuestionParam.getLevelList();
|
|
|
+ levelList.sort(Comparator.comparing(MarkAiQuestionLevel::getMinScore));
|
|
|
+ Double minRangeScore = 0D;
|
|
|
+ for (MarkAiQuestionLevel aiQuestionLevel : levelList) {
|
|
|
+ if(minRangeScore.doubleValue() - aiQuestionLevel.getMinScore().doubleValue() != 0){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("区间分数必须从0开始,且区间分数段连续");
|
|
|
+ } else {
|
|
|
+ minRangeScore = aiQuestionLevel.getMaxScore();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Double maxScore = markAiQuestionParam.getLevelList().stream().filter(m -> m.getMaxScore() != null).max(Comparator.comparingDouble(MarkAiQuestionLevel::getMaxScore)).get().getMaxScore();
|