|
@@ -122,6 +122,7 @@ public class TRBasicInfoController {
|
|
}.getType());
|
|
}.getType());
|
|
for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
|
|
for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
|
|
+ Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
|
|
trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
|
|
throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]知识点小题总分大于该课程目标分,请重新设置");
|
|
throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]知识点小题总分大于该课程目标分,请重新设置");
|
|
@@ -203,6 +204,7 @@ public class TRBasicInfoController {
|
|
}.getType());
|
|
}.getType());
|
|
for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
|
|
for (CourseWeightDto c : courseWeightResult.getSubmitForm()) {
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
|
|
+ Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
|
|
trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
|
|
throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]知识点小题总分大于该课程目标分,请重新设置");
|
|
throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]知识点小题总分大于该课程目标分,请重新设置");
|
|
@@ -347,7 +349,10 @@ public class TRBasicInfoController {
|
|
StringJoiner stringJoiner = new StringJoiner("");
|
|
StringJoiner stringJoiner = new StringJoiner("");
|
|
for (CourseWeightDto c : courseWeightDtoList) {
|
|
for (CourseWeightDto c : courseWeightDtoList) {
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(PaperStructDimensionResult::getScore).sum();
|
|
- if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
|
|
|
|
+ if (Objects.isNull(c.getTotalWeight())) {
|
|
|
|
+ reportChangeResult.setTargetScoreChange(true);
|
|
|
|
+ stringJoiner.add("[").add(c.getCourseTargetName()).add("]").add("未设置权重").add("\r\n");
|
|
|
|
+ } else if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
reportChangeResult.setTargetScoreChange(true);
|
|
reportChangeResult.setTargetScoreChange(true);
|
|
stringJoiner.add("[").add(c.getCourseTargetName()).add("]").add("知识点小题总分大于该课程目标分,请重新设置").add("\r\n");
|
|
stringJoiner.add("[").add(c.getCourseTargetName()).add("]").add("知识点小题总分大于该课程目标分,请重新设置").add("\r\n");
|
|
}
|
|
}
|