wangliang 4 år sedan
förälder
incheckning
10ccc28e4c

+ 73 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/GradeDistributeCurrentAssignedResult.java

@@ -0,0 +1,73 @@
+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: GradeDistributeCurrentAssignedResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/23
+ */
+public class GradeDistributeCurrentAssignedResult implements Serializable {
+
+    @ApiModelProperty(value = "分数")
+    @ExcelProperty(name = "分数段", width = 30, index = 1)
+    private String scores;
+
+    @ExcelProperty(name = "人数", width = 30, index = 2)
+    @ApiModelProperty(value = "应届实考人数")
+    private Integer currentRealityCount;
+
+    @ApiModelProperty(value = "应届比例")
+    private Double currentRate;
+
+    @ExcelProperty(name = "占比", width = 30, index = 3)
+    @ApiModelProperty(value = "应届比例")
+    private String currentRateStr;
+
+    public GradeDistributeCurrentAssignedResult() {
+
+    }
+
+    public GradeDistributeCurrentAssignedResult(String scores, Double currentRate, Integer currentRealityCount) {
+        this.scores = scores;
+        this.currentRealityCount = currentRealityCount;
+        this.currentRate = currentRate;
+    }
+
+    public String getCurrentRateStr() {
+        return currentRate + "%";
+    }
+
+    public void setCurrentRateStr(String currentRateStr) {
+        this.currentRateStr = currentRateStr;
+    }
+
+    public String getScores() {
+        return scores;
+    }
+
+    public void setScores(String scores) {
+        this.scores = scores;
+    }
+
+    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 - 2
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/GradeDistributeFinalResult.java

@@ -18,15 +18,39 @@ public class GradeDistributeFinalResult implements Serializable {
     private SurveyTeacherExamCourseResult scoreAndRate;
 
     @ApiModelProperty(value = "GradeDistributeResult")
-    private List<GradeDistributeResult> grades;
+    private List<GradeDistributeResult> grades;//全体卷面成绩
+
+    @ApiModelProperty(value = "GradeDistributePaperResult")
+    private List<GradeDistributePaperResult> paperGrades;//全体卷面成绩
+
+    @ApiModelProperty(value = "GradeDistributeCurrentAssignedResult")
+    private List<GradeDistributeCurrentAssignedResult> currentAssignedGrades;//应届赋分成绩
 
     public GradeDistributeFinalResult() {
 
     }
 
-    public GradeDistributeFinalResult(SurveyTeacherExamCourseResult scoreAndRate, List<GradeDistributeResult> grades) {
+    public GradeDistributeFinalResult(SurveyTeacherExamCourseResult scoreAndRate, List<GradeDistributeResult> grades, List<GradeDistributePaperResult> paperGrades, List<GradeDistributeCurrentAssignedResult> currentAssignedGrades) {
         this.scoreAndRate = scoreAndRate;
         this.grades = grades;
+        this.paperGrades = paperGrades;
+        this.currentAssignedGrades = currentAssignedGrades;
+    }
+
+    public List<GradeDistributeCurrentAssignedResult> getCurrentAssignedGrades() {
+        return currentAssignedGrades;
+    }
+
+    public void setCurrentAssignedGrades(List<GradeDistributeCurrentAssignedResult> currentAssignedGrades) {
+        this.currentAssignedGrades = currentAssignedGrades;
+    }
+
+    public List<GradeDistributePaperResult> getPaperGrades() {
+        return paperGrades;
+    }
+
+    public void setPaperGrades(List<GradeDistributePaperResult> paperGrades) {
+        this.paperGrades = paperGrades;
     }
 
     public SurveyTeacherExamCourseResult getScoreAndRate() {

+ 73 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/GradeDistributePaperResult.java

@@ -0,0 +1,73 @@
+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: GradeDistributePaperResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/23
+ */
+public class GradeDistributePaperResult implements Serializable {
+
+    @ApiModelProperty(value = "分数")
+    @ExcelProperty(name = "分数段", width = 30, index = 1)
+    private String scores;
+
+    @ApiModelProperty(value = "全体比例")
+    private Double totalRate;
+
+    @ExcelProperty(name = "人数", width = 30, index = 2)
+    @ApiModelProperty(value = "全体实考人数")
+    private Integer totalRealityCount;
+
+    @ExcelProperty(name = "占比", width = 30, index = 3)
+    @ApiModelProperty(value = "全体比例")
+    private String totalRateStr;
+
+    public GradeDistributePaperResult() {
+
+    }
+
+    public GradeDistributePaperResult(String scores, Double totalRate, Integer totalRealityCount) {
+        this.scores = scores;
+        this.totalRate = totalRate;
+        this.totalRealityCount = totalRealityCount;
+    }
+
+    public String getTotalRateStr() {
+        return totalRate + "%";
+    }
+
+    public void setTotalRateStr(String totalRateStr) {
+        this.totalRateStr = totalRateStr;
+    }
+
+    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;
+    }
+}

+ 12 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/GradeDistributeResult.java

@@ -18,7 +18,6 @@ public class GradeDistributeResult implements Serializable {
     @ExcelProperty(name = "分数段", width = 30, index = 1)
     private String scores;
 
-    @ExcelProperty(name = "占比", width = 30, index = 3)
     @ApiModelProperty(value = "全体比例")
     private Double totalRate;
 
@@ -32,6 +31,10 @@ public class GradeDistributeResult implements Serializable {
     @ApiModelProperty(value = "应届比例")
     private Double currentRate;
 
+    @ExcelProperty(name = "占比", width = 30, index = 3)
+    @ApiModelProperty(value = "全体比例")
+    private String totalRateStr;
+
     public GradeDistributeResult() {
 
     }
@@ -44,6 +47,14 @@ public class GradeDistributeResult implements Serializable {
         this.currentRate = currentRate;
     }
 
+    public String getTotalRateStr() {
+        return totalRate + "%";
+    }
+
+    public void setTotalRateStr(String totalRateStr) {
+        this.totalRateStr = totalRateStr;
+    }
+
     public String getScores() {
         return scores;
     }

+ 12 - 13
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseServiceImpl.java

@@ -2,18 +2,13 @@ package com.qmth.teachcloud.report.business.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.common.reflect.TypeToken;
-import com.google.gson.Gson;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.SysOrgService;
 import com.qmth.teachcloud.common.util.ExcelUtil;
-import com.qmth.teachcloud.common.util.JacksonUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
-import com.qmth.teachcloud.report.business.bean.dto.excel.TAExamCourseExportDto;
 import com.qmth.teachcloud.report.business.bean.result.*;
 import com.qmth.teachcloud.report.business.entity.TAExamCourse;
 import com.qmth.teachcloud.report.business.entity.TAExamCourseRecord;
@@ -119,18 +114,23 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
 
     @Override
     public GradeDistributeFinalResult getGradeDistribute(SemesterEnum semester, Long examId, String courseCode) {
-//        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        Long schoolId = sysUser.getSchoolId();
+//        Long schoolId = sysUser.getSchoolId();
         //取总体和应届平均分
         SurveyTeacherExamCourseResult surveyTeacherExamCourseResult = reportCommonService.findAvgScore(schoolId, courseCode, examId);
         //学院学科报表科目描述
-        List<GradeDistributeResult> gradeDistributeResultList = new ArrayList<>();
+        List<GradeDistributeResult> gradeDistributeResultList = new ArrayList<>();//全体卷面成绩
+        List<GradeDistributePaperResult> gradeDistributePaperResultList = new ArrayList<>();//全体赋分成绩
+        List<GradeDistributeCurrentAssignedResult> gradeDistributeCurrentAssignedResultList = new ArrayList<>();//应届赋分成绩
         List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, sysUser.getOrgId());
         for (SurveyTeacherGradeDistributionResult s : surveyTeacherGradeDistributionResultList) {
-            gradeDistributeResultList.add(new GradeDistributeResult(String.join(",", s.getDescribe()), s.getAllCountRateAfter(), s.getAllCountAfter(), s.getCurrentCountAfter(), s.getCurrentCountRateAfter()));
+            String describe = String.join(",", s.getDescribe());
+            gradeDistributeResultList.add(new GradeDistributeResult(describe, s.getAllCountRateAfter(), s.getAllCountAfter(), s.getCurrentCountAfter(), s.getCurrentCountRateAfter()));
+            gradeDistributePaperResultList.add(new GradeDistributePaperResult(describe, s.getAllCountRateBefore(), s.getAllCountBefore()));
+            gradeDistributeCurrentAssignedResultList.add(new GradeDistributeCurrentAssignedResult(describe, s.getCurrentCountRateAfter(), s.getCurrentCountAfter()));
         }
-        return new GradeDistributeFinalResult(surveyTeacherExamCourseResult, gradeDistributeResultList);
+        return new GradeDistributeFinalResult(surveyTeacherExamCourseResult, gradeDistributeResultList, gradeDistributePaperResultList, gradeDistributeCurrentAssignedResultList);
     }
 
     /**
@@ -340,14 +340,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, GradeDistributeResult.class);
-        List<Collection<?>> collectionList = Arrays.asList(teachCollegeResultIPage.getRecords(), gradeDistributeFinalResult.getGrades());
+        List<Class<?>> classList = Arrays.asList(TeachCollegeResult.class, GradeDistributePaperResult.class, GradeDistributeResult.class, GradeDistributeCurrentAssignedResult.class);
+        List<Collection<?>> collectionList = Arrays.asList(teachCollegeResultIPage.getRecords(), gradeDistributeFinalResult.getPaperGrades(), gradeDistributeFinalResult.getGrades(), gradeDistributeFinalResult.getCurrentAssignedGrades());
         ExcelUtil.excelExportBatchSheet("课程分析", sheetList, classList, collectionList, ServletUtil.getResponse());
     }
 

+ 2 - 2
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamStudentServiceImpl.java

@@ -167,8 +167,8 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
     public IPage<TeachCollegeResult> listTeachCollegeResult(String semester, Long examId, String courseCode, Boolean current, Long inspectCollegeId, Long teacherId, String studentParam, Integer pageNumber, Integer pageSize, String column, OrderEnum order) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Long orgId = sysUser.getOrgId();
-//        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        Long schoolId = sysUser.getSchoolId();
+        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+//        Long schoolId = sysUser.getSchoolId();
         List<Long> collegeIds = sysOrgService.findCollegeIds(sysUser.getOrgId());
         IPage<TeachCollegeResult> listPage;
         if (Objects.nonNull(collegeIds) && collegeIds.size() > 0) {

+ 1 - 6
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/CourseController.java

@@ -95,12 +95,7 @@ public class CourseController {
     public void courseExport(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
                              @ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester,
                              @ApiParam(value = "学校id", required = false) @RequestParam(required = false) String schoolId,
-                             @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode) throws Exception {
-//        IPage<TAExamCourseResult> taExamCourseResultIPage = taExamCourseService.surveyTeacherList(new Page<>(0, 10), SystemConstant.convertIdToLong(examId), semester, Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), null, null);
-//        Gson gson = new Gson();
-//        List<TAExamCourseExportDto> taExamCourseExportDtoList = gson.fromJson(JacksonUtil.parseJson(taExamCourseResultIPage.getRecords()), new TypeToken<List<TAExamCourseExportDto>>() {
-//        }.getType());
-//        ExcelUtil.excelExportBatchSheet("测试", Arrays.asList("测试1", "测试2"), Arrays.asList(TAExamCourseExportDto.class, TAExamCourseExportDto.class), Arrays.asList(taExamCourseExportDtoList, taExamCourseExportDtoList), response);
+                             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode) throws Exception {
         taExamCourseService.courseExport(SystemConstant.convertIdToLong(examId), semester, Objects.nonNull(schoolId) ? SystemConstant.convertIdToLong(schoolId) : null, courseCode);
     }