Bladeren bron

bug修复

wangliang 4 jaren geleden
bovenliggende
commit
a2b14ec70b

+ 47 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/GradeDistributeFinalResult.java

@@ -0,0 +1,47 @@
+package com.qmth.teachcloud.report.business.bean.result;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description: GradeDistributeResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/23
+ */
+public class GradeDistributeFinalResult implements Serializable {
+
+    @ApiModelProperty(value = "SurveyTeacherExamCourseResult")
+    private SurveyTeacherExamCourseResult scoreAndRate;
+
+    @ApiModelProperty(value = "GradeDistributeResult")
+    private List<GradeDistributeResult> grades;
+
+    public GradeDistributeFinalResult() {
+
+    }
+
+    public GradeDistributeFinalResult(SurveyTeacherExamCourseResult scoreAndRate, List<GradeDistributeResult> grades) {
+        this.scoreAndRate = scoreAndRate;
+        this.grades = grades;
+    }
+
+    public SurveyTeacherExamCourseResult getScoreAndRate() {
+        return scoreAndRate;
+    }
+
+    public void setScoreAndRate(SurveyTeacherExamCourseResult scoreAndRate) {
+        this.scoreAndRate = scoreAndRate;
+    }
+
+    public List<GradeDistributeResult> getGrades() {
+        return grades;
+    }
+
+    public void setGrades(List<GradeDistributeResult> grades) {
+        this.grades = grades;
+    }
+}

+ 86 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/GradeDistributeResult.java

@@ -0,0 +1,86 @@
+package com.qmth.teachcloud.report.business.bean.result;
+
+import com.qmth.teachcloud.common.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: GradeDistributeResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/23
+ */
+public class GradeDistributeResult implements Serializable {
+
+    @ApiModelProperty(value = "分数")
+    @ExcelProperty(name = "分数段", width = 30, index = 1)
+    private String scores;
+
+    @ExcelProperty(name = "占比", width = 30, index = 3)
+    @ApiModelProperty(value = "全体比例")
+    private Double totalRate;
+
+    @ExcelProperty(name = "人数", width = 30, index = 2)
+    @ApiModelProperty(value = "全体实考人数")
+    private Integer totalRealityCount;
+
+    @ApiModelProperty(value = "应届实考人数")
+    private Integer currentRealityCount;
+
+    @ApiModelProperty(value = "应届比例")
+    private Double currentRate;
+
+    public GradeDistributeResult() {
+
+    }
+
+    public GradeDistributeResult(String scores, Double totalRate, Integer totalRealityCount, Integer currentRealityCount, Double currentRate) {
+        this.scores = scores;
+        this.totalRate = totalRate;
+        this.totalRealityCount = totalRealityCount;
+        this.currentRealityCount = currentRealityCount;
+        this.currentRate = currentRate;
+    }
+
+    public String getScores() {
+        return scores;
+    }
+
+    public void setScores(String scores) {
+        this.scores = scores;
+    }
+
+    public Double getTotalRate() {
+        return totalRate;
+    }
+
+    public void setTotalRate(Double totalRate) {
+        this.totalRate = totalRate;
+    }
+
+    public Integer getTotalRealityCount() {
+        return totalRealityCount;
+    }
+
+    public void setTotalRealityCount(Integer totalRealityCount) {
+        this.totalRealityCount = totalRealityCount;
+    }
+
+    public Integer getCurrentRealityCount() {
+        return currentRealityCount;
+    }
+
+    public void setCurrentRealityCount(Integer currentRealityCount) {
+        this.currentRealityCount = currentRealityCount;
+    }
+
+    public Double getCurrentRate() {
+        return currentRate;
+    }
+
+    public void setCurrentRate(Double currentRate) {
+        this.currentRate = currentRate;
+    }
+}

+ 26 - 26
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/SurveyTeacherGradeDistributionResult.java

@@ -14,10 +14,10 @@ import java.io.Serializable;
 public class SurveyTeacherGradeDistributionResult implements Serializable {
 
     @ApiModelProperty(value = "总体赋分前人数")
-    private Double allCountBefore;
+    private Integer allCountBefore;
 
     @ApiModelProperty(value = "总体赋分后人数")
-    private Double allCountAfter;
+    private Integer allCountAfter;
 
     @ApiModelProperty(value = "总体赋分前比率")
     private Double allCountRateBefore;
@@ -26,10 +26,10 @@ public class SurveyTeacherGradeDistributionResult implements Serializable {
     private Double allCountRateAfter;
 
     @ApiModelProperty(value = "应届赋分前人数")
-    private Double currentCountBefore;
+    private Integer currentCountBefore;
 
     @ApiModelProperty(value = "应届赋分后人数")
-    private Double currentCountAfter;
+    private Integer currentCountAfter;
 
     @ApiModelProperty(value = "应届赋分前比率")
     private Double currentCountRateBefore;
@@ -44,8 +44,8 @@ public class SurveyTeacherGradeDistributionResult implements Serializable {
 
     }
 
-    public SurveyTeacherGradeDistributionResult(Double allCountBefore, Double allCountAfter,
-                                                Double currentCountBefore, Double currentCountAfter,
+    public SurveyTeacherGradeDistributionResult(Integer allCountBefore, Integer allCountAfter,
+                                                Integer currentCountBefore, Integer currentCountAfter,
                                                 Double allCountRateBefore, Double allCountRateAfter,
                                                 Double currentCountRateBefore, Double currentCountRateAfter, String describe) {
         this.allCountBefore = allCountBefore;
@@ -59,52 +59,52 @@ public class SurveyTeacherGradeDistributionResult implements Serializable {
         this.describe = describe;
     }
 
-    public Double getAllCountBefore() {
+    public Integer getAllCountBefore() {
         return allCountBefore;
     }
 
-    public void setAllCountBefore(Double allCountBefore) {
+    public void setAllCountBefore(Integer allCountBefore) {
         this.allCountBefore = allCountBefore;
     }
 
-    public Double getAllCountAfter() {
+    public Integer getAllCountAfter() {
         return allCountAfter;
     }
 
-    public void setAllCountAfter(Double allCountAfter) {
+    public void setAllCountAfter(Integer allCountAfter) {
         this.allCountAfter = allCountAfter;
     }
 
-    public Double getAllCountRateBefore() {
-        return allCountRateBefore;
+    public Integer getCurrentCountBefore() {
+        return currentCountBefore;
     }
 
-    public void setAllCountRateBefore(Double allCountRateBefore) {
-        this.allCountRateBefore = allCountRateBefore;
+    public void setCurrentCountBefore(Integer currentCountBefore) {
+        this.currentCountBefore = currentCountBefore;
     }
 
-    public Double getAllCountRateAfter() {
-        return allCountRateAfter;
+    public Integer getCurrentCountAfter() {
+        return currentCountAfter;
     }
 
-    public void setAllCountRateAfter(Double allCountRateAfter) {
-        this.allCountRateAfter = allCountRateAfter;
+    public void setCurrentCountAfter(Integer currentCountAfter) {
+        this.currentCountAfter = currentCountAfter;
     }
 
-    public Double getCurrentCountBefore() {
-        return currentCountBefore;
+    public Double getAllCountRateBefore() {
+        return allCountRateBefore;
     }
 
-    public void setCurrentCountBefore(Double currentCountBefore) {
-        this.currentCountBefore = currentCountBefore;
+    public void setAllCountRateBefore(Double allCountRateBefore) {
+        this.allCountRateBefore = allCountRateBefore;
     }
 
-    public Double getCurrentCountAfter() {
-        return currentCountAfter;
+    public Double getAllCountRateAfter() {
+        return allCountRateAfter;
     }
 
-    public void setCurrentCountAfter(Double currentCountAfter) {
-        this.currentCountAfter = currentCountAfter;
+    public void setAllCountRateAfter(Double allCountRateAfter) {
+        this.allCountRateAfter = allCountRateAfter;
     }
 
     public Double getCurrentCountRateBefore() {

+ 1 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TAExamCourseService.java

@@ -52,7 +52,7 @@ public interface TAExamCourseService extends IService<TAExamCourse> {
      */
     IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus, SemesterEnum semester, String column, OrderEnum order);
 
-    Map<String, Object> getGradeDistribute(SemesterEnum semester, Long examId, String courseCode);
+    GradeDistributeFinalResult getGradeDistribute(SemesterEnum semester, Long examId, String courseCode);
 
     /**
      * 考查课程考试分析接口

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

@@ -300,7 +300,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
             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;
 
-            surveyTeacherGradeDistributionResultList.add(new SurveyTeacherGradeDistributionResult(allCountBefore, allCountAfter, currentCountBefore, currentCountAfter,
+            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));
         }
         return surveyTeacherGradeDistributionResultList;

+ 14 - 16
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseServiceImpl.java

@@ -65,6 +65,9 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     @Resource
     TBExamStudentService tbExamStudentService;
 
+    @Resource
+    TAExamCourseService taExamCourseService;
+
     /**
      * 开课课程考试总览列表接口
      *
@@ -115,27 +118,19 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     }
 
     @Override
-    public Map<String, Object> getGradeDistribute(SemesterEnum semester, Long examId, String courseCode) {
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+    public GradeDistributeFinalResult getGradeDistribute(SemesterEnum semester, Long examId, String courseCode) {
+//        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        Map<String, Object> map = new HashMap<>();
+        Long schoolId = sysUser.getSchoolId();
         //取总体和应届平均分
         SurveyTeacherExamCourseResult surveyTeacherExamCourseResult = reportCommonService.findAvgScore(schoolId, courseCode, examId);
-        map.put("scoreAndRate", surveyTeacherExamCourseResult);
         //学院学科报表科目描述
-        List<Map<String, Object>> mapList = new ArrayList<>();
+        List<GradeDistributeResult> gradeDistributeResultList = new ArrayList<>();
         List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, sysUser.getOrgId());
         for (SurveyTeacherGradeDistributionResult s : surveyTeacherGradeDistributionResultList) {
-            Map<String, Object> objectMap = new HashMap<>();
-            objectMap.put("scores", String.join(",", s.getDescribe()));
-            objectMap.put("totalRate", s.getAllCountRateAfter());
-            objectMap.put("totalRealityCount", s.getAllCountAfter());
-            objectMap.put("currentRealityCount", s.getCurrentCountAfter());
-            objectMap.put("currentRate", s.getCurrentCountRateAfter());
-            mapList.add(objectMap);
+            gradeDistributeResultList.add(new GradeDistributeResult(String.join(",", s.getDescribe()), s.getAllCountRateAfter(), s.getAllCountAfter(), s.getCurrentCountAfter(), s.getCurrentCountRateAfter()));
         }
-        map.put("grades", mapList);
-        return map;
+        return new GradeDistributeFinalResult(surveyTeacherExamCourseResult, gradeDistributeResultList);
     }
 
     /**
@@ -346,10 +341,13 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     @Override
     public void courseExport(Long examId, SemesterEnum semester, Long schoolId, String courseCode) throws Exception {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        //成绩对比明细
         IPage<TeachCollegeResult> teachCollegeResultIPage = tbExamStudentService.listTeachCollegeResult(Objects.nonNull(semester) ? semester.name() : null, examId, courseCode, null, null, null, null, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, null, null);
+        //全校赋分分数段
+        GradeDistributeFinalResult gradeDistributeFinalResult = taExamCourseService.getGradeDistribute(semester, examId, courseCode);
         List<String> sheetList = Arrays.asList("成绩对比明细", "全校卷面分数段", "全校赋分分数段(全部)", "全校赋分分数段(应届)", "各课堂应届生卷面非零平均成绩及排名");
-        List<Class<?>> classList = Arrays.asList(TeachCollegeResult.class);
-        List<Collection<?>> collectionList = Arrays.asList(teachCollegeResultIPage.getRecords());
+        List<Class<?>> classList = Arrays.asList(TeachCollegeResult.class, GradeDistributeResult.class);
+        List<Collection<?>> collectionList = Arrays.asList(teachCollegeResultIPage.getRecords(), gradeDistributeFinalResult.getGrades());
         ExcelUtil.excelExportBatchSheet("课程分析", sheetList, classList, collectionList, ServletUtil.getResponse());
     }