|
@@ -5,7 +5,9 @@ import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.boot.core.rateLimit.annotation.RateLimit;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.CourseWeightDetailDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.CourseWeightDto;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.report.CourseTargetWebDto;
|
|
|
import com.qmth.distributed.print.business.bean.excel.PaperStructDto;
|
|
|
import com.qmth.distributed.print.business.bean.params.report.PaperStructParams;
|
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
@@ -40,10 +42,7 @@ import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -163,7 +162,7 @@ public class TCPaperStructController {
|
|
|
}
|
|
|
}
|
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = paperStructParams.getPaperStruct();
|
|
|
- Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(s->s.getScore().doubleValue()).sum();
|
|
|
+ Double score = paperStructDimensionResultList.stream().filter(s -> Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())).mapToDouble(s -> s.getScore().doubleValue()).sum();
|
|
|
Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
|
paperStructDimensionResultList.stream().filter(s -> {
|
|
|
if (Objects.equals(s.getCourseTargetName(), c.getCourseTargetName())) {
|
|
@@ -211,7 +210,7 @@ public class TCPaperStructController {
|
|
|
}
|
|
|
paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
|
|
|
for (MarkQuestion markQuestion : markQuestionList) {
|
|
|
- paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(),examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
|
|
|
+ paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
|
|
|
}
|
|
|
} else {
|
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId());
|
|
@@ -221,7 +220,37 @@ public class TCPaperStructController {
|
|
|
} else {
|
|
|
paperStructDimensionResultList = this.getPaperStructDimensionResult(tcPaperStruct, paperStructDimensionResultList);
|
|
|
}
|
|
|
- paperStructDimensionResultList.stream().peek(s -> s.setPaperNumber(tcPaperStruct.getPaperNumber())).collect(Collectors.toList());
|
|
|
+ List<CourseWeightDto> courseWeightDtoList = obeCourseWeightResult.getSubmitForm();
|
|
|
+ if (!CollectionUtils.isEmpty(courseWeightDtoList)) {
|
|
|
+ List<PaperStructDimensionResult> paperStructDimensionResultNewList = new ArrayList<>(paperStructDimensionResultList.size());
|
|
|
+ Map<Long, String> courseWeightFinalScoreMap = new LinkedHashMap<>();
|
|
|
+ for (CourseWeightDto courseWeightDto : courseWeightDtoList) {
|
|
|
+ List<CourseWeightDetailDto> courseWeightDetailDtoList = courseWeightDto.getEvaluationList();
|
|
|
+ courseWeightDetailDtoList.stream().filter(s -> {
|
|
|
+ if (Objects.equals(s.getEvaluationName(), SystemConstant.FINAL_SCORE_STR) && Objects.nonNull(s.getEnable()) && s.getEnable()) {
|
|
|
+ courseWeightFinalScoreMap.put(courseWeightDto.getCourseTargetId(), courseWeightDto.getCourseTargetName());
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ paperStructDimensionResultList.stream().peek(s -> {
|
|
|
+ s.setPaperNumber(tcPaperStruct.getPaperNumber());
|
|
|
+ List<CourseTargetWebDto> courseTargetWebDtoList = s.getTargetList();
|
|
|
+ if (!CollectionUtils.isEmpty(courseTargetWebDtoList)) {
|
|
|
+ courseTargetWebDtoList.stream().peek(m -> {
|
|
|
+ if (!courseWeightFinalScoreMap.containsKey(m.getTargetId())) {
|
|
|
+ paperStructDimensionResultNewList.add(s);
|
|
|
+ }
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(paperStructDimensionResultNewList)) {
|
|
|
+ paperStructDimensionResultNewList.stream().peek(s -> s.getTargetList().clear()).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return ResultUtil.ok(paperStructDimensionResultList);
|
|
|
}
|
|
@@ -243,7 +272,7 @@ public class TCPaperStructController {
|
|
|
}.getType());
|
|
|
paperStructDimensionResultList = new ArrayList<>(paperStructDtoList.size());
|
|
|
for (PaperStructDto paperStructDto : paperStructDtoList) {
|
|
|
- paperStructDimensionResultList.add(new PaperStructDimensionResult(paperStructDto.getMainNumber(), paperStructDto.getSubNumber(),tcPaperStruct.getExamId(), tcPaperStruct.getPaperNumber(), new BigDecimal(paperStructDto.getScore())));
|
|
|
+ paperStructDimensionResultList.add(new PaperStructDimensionResult(paperStructDto.getMainNumber(), paperStructDto.getSubNumber(), tcPaperStruct.getExamId(), tcPaperStruct.getPaperNumber(), new BigDecimal(paperStructDto.getScore())));
|
|
|
}
|
|
|
}
|
|
|
return paperStructDimensionResultList;
|