|
@@ -2,6 +2,7 @@ package com.qmth.teachcloud.report.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.gson.Gson;
|
|
|
+import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.report.business.bean.result.*;
|
|
|
import com.qmth.teachcloud.report.business.entity.TAExamCourse;
|
|
@@ -255,36 +256,37 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
.filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
} else if ("(".equals(minSign) && "]".equals(maxSign)) {
|
|
|
allCountBefore = (int) surveyTeacherDistributionResultList.stream()//赋分前
|
|
|
- .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue >= e.getTotalScore().doubleValue()).count();
|
|
|
allCountAfter = (int) surveyTeacherDistributionResultList.stream()
|
|
|
- .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
|
|
|
currentCountBefore = (int) currentDistributionResultList.stream()//赋分前
|
|
|
- .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue >= e.getTotalScore().doubleValue()).count();
|
|
|
currentCountAfter = (int) currentDistributionResultList.stream()
|
|
|
- .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
|
|
|
} else if ("[".equals(minSign) && ")".equals(maxSign)) {
|
|
|
allCountBefore = (int) surveyTeacherDistributionResultList.stream()//赋分前
|
|
|
- .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
allCountAfter = (int) surveyTeacherDistributionResultList.stream()
|
|
|
- .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
currentCountBefore = (int) currentDistributionResultList.stream()//赋分前
|
|
|
- .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
currentCountAfter = (int) currentDistributionResultList.stream()
|
|
|
- .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
} else if ("[".equals(minSign) && "]".equals(maxSign)) {
|
|
|
allCountBefore = (int) surveyTeacherDistributionResultList.stream()//赋分前
|
|
|
- .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getTotalScore().doubleValue() && maxValue >= e.getTotalScore().doubleValue()).count();
|
|
|
allCountAfter = (int) surveyTeacherDistributionResultList.stream()
|
|
|
- .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
|
|
|
currentCountBefore = (int) currentDistributionResultList.stream()//赋分前
|
|
|
- .filter(e -> minValue < e.getTotalScore().doubleValue() && maxValue > e.getTotalScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getTotalScore().doubleValue() && maxValue >= e.getTotalScore().doubleValue()).count();
|
|
|
currentCountAfter = (int) currentDistributionResultList.stream()
|
|
|
- .filter(e -> minValue < e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
|
|
|
+ .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue >= e.getAssignedScore().doubleValue()).count();
|
|
|
}
|
|
|
- allCountRateBefore = allCountBefore > 0 ? MathUtil.formatDouble2(allTotalCount / allCountBefore) : 0;
|
|
|
- allCountRateAfter = allCountAfter > 0 ? MathUtil.formatDouble2(allTotalCount / allCountAfter) : 0;
|
|
|
- currentCountRateBefore = currentCountBefore > 0 ? MathUtil.formatDouble2(currentTotalCount / currentCountBefore) : 0;
|
|
|
- currentCountRateAfter = currentCountAfter > 0 ? MathUtil.formatDouble2(currentTotalCount / currentCountAfter) : 0;
|
|
|
+ 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;
|
|
|
|
|
|
surveyTeacherGradeDistributionResultList.add(new SurveyTeacherGradeDistributionResult(allCountBefore, allCountAfter, currentCountBefore, currentCountAfter,
|
|
|
allCountRateBefore, allCountRateAfter, currentCountRateBefore, currentCountRateAfter, describe));
|
|
@@ -493,6 +495,6 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
}
|
|
|
TAExamCourse taExamCourse = taExamCourseService.getOne(taExamCourseQueryWrapper);
|
|
|
BigDecimal bigDecimal = new BigDecimal(1);
|
|
|
- return new SurveyTeacherExamCourseResult(taExamCourse.getAvgScore(), bigDecimal.subtract(taExamCourse.getPassRate()).multiply(new BigDecimal("100")), taExamCourse.getPaperCurrentAvgScore(), bigDecimal.subtract(taExamCourse.getPaperPassRate()).multiply(new BigDecimal("100")));
|
|
|
+ return new SurveyTeacherExamCourseResult(taExamCourse.getAvgScore(), bigDecimal.subtract(taExamCourse.getPassRate()).multiply(new BigDecimal("100")), taExamCourse.getCurrentAvgScore(), bigDecimal.subtract(taExamCourse.getCurrentPassRate()).multiply(new BigDecimal("100")));
|
|
|
}
|
|
|
}
|