|
@@ -233,13 +233,15 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
* @param examId
|
|
|
* @param courseCode
|
|
|
* @param collegeId
|
|
|
+ * @param filter
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<SurveyTeacherGradeDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, Long collegeId) {
|
|
|
- List<SurveyTeacherDistributionResult> surveyTeacherDistributionResultList = taExamCourseRecordService.surveyTeacherDistribution(examId, courseCode);
|
|
|
- if (Objects.isNull(surveyTeacherDistributionResultList) || surveyTeacherDistributionResultList.size() == 0) {
|
|
|
- return new ArrayList<>();
|
|
|
+ public List<SurveyTeacherGradeDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, Long collegeId, boolean filter) {
|
|
|
+ List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = new ArrayList<>();
|
|
|
+ List<SurveyTeacherDistributionResult> surveyTeacherDistributionResultList = taExamCourseRecordService.surveyTeacherDistribution(examId, courseCode, filter);
|
|
|
+ if (Objects.isNull(surveyTeacherDistributionResultList) && surveyTeacherDistributionResultList.size() > 0) {
|
|
|
+ return null;
|
|
|
}
|
|
|
surveyTeacherDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> !e.getAbsent()).collect(Collectors.toList());
|
|
|
//过滤应届
|
|
@@ -248,7 +250,6 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
double currentTotalCount = currentDistributionResultList.size(); // 应届人数
|
|
|
|
|
|
// 计算成绩分布图
|
|
|
- List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = new ArrayList<>();
|
|
|
for (GradeScopeEnum value : GradeScopeEnum.values()) {
|
|
|
String describe = value.getDescribe();
|
|
|
double allCountBefore = 0, allCountAfter = 0, currentCountBefore = 0, currentCountAfter = 0,
|
|
@@ -503,29 +504,38 @@ public class ReportCommonServiceImpl implements ReportCommonService {
|
|
|
* @param schoolId
|
|
|
* @param courseCode
|
|
|
* @param examId
|
|
|
+ * @param filter
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public SurveyTeacherExamCourseResult findAvgScore(Long schoolId, String courseCode, Long examId) {
|
|
|
+ public SurveyTeacherExamCourseResult findAvgScore(Long schoolId, String courseCode, Long examId, boolean filter) {
|
|
|
//取总体和应届平均分
|
|
|
QueryWrapper<TAExamCourse> taExamCourseQueryWrapper = new QueryWrapper<>();
|
|
|
- QueryWrapper<TBExamCourse> tbExamCourseQueryWrapper = new QueryWrapper<>();
|
|
|
if (Objects.nonNull(schoolId)) {
|
|
|
taExamCourseQueryWrapper.lambda().eq(TAExamCourse::getSchoolId, schoolId);
|
|
|
- tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getSchoolId, schoolId);
|
|
|
}
|
|
|
if (Objects.nonNull(examId)) {
|
|
|
taExamCourseQueryWrapper.lambda().eq(TAExamCourse::getExamId, examId);
|
|
|
- tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getExamId, examId);
|
|
|
}
|
|
|
if (Objects.nonNull(courseCode)) {
|
|
|
taExamCourseQueryWrapper.lambda().eq(TAExamCourse::getCourseCode, courseCode);
|
|
|
- tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getCourseCode, courseCode);
|
|
|
}
|
|
|
- tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getPublishStatus, PublishStatusEnum.PUBLISH);
|
|
|
- TBExamCourse tbExamCourse = tbExamCourseService.getOne(tbExamCourseQueryWrapper);
|
|
|
- if (Objects.isNull(tbExamCourse)) {
|
|
|
- return null;
|
|
|
+ if (filter) {
|
|
|
+ QueryWrapper<TBExamCourse> tbExamCourseQueryWrapper = new QueryWrapper<>();
|
|
|
+ if (Objects.nonNull(schoolId)) {
|
|
|
+ tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getSchoolId, schoolId);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(examId)) {
|
|
|
+ tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getExamId, examId);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(courseCode)) {
|
|
|
+ tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getCourseCode, courseCode);
|
|
|
+ }
|
|
|
+ tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getPublishStatus, PublishStatusEnum.PUBLISH);
|
|
|
+ TBExamCourse tbExamCourse = tbExamCourseService.getOne(tbExamCourseQueryWrapper);
|
|
|
+ if (Objects.isNull(tbExamCourse)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
TAExamCourse taExamCourse = taExamCourseService.getOne(taExamCourseQueryWrapper);
|
|
|
BigDecimal bigDecimal = new BigDecimal(1);
|