wangliang 1 рік тому
батько
коміт
f1a9a931b7

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

@@ -0,0 +1,82 @@
+package com.qmth.distributed.print.business.bean.dto.report;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Map;
+
+/**
+ * @Description: 课程目标权重dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2024/2/26
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CourseTargetWeightDto implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "课程目标id")
+    private Long targetId;
+
+    @ApiModelProperty(value = "课程目标名称")
+    private String targetName;
+
+    @ApiModelProperty(value = "平时成绩权重")
+    private Map<String, BigDecimal> usualScoreWeight;
+
+    @ApiModelProperty(value = "期末成绩权重")
+    private BigDecimal finalScoreWeight;
+
+    public CourseTargetWeightDto() {
+
+    }
+
+    public CourseTargetWeightDto(Long targetId, String targetName) {
+        this.targetId = targetId;
+        this.targetName = targetName;
+    }
+
+    public CourseTargetWeightDto(Long targetId, String targetName, Map<String, BigDecimal> usualScoreWeight, BigDecimal finalScoreWeight) {
+        this.targetId = targetId;
+        this.targetName = targetName;
+        this.usualScoreWeight = usualScoreWeight;
+        this.finalScoreWeight = finalScoreWeight;
+    }
+
+    public Long getTargetId() {
+        return targetId;
+    }
+
+    public void setTargetId(Long targetId) {
+        this.targetId = targetId;
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+
+    public Map<String, BigDecimal> getUsualScoreWeight() {
+        return usualScoreWeight;
+    }
+
+    public void setUsualScoreWeight(Map<String, BigDecimal> usualScoreWeight) {
+        this.usualScoreWeight = usualScoreWeight;
+    }
+
+    public BigDecimal getFinalScoreWeight() {
+        return finalScoreWeight;
+    }
+
+    public void setFinalScoreWeight(BigDecimal finalScoreWeight) {
+        this.finalScoreWeight = finalScoreWeight;
+    }
+}

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

@@ -34,6 +34,13 @@ public class DimensionDto implements Serializable {
 
     }
 
+    public DimensionDto(DimensionDto dimensionDto, Double dimensionScore) {
+        this.dimensionId = dimensionDto.getDimensionId();
+        this.dimensionCode = dimensionDto.getDimensionCode();
+        this.dimensionName = dimensionDto.getDimensionName();
+        this.dimensionScore = dimensionScore;
+    }
+
     public DimensionDto(Long dimensionId, String dimensionCode, String dimensionName, Double dimensionScore) {
         this.dimensionId = dimensionId;
         this.dimensionCode = dimensionCode;

+ 1 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/FinalScoreDimensionOverviewDto.java

@@ -17,10 +17,6 @@ import java.io.Serializable;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class FinalScoreDimensionOverviewDto implements Serializable {
 
-    @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty(value = "目标id")
-    private Long targetId;
-
     @JsonSerialize(using = ToStringSerializer.class)
     @ApiModelProperty(value = "知识点id")
     private Long dimensionId;
@@ -38,8 +34,7 @@ public class FinalScoreDimensionOverviewDto implements Serializable {
 
     }
 
-    public FinalScoreDimensionOverviewDto(Long targetId, Long dimensionId, Double maxScore, Double minScore, Double avgScore) {
-        this.targetId = targetId;
+    public FinalScoreDimensionOverviewDto(Long dimensionId, Double maxScore, Double minScore, Double avgScore) {
         this.dimensionId = dimensionId;
         this.maxScore = maxScore;
         this.minScore = minScore;
@@ -54,14 +49,6 @@ public class FinalScoreDimensionOverviewDto implements Serializable {
         this.dimensionId = dimensionId;
     }
 
-    public Long getTargetId() {
-        return targetId;
-    }
-
-    public void setTargetId(Long targetId) {
-        this.targetId = targetId;
-    }
-
     public Double getMaxScore() {
         return maxScore;
     }

+ 4 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportCourseEvaluationResultDetailDto.java

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.business.bean.dto.report;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -25,6 +24,10 @@ public class ReportCourseEvaluationResultDetailDto implements Serializable {
 
     }
 
+    public ReportCourseEvaluationResultDetailDto(List<ReportExamStudentDto> examStudentList) {
+        this.examStudentList = examStudentList;
+    }
+
     public ReportCourseEvaluationResultDetailDto(List<ReportExamStudentDto> examStudentList, List<ReportCourseTargetViewDto> courseTargetList) {
         this.examStudentList = examStudentList;
         this.courseTargetList = courseTargetList;

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

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -20,19 +21,19 @@ public class ReportEvaluationDto implements Serializable {
     private String name;
 
     @ApiModelProperty(value = "权重")
-    private String weight;
+    private BigDecimal weight;
 
     @ApiModelProperty(value = "目标分值")
-    private Double score;
+    private Double score = 0.0d;
 
     @ApiModelProperty(value = "实际平均分")
-    private Double avg;
+    private Double avg = 0.0d;
 
     public ReportEvaluationDto() {
 
     }
 
-    public ReportEvaluationDto(String name, String weight, Double score, Double avg) {
+    public ReportEvaluationDto(String name, BigDecimal weight, Double score, Double avg) {
         this.name = name;
         this.weight = weight;
         this.score = score;
@@ -47,11 +48,11 @@ public class ReportEvaluationDto implements Serializable {
         this.name = name;
     }
 
-    public String getWeight() {
+    public BigDecimal getWeight() {
         return weight;
     }
 
-    public void setWeight(String weight) {
+    public void setWeight(BigDecimal weight) {
         this.weight = weight;
     }
 

+ 5 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportExamStudentFinalScoreDto.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -17,7 +18,7 @@ import java.util.List;
 public class ReportExamStudentFinalScoreDto implements Serializable {
 
     @ApiModelProperty(value = "权重")
-    private String weight;
+    private BigDecimal weight;
 
     @ApiModelProperty(value = "课程目标集合")
     private List<DimensionDto> dimensionList;
@@ -26,7 +27,7 @@ public class ReportExamStudentFinalScoreDto implements Serializable {
 
     }
 
-    public ReportExamStudentFinalScoreDto(String weight, List<DimensionDto> dimensionList) {
+    public ReportExamStudentFinalScoreDto(BigDecimal weight, List<DimensionDto> dimensionList) {
         this.weight = weight;
         this.dimensionList = dimensionList;
     }
@@ -35,11 +36,11 @@ public class ReportExamStudentFinalScoreDto implements Serializable {
         this.dimensionList = dimensionList;
     }
 
-    public String getWeight() {
+    public BigDecimal getWeight() {
         return weight;
     }
 
-    public void setWeight(String weight) {
+    public void setWeight(BigDecimal weight) {
         this.weight = weight;
     }
 

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

@@ -30,6 +30,28 @@ public class ReportExamStudentTargetDto implements Serializable {
     @ApiModelProperty(value = "平时成绩")
     private ReportExamStudentUsualScoreDto usualScore;
 
+    public ReportExamStudentTargetDto() {
+
+    }
+
+    public ReportExamStudentTargetDto(Long targetId, String targetName) {
+        this.targetId = targetId;
+        this.targetName = targetName;
+    }
+
+    public ReportExamStudentTargetDto(Long targetId, String targetName, ReportExamStudentFinalScoreDto finalScore) {
+        this.targetId = targetId;
+        this.targetName = targetName;
+        this.finalScore = finalScore;
+    }
+
+    public ReportExamStudentTargetDto(Long targetId, String targetName, ReportExamStudentFinalScoreDto finalScore, ReportExamStudentUsualScoreDto usualScore) {
+        this.targetId = targetId;
+        this.targetName = targetName;
+        this.finalScore = finalScore;
+        this.usualScore = usualScore;
+    }
+
     public Long getTargetId() {
         return targetId;
     }

+ 5 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/report/ReportExamStudentUsualScoreDto.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -17,7 +18,7 @@ import java.util.List;
 public class ReportExamStudentUsualScoreDto implements Serializable {
 
     @ApiModelProperty(value = "权重")
-    private String weight;
+    private BigDecimal weight;
 
     @ApiModelProperty(value = "平时成绩对象集合")
     private List<ReportExamStudentUsualScoreObjDto> scoreList;
@@ -26,7 +27,7 @@ public class ReportExamStudentUsualScoreDto implements Serializable {
 
     }
 
-    public ReportExamStudentUsualScoreDto(String weight, List<ReportExamStudentUsualScoreObjDto> scoreList) {
+    public ReportExamStudentUsualScoreDto(BigDecimal weight, List<ReportExamStudentUsualScoreObjDto> scoreList) {
         this.weight = weight;
         this.scoreList = scoreList;
     }
@@ -35,11 +36,11 @@ public class ReportExamStudentUsualScoreDto implements Serializable {
         this.scoreList = scoreList;
     }
 
-    public String getWeight() {
+    public BigDecimal getWeight() {
         return weight;
     }
 
-    public void setWeight(String weight) {
+    public void setWeight(BigDecimal weight) {
         this.weight = weight;
     }
 

+ 150 - 22
distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

@@ -126,9 +126,11 @@ public class TRBasicInfoController {
         //课程目标考核分布-题目信息
         TCPaperStruct tcPaperStruct = tcPaperStructService.getOne(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId).eq(TCPaperStruct::getCourseCode, courseCode).eq(TCPaperStruct::getPaperNumber, paperNumber));
         Objects.requireNonNull(tcPaperStruct, "未找到试卷蓝图信息");
+
         List<PaperStructResult> paperStructResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStruct(), new TypeToken<List<PaperStructResult>>() {
         }.getType());
 
+        Map<Long, CourseTargetWeightDto> targetMap = new LinkedHashMap<>();//课程目标map
         ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = new ReportCourseEvaluationSpreadDto(paperStructResultList);
 
         //课程目标考核分布-分数图
@@ -150,35 +152,91 @@ public class TRBasicInfoController {
         trBasicInfo.setCourseEvaluationSpread(JacksonUtil.parseJson(reportCourseEvaluationSpreadDto));
 
         //查询考生数据
-        List<FinalScoreResult> finalScoreResultList = tcFinalScoreService.examStudentOverview(examId, courseCode, paperNumber);
+        List<FinalScoreResult> finalScoreResultList = tcFinalScoreService.examStudentOverview(examId, courseCode, paperNumber);//考生成绩
         Map<String, List<Double>> usualScoreMap = new LinkedHashMap<>();//汇总平常成绩分数(用来算最高分,最低分,平均分)
+        Map<Long, List<Double>> finalScoreTargetMap = new LinkedHashMap<>();//汇总各课程目标期末考试分数(用来算最高分,最低分,平均分)
+//        Map<Long, Map<Long, List<DimensionDto>>> finalScoreDimensionMap = new LinkedHashMap<>();//汇总知识点分数(用来算最高分,最低分,平均分)
+        Map<String, Map<Long, Map<Long, DimensionDto>>> finalScoreExamStudentDimensionMap = new LinkedHashMap<>();//汇总考生课程目标-知识点
+
         Map<String, UsualScoreOverviewDto> usualScoreOverviewDtoMap = new LinkedHashMap<>();//整体平常成绩分数图
-//        Map<Long, Map<String, List<Double>>> finalScoreTargetMap = new LinkedHashMap<>();//汇总目标分数(用来算最高分,最低分,平均分)
-        Map<Long, List<Double>> finalScoreTargetMap = new LinkedHashMap<>();//汇总目标期末考试分数(用来算最高分,最低分,平均分)
-        Map<Long, Map<String, List<Double>>> finalScoreDimensionMap = new LinkedHashMap<>();//汇总知识点分数(用来算最高分,最低分,平均分)
-//        LinkedMultiValueMap<Long, UsualScoreOverviewDto> oList = new LinkedMultiValueMap<>();
+        Map<Long, FinalScoreOverviewDto> finalScoreOverviewDtoMap = new LinkedHashMap<>();//各课程目标期末考试分数图
+        Map<Long, FinalScoreDimensionOverviewDto> finalScoreDimensionOverviewDtoMap = new LinkedHashMap<>();//各课程目标期末考试知识点分数图
+        List<ReportExamStudentDto> examStudentList = null;//考生集合
+        Map<String, FinalScoreResult> finalScoreResultMap = null;//考生成绩map
+        Map<String, PaperStructResult> paperStructResultMap = null;//试卷蓝图map
         if (!CollectionUtils.isEmpty(finalScoreResultList)) {
             //期末成绩明细map
-            Map<String, PaperStructResult> paperStructResultMap = paperStructResultList.stream().collect(Collectors.toMap(k -> k.getMainNumber() + "-" + k.getSubNumber(), Function.identity(), (dto1, dto2) -> dto1));
+            paperStructResultMap = paperStructResultList.stream().collect(Collectors.toMap(k -> k.getMainNumber() + "-" + k.getSubNumber(), Function.identity(), (dto1, dto2) -> dto1));
+            finalScoreResultMap = finalScoreResultList.stream().collect(Collectors.toMap(FinalScoreResult::getStudentCode, Function.identity(), (dto1, dto2) -> dto1));
 
-            List<ReportExamStudentDto> examStudentList = new ArrayList<>(finalScoreResultList.size());
+            examStudentList = new ArrayList<>(finalScoreResultList.size());
             for (FinalScoreResult finalScoreResult : finalScoreResultList) {
+
                 //解析期末成绩知识点
                 JSONArray finalScoreDetailJsonArray = JSONArray.parseArray(finalScoreResult.getFinalScoreDetail());
                 for (int i = 0; i < finalScoreDetailJsonArray.size(); i++) {
                     JSONObject jsonObject = finalScoreDetailJsonArray.getJSONObject(i);
+                    Double score = Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d;
                     PaperStructResult paperStructResult = paperStructResultMap.get(jsonObject.get("name").toString());
                     if (Objects.nonNull(paperStructResult)) {
                         List<CourseTargetDto> courseTargetDtoList = paperStructResult.getTargetList();
+
                         for (CourseTargetDto courseTargetDto : courseTargetDtoList) {
+                            targetMap.put(courseTargetDto.getTargetId(), new CourseTargetWeightDto(courseTargetDto.getTargetId(), courseTargetDto.getTargetName()));
+
+                            //课程目标
                             if (!finalScoreTargetMap.containsKey(courseTargetDto.getTargetId())) {
-                                finalScoreTargetMap.put(courseTargetDto.getTargetId(), new ArrayList<>(Arrays.asList(Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d)));
+                                finalScoreTargetMap.put(courseTargetDto.getTargetId(), new ArrayList<>(Arrays.asList(score)));
                             } else {
-                                List<Double> list = usualScoreMap.get(courseTargetDto.getTargetId());
-                                list.add(Objects.nonNull(jsonObject.get("score")) ? Double.parseDouble(jsonObject.get("score").toString()) : 0d);
+                                List<Double> list = finalScoreTargetMap.get(courseTargetDto.getTargetId());
+                                list.add(score);
                                 finalScoreTargetMap.put(courseTargetDto.getTargetId(), list);
                             }
+                            //知识点
                             List<DimensionDto> dimensionDtoList = courseTargetDto.getDimensionList();
+                            for (DimensionDto dimensionDto : dimensionDtoList) {
+//                                if (!finalScoreDimensionMap.containsKey(courseTargetDto.getTargetId())) {
+//                                    Map<Long, List<DimensionDto>> map = new LinkedHashMap<>();
+//                                    map.put(dimensionDto.getDimensionId(), new ArrayList<>(Arrays.asList(dimensionDto)));
+//                                    finalScoreDimensionMap.put(courseTargetDto.getTargetId(), map);
+//                                } else {
+//                                    Map<Long, List<DimensionDto>> map = finalScoreDimensionMap.get(courseTargetDto.getTargetId());
+//                                    if (!map.containsKey(dimensionDto.getDimensionId())) {
+//                                        map.put(dimensionDto.getDimensionId(), new ArrayList<>(Arrays.asList(dimensionDto)));
+//                                    } else {
+//                                        List<DimensionDto> list = map.get(dimensionDto.getDimensionId());
+//                                        list.add(dimensionDto);
+//                                        map.put(dimensionDto.getDimensionId(), list);
+//                                    }
+//                                    finalScoreDimensionMap.put(courseTargetDto.getTargetId(), map);
+//                                }
+
+                                //考生知识点
+                                if (!finalScoreExamStudentDimensionMap.containsKey(finalScoreResult.getStudentCode())) {
+                                    Map<Long, Map<Long, DimensionDto>> map = new LinkedHashMap<>();
+                                    Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
+                                    dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
+                                    map.put(courseTargetDto.getTargetId(), dimensionMap);
+                                    finalScoreExamStudentDimensionMap.put(finalScoreResult.getStudentCode(), map);
+                                } else {
+                                    Map<Long, Map<Long, DimensionDto>> map = finalScoreExamStudentDimensionMap.get(finalScoreResult.getStudentCode());
+                                    if (!map.containsKey(courseTargetDto.getTargetId())) {
+                                        Map<Long, DimensionDto> dimensionMap = new LinkedHashMap<>();
+                                        dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
+                                        map.put(courseTargetDto.getTargetId(), dimensionMap);
+                                    } else {
+                                        Map<Long, DimensionDto> dimensionMap = map.get(courseTargetDto.getTargetId());
+                                        if (!dimensionMap.containsKey(dimensionDto.getDimensionId())) {
+                                            dimensionMap.put(dimensionDto.getDimensionId(), new DimensionDto(dimensionDto, score));
+                                        } else {
+                                            DimensionDto dimensionDtoTemp = dimensionMap.get(dimensionDto.getDimensionId());
+                                            dimensionDtoTemp.setDimensionScore(dimensionDtoTemp.getDimensionScore().doubleValue() + score.doubleValue());
+                                        }
+                                        map.put(courseTargetDto.getTargetId(), dimensionMap);
+                                    }
+                                    finalScoreExamStudentDimensionMap.put(finalScoreResult.getStudentCode(), map);
+                                }
+                            }
                         }
                     }
                 }
@@ -210,24 +268,61 @@ public class TRBasicInfoController {
             usualScoreOverviewDtoMap.put(k, new UsualScoreOverviewDto(k, maxScore, minScore, avgScore));
         });
 
+        //计算各课程目标期末考试最高分,最低分,平均分
+        finalScoreTargetMap.forEach((k, v) -> {
+            Double maxScore = v.stream().mapToDouble(Double::doubleValue).max().orElse(0d);
+            Double minScore = v.stream().mapToDouble(Double::doubleValue).min().orElse(0d);
+//            Double avgScore = new BigDecimal(v.stream().mapToDouble(Double::doubleValue).average().orElse(0d)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+            Double avgScore = new BigDecimal(v.stream().mapToDouble(Double::doubleValue).sum()).divide(new BigDecimal(finalScoreResultList.size()), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+            finalScoreOverviewDtoMap.put(k, new FinalScoreOverviewDto(k, maxScore, minScore, avgScore));
+        });
+
+        //计算各课程目标下期末考试知识点最高分,最低分,平均分
+//        finalScoreDimensionMap.forEach((k, v) -> {
+//            v.forEach((k1, v1) -> {
+//                Double maxScore = v1.stream().mapToDouble(DimensionDto::getDimensionScore).max().orElse(0d);
+//                Double minScore = v1.stream().mapToDouble(DimensionDto::getDimensionScore).min().orElse(0d);
+//                Double avgScore = new BigDecimal(v1.stream().mapToDouble(DimensionDto::getDimensionScore).average().orElse(0d)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+//                finalScoreDimensionOverviewDtoMap.put(k, new FinalScoreDimensionOverviewDto(k1, maxScore, minScore, avgScore));
+//            });
+//        });
+
         //TODO 课程考核成绩评价结果-待曹子轩补充目标/评价方式数据,有测试数据
         ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = null;
         if (!CollectionUtils.isEmpty(paperStructResultList)) {
-            Map<Long, String> targetMap = new LinkedHashMap<>();
-            for (PaperStructResult paperStructResult : paperStructResultList) {
-                List<CourseTargetDto> courseTargetDtoList = paperStructResult.getTargetList();
-                for (CourseTargetDto courseTargetDto : courseTargetDtoList) {
-                    targetMap.put(courseTargetDto.getTargetId(), courseTargetDto.getTargetName());
-                }
-            }
             List<CourseTargetDto> targetList = new ArrayList<>(targetMap.size());
             AtomicInteger sequenceId = new AtomicInteger(1);//流程连接id
             AtomicReference<Double> targetValue = new AtomicReference<>(0.0d);
             targetMap.forEach((k, v) -> {
+                Double evaluationValue = 0.0d;
                 List<ReportEvaluationDto> reportEvaluationDtoList = new ArrayList<>();
-                reportEvaluationDtoList.add(new ReportEvaluationDto("平时作业" + sequenceId.get(), "30%", 40d, 25d));
-                reportEvaluationDtoList.add(new ReportEvaluationDto("期末考试", "70%", 60d, 40d));
-                CourseTargetDto courseTargetDto = new CourseTargetDto(k, v, Long.parseLong(String.valueOf(sequenceId.get())), "评价方式" + sequenceId.get(), "评价方式描述" + sequenceId.get(), reportEvaluationDtoList, 0.5d + sequenceId.get());
+                UsualScoreOverviewDto usualScoreOverviewDto = usualScoreOverviewDtoMap.get("作业" + sequenceId.get());
+                FinalScoreOverviewDto finalScoreOverviewDto = finalScoreOverviewDtoMap.get(k);
+
+                ReportEvaluationDto reportEvaluationDto = new ReportEvaluationDto(usualScoreOverviewDto.getName(), new BigDecimal(30), 40d, usualScoreOverviewDto.getAvgScore());
+                reportEvaluationDtoList.add(reportEvaluationDto);
+
+                //课程目标-平时作业达成度计算
+                if (Objects.nonNull(reportEvaluationDto.getWeight()) && reportEvaluationDto.getWeight().doubleValue() > 0d) {
+                    Double evaluationValueTemp = new BigDecimal(reportEvaluationDto.getAvg().doubleValue() + reportEvaluationDto.getScore().doubleValue()).divide(reportEvaluationDto.getWeight(), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                    evaluationValue = evaluationValue.doubleValue() + evaluationValueTemp.doubleValue();
+                    Map<String, BigDecimal> usualScoreWeight = v.getUsualScoreWeight();
+                    usualScoreWeight = CollectionUtils.isEmpty(usualScoreWeight) ? new LinkedHashMap<>() : usualScoreWeight;
+                    usualScoreWeight.put(reportEvaluationDto.getName(), reportEvaluationDto.getWeight().add(new BigDecimal(new Random().nextInt(10))));
+                    v.setUsualScoreWeight(usualScoreWeight);
+                }
+
+                ReportEvaluationDto reportEvaluationDto1 = new ReportEvaluationDto("期末考试", new BigDecimal(70), 60d, finalScoreOverviewDto.getAvgScore());
+                reportEvaluationDtoList.add(reportEvaluationDto1);
+
+                //课程目标-期末成绩达成度计算
+                if (Objects.nonNull(reportEvaluationDto1.getWeight()) && reportEvaluationDto1.getWeight().doubleValue() > 0d) {
+                    Double evaluationValueTemp = new BigDecimal(reportEvaluationDto1.getAvg().doubleValue() + reportEvaluationDto1.getScore().doubleValue()).divide(reportEvaluationDto1.getWeight(), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                    evaluationValue = evaluationValue.doubleValue() + evaluationValueTemp.doubleValue();
+                    v.setFinalScoreWeight(reportEvaluationDto1.getWeight().subtract(new BigDecimal(new Random().nextInt(10))));
+                }
+
+                CourseTargetDto courseTargetDto = new CourseTargetDto(k, v.getTargetName(), Long.parseLong(String.valueOf(sequenceId.get())), "评价方式" + sequenceId.get(), "评价方式描述" + sequenceId.get(), reportEvaluationDtoList, evaluationValue);
                 targetList.add(courseTargetDto);
                 targetValue.set(targetValue.get().doubleValue() + courseTargetDto.getEvaluationValue().doubleValue());
                 sequenceId.incrementAndGet();
@@ -237,12 +332,45 @@ public class TRBasicInfoController {
         }
 
         //课程目标达成评价明细结果-考生集合
-
+        ReportCourseEvaluationResultDetailDto reportCourseEvaluationResultDetailDto = null;
+        if (!CollectionUtils.isEmpty(examStudentList)) {
+            for (ReportExamStudentDto reportExamStudentDto : examStudentList) {
+                Map<Long, Map<Long, DimensionDto>> map = finalScoreExamStudentDimensionMap.get(reportExamStudentDto.getStudentCode());
+                FinalScoreResult finalScoreResult = finalScoreResultMap.get(reportExamStudentDto.getStudentCode());
+                JSONArray finalScoreDetailJsonArray = JSONArray.parseArray(finalScoreResult.getFinalScoreDetail());
+                //计算期末考试知识点分数
+                for (int i = 0; i < finalScoreDetailJsonArray.size(); i++) {
+                    JSONObject jsonObject = finalScoreDetailJsonArray.getJSONObject(i);
+                    PaperStructResult paperStructResult = paperStructResultMap.get(jsonObject.get("name").toString());
+                    if (Objects.nonNull(paperStructResult)) {
+                        List<CourseTargetDto> courseTargetDtoList = paperStructResult.getTargetList();
+                        for (CourseTargetDto courseTargetDto : courseTargetDtoList) {
+                            Map<Long, DimensionDto> dimensionDtoMap = map.get(courseTargetDto.getTargetId());
+                            List<DimensionDto> dimensionDtoList = new ArrayList<>(dimensionDtoMap.values());
+                            if (CollectionUtils.isEmpty(reportExamStudentDto.getTargetList())) {
+                                List<ReportExamStudentTargetDto> targetList = new ArrayList<>();
+                                ReportExamStudentFinalScoreDto reportExamStudentFinalScoreDto = new ReportExamStudentFinalScoreDto(targetMap.get(courseTargetDto.getTargetId()).getFinalScoreWeight(), dimensionDtoList);
+                                targetList.add(new ReportExamStudentTargetDto(courseTargetDto.getTargetId(), courseTargetDto.getTargetName(), reportExamStudentFinalScoreDto));
+                                reportExamStudentDto.setTargetList(targetList);
+                            } else {
+                                List<ReportExamStudentTargetDto> targetList = reportExamStudentDto.getTargetList();
+                                Map<Long, ReportExamStudentTargetDto> reportExamStudentTargetDtoMap = targetList.stream().collect(Collectors.toMap(ReportExamStudentTargetDto::getTargetId, Function.identity(), (dto1, dto2) -> dto1));
+                                if (!reportExamStudentTargetDtoMap.containsKey(courseTargetDto.getTargetId())) {
+                                    targetList.add(new ReportExamStudentTargetDto(courseTargetDto.getTargetId(), courseTargetDto.getTargetName(), new ReportExamStudentFinalScoreDto(targetMap.get(courseTargetDto.getTargetId()).getFinalScoreWeight(), dimensionDtoList)));
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentList);
+            trBasicInfo.setCourseEvaluationResultDetail(JacksonUtil.parseJson(reportCourseEvaluationResultDetailDto));
+        }
 
         //课程目标达成评价明细结果-课程目标达成评价值图
         trBasicInfoService.saveOrUpdate(trBasicInfo);
 
-        trBasicInfo.setReportResult(new ReportResult(reportCommonDto, reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto, null));
+        trBasicInfo.setReportResult(new ReportResult(reportCommonDto, reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto, reportCourseEvaluationResultDetailDto));
         return ResultUtil.ok(trBasicInfo.getReportResult());
     }