浏览代码

测试报告

wangliang 1 年之前
父节点
当前提交
56e218f99c

+ 0 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/FinalScoreWordDto.java

@@ -50,14 +50,6 @@ public class FinalScoreWordDto implements Serializable {
 
 
     }
     }
 
 
-    public FinalScoreWordDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto) {
-        this.targetId = targetId;
-        this.evaluationId = courseWeightDetailDto.getEvaluationId();
-        this.evaluation = courseWeightDetailDto.getEvaluationName();
-        this.finalScoreSumWeight = courseWeightDetailDto.getWeight();
-        this.finalScoreTargetSumScore = courseWeightDetailDto.getTargetScore();
-    }
-
     public FinalScoreWordDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto, BigDecimal finalScoreSumWeight) {
     public FinalScoreWordDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto, BigDecimal finalScoreSumWeight) {
         this.targetId = targetId;
         this.targetId = targetId;
         this.evaluationId = courseWeightDetailDto.getEvaluationId();
         this.evaluationId = courseWeightDetailDto.getEvaluationId();

+ 12 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportEvaluationDto.java

@@ -43,26 +43,29 @@ public class ReportEvaluationDto implements Serializable, Comparable<ReportEvalu
     @ApiModelProperty(value = "换算平均分")
     @ApiModelProperty(value = "换算平均分")
     private Double targetAvgScore;
     private Double targetAvgScore;
 
 
+    @ApiModelProperty(value = "卷面分")
+    private Double score;
+
     public ReportEvaluationDto() {
     public ReportEvaluationDto() {
 
 
     }
     }
 
 
-    public ReportEvaluationDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto) {
+    public ReportEvaluationDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto, BigDecimal targetWeight, Double score) {
         this.targetId = targetId;
         this.targetId = targetId;
         this.evaluationId = courseWeightDetailDto.getEvaluationId();
         this.evaluationId = courseWeightDetailDto.getEvaluationId();
         this.evaluation = courseWeightDetailDto.getEvaluationName();
         this.evaluation = courseWeightDetailDto.getEvaluationName();
         this.evaluationDesc = courseWeightDetailDto.getEvaluationDesc();
         this.evaluationDesc = courseWeightDetailDto.getEvaluationDesc();
-        this.targetWeight = courseWeightDetailDto.getWeight();
+        this.targetWeight = targetWeight;
         this.targetScore = courseWeightDetailDto.getTargetScore();
         this.targetScore = courseWeightDetailDto.getTargetScore();
+        this.score = score;
     }
     }
 
 
-    public ReportEvaluationDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto, BigDecimal targetWeight) {
-        this.targetId = targetId;
-        this.evaluationId = courseWeightDetailDto.getEvaluationId();
-        this.evaluation = courseWeightDetailDto.getEvaluationName();
-        this.evaluationDesc = courseWeightDetailDto.getEvaluationDesc();
-        this.targetWeight = targetWeight;
-        this.targetScore = courseWeightDetailDto.getTargetScore();
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
     }
     }
 
 
     public Double getTargetAvgScore() {
     public Double getTargetAvgScore() {

+ 5 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FinalScoreResult.java

@@ -5,6 +5,8 @@ import com.qmth.distributed.print.business.bean.dto.report.ReportExamStudentUsua
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 
 /**
 /**
  * @Description: 期末成绩dto
  * @Description: 期末成绩dto
@@ -25,7 +27,7 @@ public class FinalScoreResult implements Serializable {
     private String administrativeClass;
     private String administrativeClass;
 
 
     @ApiModelProperty(value = "期末考试分数")
     @ApiModelProperty(value = "期末考试分数")
-    private Double finalScore;
+    private Map<Long, Double> finalScore = new LinkedHashMap<>();
 
 
     @ApiModelProperty(value = "期末考试分数明细")
     @ApiModelProperty(value = "期末考试分数明细")
     private String finalScoreDetail;
     private String finalScoreDetail;
@@ -87,11 +89,11 @@ public class FinalScoreResult implements Serializable {
         this.studentCode = studentCode;
         this.studentCode = studentCode;
     }
     }
 
 
-    public Double getFinalScore() {
+    public Map<Long, Double> getFinalScore() {
         return finalScore;
         return finalScore;
     }
     }
 
 
-    public void setFinalScore(Double finalScore) {
+    public void setFinalScore(Map<Long, Double> finalScore) {
         this.finalScore = finalScore;
         this.finalScore = finalScore;
     }
     }
 
 

+ 1 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCFinalScoreServiceImpl.java

@@ -91,7 +91,6 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
         Map<String, String> messageMap = new LinkedHashMap<>();
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
         try {
             MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, paperNumber);
             MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, paperNumber);
-
             Double totalScore = markPaper.getTotalScore();
             Double totalScore = markPaper.getTotalScore();
             Objects.requireNonNull(totalScore, "试卷满分为空");
             Objects.requireNonNull(totalScore, "试卷满分为空");
 
 
@@ -148,7 +147,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
                         }
                         }
                         if (jsonArray.size() > 0) {
                         if (jsonArray.size() > 0) {
                             if (score.doubleValue() > totalScore.doubleValue()) {
                             if (score.doubleValue() > totalScore.doubleValue()) {
-                                errorData.add("excel第" + (i + 1) + "行[考生总分大于试卷总分]").add("\r\n");
+                                errorData.add("excel第" + (i + 1) + "行[总分大于试卷总分]").add("\r\n");
                                 error = true;
                                 error = true;
                             } else {
                             } else {
                                 score = score.setScale(2, BigDecimal.ROUND_HALF_UP);
                                 score = score.setScale(2, BigDecimal.ROUND_HALF_UP);

+ 12 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCUsualScoreServiceImpl.java

@@ -77,6 +77,9 @@ public class TCUsualScoreServiceImpl extends ServiceImpl<TCUsualScoreMapper, TCU
         Map<String, String> messageMap = new LinkedHashMap<>();
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
         try {
             MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, paperNumber);
             MarkPaper markPaper = printCommonService.scoreImportExcelVaild(file, examId, paperNumber);
+            Double totalScore = markPaper.getTotalScore();
+            Objects.requireNonNull(totalScore, "试卷满分为空");
+
             StringJoiner errorData = new StringJoiner("");
             StringJoiner errorData = new StringJoiner("");
             StringJoiner successData = new StringJoiner("");
             StringJoiner successData = new StringJoiner("");
 
 
@@ -115,9 +118,15 @@ public class TCUsualScoreServiceImpl extends ServiceImpl<TCUsualScoreMapper, TCU
                                 } else if (Objects.equals(columnNames[j].trim(), "姓名")) {
                                 } else if (Objects.equals(columnNames[j].trim(), "姓名")) {
                                     tcUsualScore.setName(strs[j]);
                                     tcUsualScore.setName(strs[j]);
                                 } else {
                                 } else {
-                                    jsonObject.put("name", columnNames[j]);
-                                    jsonObject.put("score", strs[j]);
-                                    jsonArray.add(jsonObject);
+                                    Double score = Double.parseDouble(strs[j]);
+                                    if (score.doubleValue() > totalScore.doubleValue()) {
+                                        errorData.add("excel第" + (i + 1) + "行[" + columnNames[j] + "总分大于试卷总分]").add("\r\n");
+                                        error = true;
+                                    } else {
+                                        jsonObject.put("name", columnNames[j]);
+                                        jsonObject.put("score", strs[j]);
+                                        jsonArray.add(jsonObject);
+                                    }
                                 }
                                 }
                             }
                             }
                         }
                         }

+ 18 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRBasicInfoServiceImpl.java

@@ -167,12 +167,12 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                         if (courseWeightDetailDto.getEnable() && Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
                         if (courseWeightDetailDto.getEnable() && Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
                             FinalScoreWordDto finalScoreWordDto = new FinalScoreWordDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, courseWeightResult.getDefaultRate());
                             FinalScoreWordDto finalScoreWordDto = new FinalScoreWordDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, courseWeightResult.getDefaultRate());
                             courseTargetWordDto.setFinalScoreDto(finalScoreWordDto);
                             courseTargetWordDto.setFinalScoreDto(finalScoreWordDto);
-                            ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, courseWeightResult.getDefaultRate());
+                            ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, courseWeightResult.getDefaultRate(), 0.0d);
                             reportEvaluationDtoList.add(reportEvaluationDto);
                             reportEvaluationDtoList.add(reportEvaluationDto);
                         }//非期末考试
                         }//非期末考试
                         else if (courseWeightDetailDto.getEnable() && !Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
                         else if (courseWeightDetailDto.getEnable() && !Objects.equals(courseWeightDetailDto.getEvaluationName(), SystemConstant.FINAL_SCORE_STR)) {
                             BigDecimal usualScoreRealityWeight = usualScoreWordDto.getUsualScoreTargetSumWeight().divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP).multiply(courseWeightDetailDto.getWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
                             BigDecimal usualScoreRealityWeight = usualScoreWordDto.getUsualScoreTargetSumWeight().divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP).multiply(courseWeightDetailDto.getWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
-                            ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, usualScoreRealityWeight);
+                            ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(courseWeightDto.getCourseTargetId(), courseWeightDetailDto, usualScoreRealityWeight, 0.0d);
                             usualScoreTargetSumScore = usualScoreTargetSumScore.add(reportEvaluationDto.getTargetScore());
                             usualScoreTargetSumScore = usualScoreTargetSumScore.add(reportEvaluationDto.getTargetScore());
                             usualScoreDetailList.add(reportEvaluationDto);
                             usualScoreDetailList.add(reportEvaluationDto);
                             reportEvaluationDtoList.add(reportEvaluationDto);
                             reportEvaluationDtoList.add(reportEvaluationDto);
@@ -197,7 +197,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                 JSONArray finalScoreDetailJsonArray = JSONArray.parseArray(finalScoreResult.getFinalScoreDetail());
                 JSONArray finalScoreDetailJsonArray = JSONArray.parseArray(finalScoreResult.getFinalScoreDetail());
                 for (int i = 0; i < finalScoreDetailJsonArray.size(); i++) {
                 for (int i = 0; i < finalScoreDetailJsonArray.size(); i++) {
                     JSONObject jsonObject = finalScoreDetailJsonArray.getJSONObject(i);
                     JSONObject jsonObject = finalScoreDetailJsonArray.getJSONObject(i);
-                    //卷面分
                     Double score = Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d;
                     Double score = Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d;
                     PaperStructResult paperStructResult = paperStructResultMap.get(jsonObject.get("name").toString());
                     PaperStructResult paperStructResult = paperStructResultMap.get(jsonObject.get("name").toString());
                     if (Objects.nonNull(paperStructResult)) {
                     if (Objects.nonNull(paperStructResult)) {
@@ -209,7 +208,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                                 //考生知识点
                                 //考生知识点
                                 this.calculateFinalScoreByExamStudent(finalScoreExamStudentDimensionMap,
                                 this.calculateFinalScoreByExamStudent(finalScoreExamStudentDimensionMap,
                                         finalScoreResult, courseTargetDto, dimensionDto, score);
                                         finalScoreResult, courseTargetDto, dimensionDto, score);
-
                                 //目标-考生知识点去重
                                 //目标-考生知识点去重
                                 if (!targetDimensionMap.containsKey(courseTargetDto.getTargetId())) {
                                 if (!targetDimensionMap.containsKey(courseTargetDto.getTargetId())) {
                                     Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
                                     Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
@@ -227,6 +225,21 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                     }
                     }
                 }
                 }
 
 
+                Map<Long, CourseTargetWordDto> finalTargetWordMap = targetWordMap;
+                targetDimensionMap.forEach((k, v) -> {
+                    List<DimensionDto> dimensionDtoList = new ArrayList<>(v.values());
+                    Collections.sort(dimensionDtoList);
+                    if (finalTargetWordMap.containsKey(k)) {
+                        finalTargetWordMap.get(k).getFinalScoreDto().setDimensionList(dimensionDtoList);
+                    }
+                    Map<Long, Map<Long, DimensionDto>> mapExamStudent1 = finalScoreExamStudentDimensionMap.get(finalScoreResult.getStudentCode());
+                    Map<Long, DimensionDto> mapExamStudent2 = mapExamStudent1.get(k);
+                    List<DimensionDto> list = new ArrayList<>(mapExamStudent2.values());
+                    Double score = list.stream().mapToDouble(DimensionDto::getDimensionScore).sum();
+                    Map<Long, Double> map = finalScoreResult.getFinalScore();
+                    map.put(k, score);
+                });
+
                 //解析平时作业分数图
                 //解析平时作业分数图
                 ReportExamStudentUsualScoreDto reportExamStudentUsualScoreDto = this.calculateUsualScoreByExamStudent(finalScoreResult, usualScoreMap, targetWordMap);
                 ReportExamStudentUsualScoreDto reportExamStudentUsualScoreDto = this.calculateUsualScoreByExamStudent(finalScoreResult, usualScoreMap, targetWordMap);
                 finalScoreResult.setUsualScoreDto(reportExamStudentUsualScoreDto);
                 finalScoreResult.setUsualScoreDto(reportExamStudentUsualScoreDto);
@@ -234,15 +247,6 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
             }
             }
         }
         }
 
 
-        Map<Long, CourseTargetWordDto> finalTargetMap = targetWordMap;
-        targetDimensionMap.forEach((k, v) -> {
-            List<DimensionDto> dimensionDtoList = new ArrayList<>(v.values());
-            Collections.sort(dimensionDtoList);
-            if (finalTargetMap.containsKey(k)) {
-                finalTargetMap.get(k).getFinalScoreDto().setDimensionList(dimensionDtoList);
-            }
-        });
-
         paramsMap.put("finalScoreResultList", finalScoreResultList);
         paramsMap.put("finalScoreResultList", finalScoreResultList);
         paramsMap.put("usualScoreMap", usualScoreMap);
         paramsMap.put("usualScoreMap", usualScoreMap);
         paramsMap.put("finalScoreExamStudentDimensionMap", finalScoreExamStudentDimensionMap);
         paramsMap.put("finalScoreExamStudentDimensionMap", finalScoreExamStudentDimensionMap);
@@ -733,7 +737,7 @@ public class TRBasicInfoServiceImpl extends ServiceImpl<TRBasicInfoMapper, TRBas
                                         examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentTargetDto.getTargetMatrixAvgScore())).create());
                                         examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentTargetDto.getTargetMatrixAvgScore())).create());
                                         break;
                                         break;
                                     default:
                                     default:
-                                        examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getTargetMatrixSumScore())).create());
+                                        examStudent_cells.add(Cells.of(SystemConstant.df.format(reportExamStudentFinalScoreDto.getScore())).create());
                                         break;
                                         break;
                                 }
                                 }
                             }
                             }

+ 13 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TRExamStudentServiceImpl.java

@@ -9,6 +9,7 @@ import com.qmth.distributed.print.business.entity.TRExamStudent;
 import com.qmth.distributed.print.business.mapper.TRExamStudentMapper;
 import com.qmth.distributed.print.business.mapper.TRExamStudentMapper;
 import com.qmth.distributed.print.business.service.TRBasicInfoService;
 import com.qmth.distributed.print.business.service.TRBasicInfoService;
 import com.qmth.distributed.print.business.service.TRExamStudentService;
 import com.qmth.distributed.print.business.service.TRExamStudentService;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -68,7 +69,7 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
                     if (targetWordMap.containsKey(k)) {
                     if (targetWordMap.containsKey(k)) {
                         List<ReportExamStudentUsualScoreObjDto> scoreObjDtoList = reportExamStudentUsualScoreSumDto.getScoreMap().get(k);
                         List<ReportExamStudentUsualScoreObjDto> scoreObjDtoList = reportExamStudentUsualScoreSumDto.getScoreMap().get(k);
                         CourseTargetWordDto courseTargetWordDto = targetWordMap.get(k);
                         CourseTargetWordDto courseTargetWordDto = targetWordMap.get(k);
-                        ReportExamStudentFinalScoreDto reportExamStudentFinalScoreDto = new ReportExamStudentFinalScoreDto(courseTargetWordDto.getFinalScoreDto(), dimensionDtoList, finalScoreResult.getFinalScore());
+                        ReportExamStudentFinalScoreDto reportExamStudentFinalScoreDto = new ReportExamStudentFinalScoreDto(courseTargetWordDto.getFinalScoreDto(), dimensionDtoList, finalScoreResult.getFinalScore().get(k));
                         ReportExamStudentUsualScoreDto reportExamStudentUsualScoreDto = new ReportExamStudentUsualScoreDto(courseTargetWordDto.getUsualScoreDto().getUsualScoreTargetSumWeight(), scoreObjDtoList);
                         ReportExamStudentUsualScoreDto reportExamStudentUsualScoreDto = new ReportExamStudentUsualScoreDto(courseTargetWordDto.getUsualScoreDto().getUsualScoreTargetSumWeight(), scoreObjDtoList);
 
 
                         BigDecimal dimensionMatrixSumScore = new BigDecimal(0);
                         BigDecimal dimensionMatrixSumScore = new BigDecimal(0);
@@ -79,12 +80,16 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
                                 dimensionDto.setDimensionMatrixScore(matrixScore);
                                 dimensionDto.setDimensionMatrixScore(matrixScore);
                                 dimensionMatrixSumScore = dimensionMatrixSumScore.add(new BigDecimal(matrixScore)).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 dimensionMatrixSumScore = dimensionMatrixSumScore.add(new BigDecimal(matrixScore)).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 reportExamStudentDto.setScore(reportExamStudentDto.getScore() + matrixScore);
                                 reportExamStudentDto.setScore(reportExamStudentDto.getScore() + matrixScore);
+                            }
+                            //如果换算出来的知识点总分超过了期末考试目标分,则
+                            if (courseTargetWordDto.getFinalScoreDto().getFinalScoreTargetSumScore().compareTo(dimensionMatrixSumScore) == -1) {
+
                             }
                             }
                             //平时作业总和+累加
                             //平时作业总和+累加
                             Double usualMatrixSumScore = scoreObjDtoList.stream().mapToDouble(ReportExamStudentUsualScoreObjDto::getMatrixScore).sum();
                             Double usualMatrixSumScore = scoreObjDtoList.stream().mapToDouble(ReportExamStudentUsualScoreObjDto::getMatrixScore).sum();
                             reportExamStudentDto.setScore(reportExamStudentDto.getScore() + usualMatrixSumScore);
                             reportExamStudentDto.setScore(reportExamStudentDto.getScore() + usualMatrixSumScore);
                             reportExamStudentFinalScoreDto.setTargetMatrixSumScore(dimensionMatrixSumScore.doubleValue());
                             reportExamStudentFinalScoreDto.setTargetMatrixSumScore(dimensionMatrixSumScore.doubleValue());
-                            ReportExamStudentFinalScoreDto reportExamStudentFinalScoreTempDto = new ReportExamStudentFinalScoreDto(courseTargetWordDto.getFinalScoreDto(), dimensionDtoList.stream().map(DimensionDto::new).collect(Collectors.toList()), dimensionMatrixSumScore.doubleValue(), finalScoreResult.getFinalScore());
+                            ReportExamStudentFinalScoreDto reportExamStudentFinalScoreTempDto = new ReportExamStudentFinalScoreDto(courseTargetWordDto.getFinalScoreDto(), dimensionDtoList.stream().map(DimensionDto::new).collect(Collectors.toList()), dimensionMatrixSumScore.doubleValue(), finalScoreResult.getFinalScore().get(k));
                             ReportExamStudentTargetDto reportExamStudentTargetDto = new ReportExamStudentTargetDto(courseTargetWordDto, reportExamStudentFinalScoreTempDto, new ReportExamStudentUsualScoreDto(courseTargetWordDto.getUsualScoreDto().getUsualScoreTargetSumWeight(), scoreObjDtoList.stream().map(ReportExamStudentUsualScoreObjDto::new).collect(Collectors.toList())));
                             ReportExamStudentTargetDto reportExamStudentTargetDto = new ReportExamStudentTargetDto(courseTargetWordDto, reportExamStudentFinalScoreTempDto, new ReportExamStudentUsualScoreDto(courseTargetWordDto.getUsualScoreDto().getUsualScoreTargetSumWeight(), scoreObjDtoList.stream().map(ReportExamStudentUsualScoreObjDto::new).collect(Collectors.toList())));
                             reportExamStudentTargetDtoMap.put(k, reportExamStudentTargetDto);
                             reportExamStudentTargetDtoMap.put(k, reportExamStudentTargetDto);
                         } else {
                         } else {
@@ -177,7 +182,12 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
         List<ReportExamStudentTargetDto> targetDtoList = new ArrayList<>();
         List<ReportExamStudentTargetDto> targetDtoList = new ArrayList<>();
         reportExamStudentTargetDtoMap.forEach((k, v) -> {
         reportExamStudentTargetDtoMap.forEach((k, v) -> {
             ReportExamStudentFinalScoreDto reportExamStudentFinalScoreDto = v.getFinalScore();//课程目标考核要素的平均分
             ReportExamStudentFinalScoreDto reportExamStudentFinalScoreDto = v.getFinalScore();//课程目标考核要素的平均分
-            reportExamStudentFinalScoreDto.setMatrixAvgScore(new BigDecimal(reportExamStudentFinalScoreDto.getTargetMatrixSumScore()).divide(size, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
+            BigDecimal matrixAvgScore = new BigDecimal(reportExamStudentFinalScoreDto.getTargetMatrixSumScore()).divide(size, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
+            //如果换算出来的知识点总分超过了期末考试目标分,则
+            if (reportExamStudentFinalScoreDto.getTargetScore().compareTo(matrixAvgScore) == -1) {
+                throw ExceptionResultEnum.ERROR.exception("[" + v.getTargetName() + "]知识点总平均分超过了期末考试目标分,请重新设置知识点");
+            }
+            reportExamStudentFinalScoreDto.setMatrixAvgScore(matrixAvgScore.doubleValue());
 
 
             List<DimensionDto> dimensionDtoList = reportExamStudentFinalScoreDto.getDimensionList();
             List<DimensionDto> dimensionDtoList = reportExamStudentFinalScoreDto.getDimensionList();
             for (DimensionDto d : dimensionDtoList) {
             for (DimensionDto d : dimensionDtoList) {

+ 0 - 1
distributed-print-business/src/main/resources/mapper/TCFinalScoreMapper.xml

@@ -59,7 +59,6 @@
         select
         select
             tcfs.name,
             tcfs.name,
             tcfs.student_code as studentCode,
             tcfs.student_code as studentCode,
-            tcfs.score as finalScore,
             tcfs.score_detail as finalScoreDetail,
             tcfs.score_detail as finalScoreDetail,
             tcus.score as usualScore,
             tcus.score as usualScore,
             es.clazz_name as administrativeClass
             es.clazz_name as administrativeClass