Kaynağa Gözat

fix:武汉大学数学学院提出的意见修改

caozixuan 3 yıl önce
ebeveyn
işleme
c47aa874ee

+ 21 - 8
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/CellResult.java

@@ -1,5 +1,6 @@
 package com.qmth.teachcloud.report.business.bean.result;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -11,6 +12,7 @@ import java.io.Serializable;
  * @Author: wangliang
  * @Date: 2021/6/11
  */
+@JsonInclude(JsonInclude.Include.NON_NULL)
 public class CellResult implements Serializable {
 
     @ApiModelProperty(value = "试卷类型")
@@ -22,12 +24,14 @@ public class CellResult implements Serializable {
     @ApiModelProperty(value = "分数")
     private String scope;
 
-    // TODO: 2021/7/22 如果能把这个属性改为 referenceAvgScoreRate(参照指标) 比较好,因为有的地方显示的是学校平均得分率,有的是学院平均得分率,更改这个地方需要前端和三个mapper查询更改
     @ApiModelProperty(value = "学校平均分得分率")
     private Double schAvgScoreRate;
 
+    @ApiModelProperty(value = "学校平均分得分率")
+    private Double colAvgScoreRate;
+
     @ApiModelProperty(value = "我的(学院、教师)平均分得分率")
-    private Double myAvgScoreRate;
+    private Double teaAvgScoreRate;
 
     @ApiModelProperty(value = "计数")
     private Integer count;
@@ -36,12 +40,13 @@ public class CellResult implements Serializable {
 
     }
 
-    public CellResult(String paperType, String interpret, String scope, Double schAvgScoreRate, Double myAvgScoreRate, Integer count) {
+    public CellResult(String paperType, String interpret, String scope, Double schAvgScoreRate, Double colAvgScoreRate, Double teaAvgScoreRate, Integer count) {
         this.paperType = paperType;
         this.interpret = interpret;
         this.scope = scope;
         this.schAvgScoreRate = schAvgScoreRate;
-        this.myAvgScoreRate = myAvgScoreRate;
+        this.colAvgScoreRate = colAvgScoreRate;
+        this.teaAvgScoreRate = teaAvgScoreRate;
         this.count = count;
     }
 
@@ -77,12 +82,20 @@ public class CellResult implements Serializable {
         this.schAvgScoreRate = schAvgScoreRate;
     }
 
-    public Double getMyAvgScoreRate() {
-        return myAvgScoreRate;
+    public Double getColAvgScoreRate() {
+        return colAvgScoreRate;
+    }
+
+    public void setColAvgScoreRate(Double colAvgScoreRate) {
+        this.colAvgScoreRate = colAvgScoreRate;
+    }
+
+    public Double getTeaAvgScoreRate() {
+        return teaAvgScoreRate;
     }
 
-    public void setMyAvgScoreRate(Double myAvgScoreRate) {
-        this.myAvgScoreRate = myAvgScoreRate;
+    public void setTeaAvgScoreRate(Double teaAvgScoreRate) {
+        this.teaAvgScoreRate = teaAvgScoreRate;
     }
 
     public Integer getCount() {

+ 11 - 11
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/CourseDimensionResult.java

@@ -44,10 +44,10 @@ public class CourseDimensionResult implements Serializable {
     private Integer totalCount;
 
     @ApiModelProperty(value = "学校比率")
-    private Double schScoreRate;
+    private Double referenceScoreRate;
 
-    @ApiModelProperty(value = "学院比率")
-    private Double colScoreRate;
+    @ApiModelProperty(value = "我的比率")
+    private Double myScoreRate;
 
     @ApiModelProperty(value = "学院名称")
     private String collegeName;
@@ -138,20 +138,20 @@ public class CourseDimensionResult implements Serializable {
         this.totalCount = totalCount;
     }
 
-    public Double getSchScoreRate() {
-        return schScoreRate;
+    public Double getReferenceScoreRate() {
+        return referenceScoreRate;
     }
 
-    public void setSchScoreRate(Double schScoreRate) {
-        this.schScoreRate = schScoreRate;
+    public void setReferenceScoreRate(Double referenceScoreRate) {
+        this.referenceScoreRate = referenceScoreRate;
     }
 
-    public Double getColScoreRate() {
-        return colScoreRate;
+    public Double getMyScoreRate() {
+        return myScoreRate;
     }
 
-    public void setColScoreRate(Double colScoreRate) {
-        this.colScoreRate = colScoreRate;
+    public void setMyScoreRate(Double myScoreRate) {
+        this.myScoreRate = myScoreRate;
     }
 
     public String getCollegeName() {

+ 13 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/DimensionInfoResult.java

@@ -30,6 +30,9 @@ public class DimensionInfoResult implements Serializable {
     @ApiModelProperty(value = "学院得分率")
     private String colScoreRate;
 
+    @ApiModelProperty(value = "教师得分率")
+    private String teaScoreRate;
+
     @ApiModelProperty(value = "难度")
     private Double degree;
 
@@ -37,12 +40,13 @@ public class DimensionInfoResult implements Serializable {
 
     }
 
-    public DimensionInfoResult(String dimensionCode, String dimensionName, String totalCount, String schScoreRate, String colScoreRate, Double degree) {
+    public DimensionInfoResult(String dimensionCode, String dimensionName, String totalCount, String schScoreRate, String colScoreRate, String teaScoreRate, Double degree) {
         this.dimensionCode = dimensionCode;
         this.dimensionName = dimensionName;
         this.totalCount = totalCount;
         this.schScoreRate = schScoreRate;
         this.colScoreRate = colScoreRate;
+        this.teaScoreRate = teaScoreRate;
         this.degree = degree;
     }
 
@@ -106,4 +110,12 @@ public class DimensionInfoResult implements Serializable {
     public void setColScoreRate(String colScoreRate) {
         this.colScoreRate = colScoreRate;
     }
+
+    public String getTeaScoreRate() {
+        return teaScoreRate;
+    }
+
+    public void setTeaScoreRate(String teaScoreRate) {
+        this.teaScoreRate = teaScoreRate;
+    }
 }

+ 118 - 93
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java

@@ -21,8 +21,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -77,10 +77,10 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 学院学科报表查询科目信息
      *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @return
+     * @param examId examId
+     * @param courseCode courseCode
+     * @param collegeId collegeId
+     * @return return
      */
     @Override
     public CourseInfoResult findCourseInfo(Long examId, String courseCode, Long collegeId) {
@@ -99,7 +99,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
         if (tbPaperList.size() < 1) {
             throw ExceptionResultEnum.NO_DATA.exception();
         }
-        Set<String> paperTypeSet = tbPaperList.stream().map(e -> e.getPaperType()).collect(Collectors.toSet());
+        Set<String> paperTypeSet = tbPaperList.stream().map(TBPaper::getPaperType).collect(Collectors.toSet());
         String paperType = String.join(",", paperTypeSet); // 多种试卷类型的试卷类型合并','号隔开
         Gson gson = new Gson();
         TBPaperInfoResult TBPaperInfoResult = gson.fromJson(gson.toJson(tbPaperList.get(0)), TBPaperInfoResult.class);
@@ -129,10 +129,10 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 学院学科报表科目描述
      *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @return
+     * @param examId examId
+     * @param courseCode courseCode
+     * @param collegeId collegeId
+     * @return return
      */
     @Override
     public CollegeAndSchoolGradeDistributionResult findCourseDistribution(Long examId, String courseCode, Long collegeId) {
@@ -160,27 +160,27 @@ public class ReportCommonServiceImpl implements ReportCommonService {
             double maxValue = Double.parseDouble(String.valueOf(scopeMap.get("maxValue")));
             if ("(".equals(minSign) && ")".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue < e.getAssignedScore() && maxValue > e.getAssignedScore()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue < e.getAssignedScore() && maxValue > e.getAssignedScore()).count();
 
             } else if ("(".equals(minSign) && "]".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue < e.getAssignedScore() && maxValue >= e.getAssignedScore()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue < e.getAssignedScore() && maxValue >= e.getAssignedScore()).count();
 
             } else if ("[".equals(minSign) && ")".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue <= e.getAssignedScore() && maxValue > e.getAssignedScore()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue <= e.getAssignedScore() && maxValue > e.getAssignedScore()).count();
 
             } else if ("[".equals(minSign) && "]".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue <= e.getAssignedScore() && maxValue >= e.getAssignedScore()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
+                        .filter(e -> minValue <= e.getAssignedScore() && maxValue >= e.getAssignedScore()).count();
             }
 
             gradeDistributionList.add(new GradeDistributionResult(colCount, schCount, describe));
@@ -201,27 +201,27 @@ public class ReportCommonServiceImpl implements ReportCommonService {
             double maxValue = Double.parseDouble(String.valueOf(scopeMap.get("maxValue")));
             if ("(".equals(minSign) && ")".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue < e.getPercentGrade().doubleValue() && maxValue > e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue < e.getPercentGrade() && maxValue > e.getPercentGrade()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue < e.getPercentGrade().doubleValue() && maxValue > e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue < e.getPercentGrade() && maxValue > e.getPercentGrade()).count();
 
             } else if ("(".equals(minSign) && "]".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue < e.getPercentGrade().doubleValue() && maxValue >= e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue < e.getPercentGrade() && maxValue >= e.getPercentGrade()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue < e.getPercentGrade().doubleValue() && maxValue >= e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue < e.getPercentGrade() && maxValue >= e.getPercentGrade()).count();
 
             } else if ("[".equals(minSign) && ")".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue <= e.getPercentGrade().doubleValue() && maxValue > e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue <= e.getPercentGrade() && maxValue > e.getPercentGrade()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue <= e.getPercentGrade().doubleValue() && maxValue > e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue <= e.getPercentGrade() && maxValue > e.getPercentGrade()).count();
 
             } else if ("[".equals(minSign) && "]".equals(maxSign)) {
                 colCount = (int) examPaperTikForCollege.stream()
-                        .filter(e -> minValue <= e.getPercentGrade().doubleValue() && maxValue >= e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue <= e.getPercentGrade() && maxValue >= e.getPercentGrade()).count();
                 schCount = (int) examPaperTikForSchool.stream()
-                        .filter(e -> minValue <= e.getPercentGrade().doubleValue() && maxValue >= e.getPercentGrade().doubleValue()).count();
+                        .filter(e -> minValue <= e.getPercentGrade() && maxValue >= e.getPercentGrade()).count();
             }
             double colCountRate = MathUtil.formatDouble2(colCount / colTotalCount * 100); //本院比率 保留2位小数
             double schCountRate = MathUtil.formatDouble2(schCount / schTotalCount * 100); //全校比率 保留2位小数
@@ -234,11 +234,11 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 开课学院分数段
      *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @param filter
-     * @return
+     * @param examId examId
+     * @param courseCode courseCode
+     * @param collegeId collegeId
+     * @param filter filter
+     * @return return
      */
     @Override
     public List<SurveyTeacherGradeDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, Long collegeId, boolean filter) {
@@ -249,7 +249,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
         }
         surveyTeacherDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> !e.getAbsent()).collect(Collectors.toList());
         //过滤应届
-        List<SurveyTeacherDistributionResult> currentDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> e.getStudentCurrent() == true && !e.getAbsent()).collect(Collectors.toList());
+        List<SurveyTeacherDistributionResult> currentDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> e.getStudentCurrent() && !e.getAbsent()).collect(Collectors.toList());
         double allTotalCount = surveyTeacherDistributionResultList.size(); // 总体人数
         double currentTotalCount = currentDistributionResultList.size(); // 应届人数
 
@@ -257,7 +257,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
         for (GradeScopeEnum value : GradeScopeEnum.values()) {
             String describe = value.getDescribe();
             double allCountBefore = 0, allCountAfter = 0, currentCountBefore = 0, currentCountAfter = 0,
-                    allCountRateBefore = 0, allCountRateAfter = 0, currentCountRateBefore = 0, currentCountRateAfter = 0;
+                    allCountRateBefore, allCountRateAfter, currentCountRateBefore, currentCountRateAfter;
 
             Map<String, Object> scopeMap = AnalyzeScopeUtil.analyzeScope(value.getScope());
             String minSign = String.valueOf(scopeMap.get("minSign"));
@@ -313,10 +313,10 @@ public class ReportCommonServiceImpl implements ReportCommonService {
                         .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
             }
             BigDecimal hundredBig = new BigDecimal("100");
-            allCountRateBefore = allTotalCount > 0 ? new BigDecimal(allCountBefore).multiply(hundredBig).divide(new BigDecimal(allTotalCount), SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue() : 0;
-            allCountRateAfter = allTotalCount > 0 ? new BigDecimal(allCountAfter).multiply(hundredBig).divide(new BigDecimal(allTotalCount), SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue() : 0;
-            currentCountRateBefore = currentTotalCount > 0 ? new BigDecimal(currentCountBefore).multiply(hundredBig).divide(new BigDecimal(currentTotalCount), SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue() : 0;
-            currentCountRateAfter = currentTotalCount > 0 ? new BigDecimal(currentCountAfter).multiply(hundredBig).divide(new BigDecimal(currentTotalCount), SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue() : 0;
+            allCountRateBefore = allTotalCount > 0 ? new BigDecimal(allCountBefore).multiply(hundredBig).divide(new BigDecimal(allTotalCount), SystemConstant.FINAL_SCALE, RoundingMode.HALF_UP).doubleValue() : 0;
+            allCountRateAfter = allTotalCount > 0 ? new BigDecimal(allCountAfter).multiply(hundredBig).divide(new BigDecimal(allTotalCount), SystemConstant.FINAL_SCALE, RoundingMode.HALF_UP).doubleValue() : 0;
+            currentCountRateBefore = currentTotalCount > 0 ? new BigDecimal(currentCountBefore).multiply(hundredBig).divide(new BigDecimal(currentTotalCount), SystemConstant.FINAL_SCALE, RoundingMode.HALF_UP).doubleValue() : 0;
+            currentCountRateAfter = currentTotalCount > 0 ? new BigDecimal(currentCountAfter).multiply(hundredBig).divide(new BigDecimal(currentTotalCount), SystemConstant.FINAL_SCALE, RoundingMode.HALF_UP).doubleValue() : 0;
 
             surveyTeacherGradeDistributionResultList.add(new SurveyTeacherGradeDistributionResult((int) Math.abs(allCountBefore), (int) Math.abs(allCountAfter), (int) Math.abs(currentCountBefore), (int) Math.abs(currentCountAfter),
                     allCountRateBefore, allCountRateAfter, currentCountRateBefore, currentCountRateAfter, describe));
@@ -327,51 +327,73 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 学院学科报表查询维度
      *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @param teacherId
-     * @return
+     * @param examId examId
+     * @param courseCode courseCode
+     * @param collegeId collegeId
+     * @param teacherId teacherId
+     * @return return
      */
     @Override
     public DimensionAnalyzeResult findDimensionInfo(Long examId, String courseCode, Long collegeId, Long teacherId) {
+        boolean deanLookCollege = false;
+        boolean deanLookTeacher = false;
+        boolean teacherLookSelf = false;
         //查找维度
         List<CourseDimensionResult> dimensionInfoDatasource = null;
         if (SystemConstant.longNotNull(collegeId) && !SystemConstant.longNotNull(teacherId)) {
             // 有学院id无教师id -> 开课院长看各考察学院数据
             dimensionInfoDatasource = tbDimensionService.findDimensionInfo(examId, courseCode, collegeId);
+            deanLookCollege = true;
         } else if (SystemConstant.longNotNull(teacherId) && !SystemConstant.longNotNull(collegeId)) {
             // 有教师id无学院id -> 开课院长看各授课教师数据
             dimensionInfoDatasource = tbDimensionService.findDimensionByTeacherInfo(examId, courseCode, teacherId);
+            deanLookTeacher = true;
         } else if (SystemConstant.longNotNull(teacherId) && SystemConstant.longNotNull(collegeId)) {
             // 既有教师id又有学院id -> 任课教师看某个学院下自己的数据
             dimensionInfoDatasource = tbDimensionService.findDimensionByTeacherCollegeInfo(examId, courseCode, teacherId, collegeId);
+            teacherLookSelf = true;
         }
 //        if (dimensionInfoDatasource.size() < 1) {
 //            throw ExceptionResultEnum.DATA_ERROR.exception();
 //        }
         List<ModuleDimensionResult> dimensionAnalyzeList = new ArrayList<>();
-        Set<String> moduleSet = dimensionInfoDatasource.stream().map(CourseDimensionResult::getModule).collect(Collectors.toSet()); // 考查模块集合
-        for (String module : moduleSet) {
-            List<CourseDimensionResult> dimensionInfoList = dimensionInfoDatasource
-                    .stream().filter(e -> module.equals(e.getModule())).collect(Collectors.toList());
-
-            List<DimensionInfoResult> dioList = new ArrayList<>();
-            List<DimensionInfoResult> batterThanAll = new ArrayList<>(); // 掌握较好
-            List<DimensionInfoResult> worseThanAll = new ArrayList<>(); // 掌握较差
-            for (CourseDimensionResult courseDimensionResult : dimensionInfoList) {
-                String dimensionCode = String.valueOf(courseDimensionResult.getDimensionCode());
-                String dimensionName = String.valueOf(courseDimensionResult.getDimensionName());
-                double schScoreRate = courseDimensionResult.getSchScoreRate();
-                double colScoreRate = courseDimensionResult.getColScoreRate();
-                if (colScoreRate >= schScoreRate) {
-                    batterThanAll.add(new DimensionInfoResult(dimensionCode, dimensionName));
-                } else {
-                    worseThanAll.add(new DimensionInfoResult(dimensionCode, dimensionName));
+        if (dimensionInfoDatasource != null && dimensionInfoDatasource.size() > 0){
+            Set<String> moduleSet = dimensionInfoDatasource.stream().map(CourseDimensionResult::getModule).collect(Collectors.toSet()); // 考查模块集合
+            for (String module : moduleSet) {
+                List<CourseDimensionResult> dimensionInfoList = dimensionInfoDatasource
+                        .stream().filter(e -> module.equals(e.getModule())).collect(Collectors.toList());
+
+                List<DimensionInfoResult> dioList = new ArrayList<>();
+                List<DimensionInfoResult> batterThanAll = new ArrayList<>(); // 掌握较好
+                List<DimensionInfoResult> worseThanAll = new ArrayList<>(); // 掌握较差
+                for (CourseDimensionResult courseDimensionResult : dimensionInfoList) {
+                    String dimensionCode = String.valueOf(courseDimensionResult.getDimensionCode());
+                    String dimensionName = String.valueOf(courseDimensionResult.getDimensionName());
+                    double referenceScoreRate = courseDimensionResult.getReferenceScoreRate();
+                    double myScoreRate = courseDimensionResult.getMyScoreRate();
+                    if (myScoreRate >= referenceScoreRate) {
+                        batterThanAll.add(new DimensionInfoResult(dimensionCode, dimensionName));
+                    } else {
+                        worseThanAll.add(new DimensionInfoResult(dimensionCode, dimensionName));
+                    }
+
+                    String schScoreRate = null;
+                    String colScoreRate = null;
+                    String teaScoreRate = null;
+                    if (deanLookCollege){
+                        schScoreRate = String.valueOf(referenceScoreRate);
+                        colScoreRate = String.valueOf(myScoreRate);
+                    }else if (deanLookTeacher){
+                        schScoreRate = String.valueOf(referenceScoreRate);
+                        teaScoreRate = String.valueOf(myScoreRate);
+                    }else if (teacherLookSelf){
+                        colScoreRate = String.valueOf(myScoreRate);
+                        teaScoreRate = String.valueOf(myScoreRate);
+                    }
+                    dioList.add(new DimensionInfoResult(dimensionCode, dimensionName, String.valueOf(courseDimensionResult.getTotalCount()), schScoreRate, colScoreRate, teaScoreRate, courseDimensionResult.getDegree()));
                 }
-                dioList.add(new DimensionInfoResult(dimensionCode, dimensionName, String.valueOf(courseDimensionResult.getTotalCount()), String.valueOf(schScoreRate), String.valueOf(colScoreRate), courseDimensionResult.getDegree()));
+                dimensionAnalyzeList.add(new ModuleDimensionResult(module, dioList, batterThanAll, worseThanAll));
             }
-            dimensionAnalyzeList.add(new ModuleDimensionResult(module, dioList, batterThanAll, worseThanAll));
         }
         return new DimensionAnalyzeResult(dimensionAnalyzeList);
     }
@@ -379,11 +401,11 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 查找题目相关
      *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @param teacherId
-     * @return
+     * @param examId examId
+     * @param courseCode courseCode
+     * @param collegeId collegeId
+     * @param teacherId teacherId
+     * @return return
      */
     @Override
     public QuestionInfoResult findSituationOfQuestions(Long examId, String courseCode, Long collegeId, Long teacherId) {
@@ -399,10 +421,12 @@ public class ReportCommonServiceImpl implements ReportCommonService {
             // 既有教师id又有学院id -> 任课教师看某个学院下自己的数据
             answerDetailDatasource = taExamCourseTeacherCollegeDifficultService.findValidAnswerDetail(examId, courseCode, teacherId, collegeId);
         }
-        Set<String> paperTypeList = answerDetailDatasource.stream().map(e -> e.getPaperType()).collect(Collectors.toSet());
         List<PaperTypeResult> questionInfoList = new ArrayList<>();
-        for (String paperType : paperTypeList) {
-            questionInfoList.add(new PaperTypeResult(paperType, answerDetailDatasource.stream().filter(e -> Objects.equals(paperType, e.getPaperType())).collect(Collectors.toList())));
+        if (answerDetailDatasource != null && answerDetailDatasource.size() > 0){
+            Set<String> paperTypeList = answerDetailDatasource.stream().map(CellResult::getPaperType).collect(Collectors.toSet());
+            for (String paperType : paperTypeList) {
+                questionInfoList.add(new PaperTypeResult(paperType, answerDetailDatasource.stream().filter(e -> Objects.equals(paperType, e.getPaperType())).collect(Collectors.toList())));
+            }
         }
         return new QuestionInfoResult(questionInfoList);
     }
@@ -410,10 +434,10 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 查找老师信息
      *
-     * @param examId
-     * @param courseCode
-     * @param collegeId
-     * @return
+     * @param examId examId
+     * @param courseCode courseCode
+     * @param collegeId collegeId
+     * @return return
      */
     @Override
     public TeacherInfoListResult findTeacherInfo(Long examId, String courseCode, Long collegeId) {
@@ -427,21 +451,22 @@ public class ReportCommonServiceImpl implements ReportCommonService {
 
     /**
      * 查找题目信息
-     * @param examId 考试id
-     * @param courseCode 课程编号
-     * @param teachCollegeId 开课学院id
+     *
+     * @param examId           考试id
+     * @param courseCode       课程编号
+     * @param teachCollegeId   开课学院id
      * @param inspectCollegeId 考察学院id
-     * @param teacherId 授课教师id
+     * @param teacherId        授课教师id
      * @return 结果
      */
     @Override
-    public QuestionListResult findQuestionInfo(Long examId, String courseCode, Long teachCollegeId,Long inspectCollegeId,Long teacherId) {
+    public QuestionListResult findQuestionInfo(Long examId, String courseCode, Long teachCollegeId, Long inspectCollegeId, Long teacherId) {
         //查找试卷结构
         List<TBPaperStructResult> questionDatasource;
-        if (SystemConstant.longNotNull(inspectCollegeId) && SystemConstant.longNotNull(teacherId)){
+        if (SystemConstant.longNotNull(inspectCollegeId) && SystemConstant.longNotNull(teacherId)) {
             // 教师课堂查询 -> 教师在某课程学院下学生数据集
-            questionDatasource = tbPaperStructService.findQuestionInfoByTeacherCollege(examId, courseCode,inspectCollegeId,teacherId);
-        }else {
+            questionDatasource = tbPaperStructService.findQuestionInfoByTeacherCollege(examId, courseCode, inspectCollegeId, teacherId);
+        } else {
             // 开课学院和考察学院查询 -> 全校学生某课程数据集
             questionDatasource = tbPaperStructService.findQuestionInfo(examId, courseCode);
         }
@@ -466,7 +491,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
             List<TBPaperStructResult> errorCellList = cellList.stream().filter(e -> PaperStructJudgeEnum.NOT_QUITE_RIGHT.equals(e.getPaperStructJudge())).collect(Collectors.toList());
             // 获取考察点集合
             for (TBPaperStructResult cell : errorCellList) {
-                if (Objects.nonNull(cell.getKnowledgeDimension())){
+                if (Objects.nonNull(cell.getKnowledgeDimension())) {
                     String knowledgeDimension = cell.getKnowledgeDimension();
                     String[] arr = knowledgeDimension.split(",");
                     knowledgeDimensionSet.addAll(Arrays.asList(arr));
@@ -482,7 +507,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
 
             List<DimensionInfoResult> dimensionList = new ArrayList<>();
             for (String dimensionCode : knowledgeDimensionSort) {
-                String dimensionName = "";
+                String dimensionName;
                 List<String> nameTwoList = dimensionDataSource.stream()
                         .filter(e -> dimensionCode.equals(e.getCodeSecond()))
                         .map(TBDimension::getNameSecond).collect(Collectors.toList());
@@ -502,7 +527,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
 
             List<DimensionInfoResult> abilityDimensionList = new ArrayList<>();
             for (String dimensionCode : abilityDimensionSort) {
-                String dimensionName = "";
+                String dimensionName;
                 List<String> nameTwoList = dimensionDataSource.stream()
                         .filter(e -> dimensionCode.equals(e.getCodeSecond()))
                         .map(TBDimension::getNameSecond).collect(Collectors.toList());
@@ -527,11 +552,11 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 取总体平均分
      *
-     * @param schoolId
-     * @param courseCode
-     * @param examId
-     * @param filter
-     * @return
+     * @param schoolId schoolId
+     * @param courseCode courseCode
+     * @param examId examId
+     * @param filter filter
+     * @return 结果
      */
     @Override
     public SurveyTeacherExamCourseResult findAvgScore(Long schoolId, String courseCode, Long examId, boolean filter) {
@@ -591,10 +616,10 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     /**
      * 获取开课课程考试课程总览
      *
-     * @param semester
-     * @param examId
-     * @param courseCode
-     * @return
+     * @param semester semester
+     * @param examId examId
+     * @param courseCode courseCode
+     * @return return
      */
     @Override
     public TeachCourseSurveyResult getTeachCourseSurveyInfo(SemesterEnum semester, Long examId, String courseCode) {

+ 1 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseDifficultMapper.xml

@@ -9,7 +9,7 @@
             tik.count,
             tik.interpret,
             round(tik.sch_avg_score_rate * 100,2) as schAvgScoreRate,
-            round(tik.col_avg_score_rate * 100,2) as myAvgScoreRate
+            round(tik.col_avg_score_rate * 100,2) as colAvgScoreRate
         from t_a_exam_course_difficult tik
        <where>
            <if test="collegeId != null and collegeId != ''">

+ 2 - 2
teachcloud-report-business/src/main/resources/mapper/TAExamCourseTeacherCollegeDifficultMapper.xml

@@ -8,8 +8,8 @@
             tik.`scope`,
             tik.count,
             tik.interpret,
-            round(tik.col_avg_score_rate * 100,2) as schAvgScoreRate,
-            round(tik.tea_col_avg_score_rate * 100,2) as myAvgScoreRate
+            round(tik.col_avg_score_rate * 100,2) as colAvgScoreRate,
+            round(tik.tea_col_avg_score_rate * 100,2) as teaAvgScoreRate
         from t_a_exam_course_teacher_college_difficult tik
         <where>
             <if test="teacherId != null and teacherId > 0">

+ 1 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseTeacherDifficultMapper.xml

@@ -9,7 +9,7 @@
             tik.count,
             tik.interpret,
             round(tik.sch_avg_score_rate * 100,2) as schAvgScoreRate,
-            round(tik.tea_avg_score_rate * 100,2) as myAvgScoreRate
+            round(tik.tea_avg_score_rate * 100,2) as teaAvgScoreRate
         from t_a_exam_course_teacher_difficult tik
         <where>
             <if test="teacherId != null and teacherId != ''">

+ 6 - 6
teachcloud-report-business/src/main/resources/mapper/TBDimensionMapper.xml

@@ -12,8 +12,8 @@
             name_primary AS dimensionName,
             interpretation,
             total_count AS totalCount,
-            round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS schScoreRate,
-            round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS colScoreRate,
+            round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS referenceScoreRate,
+            round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS myScoreRate,
             colDio.inspect_college_name AS collegeName,
             round(colDio.score_rate, 1) as degree
         FROM
@@ -69,8 +69,8 @@
         name_primary AS dimensionName,
         interpretation,
         total_count AS totalCount,
-        round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS schScoreRate,
-        round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS colScoreRate,
+        round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS referenceScoreRate,
+        round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS myScoreRate,
         colDio.teacher_name AS teacherName,
         round(colDio.score_rate, 1) as degree
         FROM
@@ -133,9 +133,9 @@
             interpretation,
             total_count AS totalCount,
             ROUND(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),
-                  2) AS schScoreRate,
+                  2) AS referenceScoreRate,
             ROUND(CONVERT( myDio.score_rate * 100 , DECIMAL (10 , 4 )),
-                  2) AS colScoreRate,
+                  2) AS myScoreRate,
             myDio.teacher_name AS teacherName,
             ROUND(myDio.score_rate, 1) AS degree
         FROM

+ 1 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/interceptor/AuthInterceptor.java

@@ -23,7 +23,7 @@ public class AuthInterceptor extends ExtendInterceptor {
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
         log.info("preHandle is come in");
 //        if (request.getServletPath().contains(endpoint)) {
-        return true;
+            return true;
 //        } else {
 //            return AuthUtil.adminAuthInterceptor(request, response);
 //        }