|
@@ -233,12 +233,13 @@ 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) {
|
|
|
+ public List<SurveyTeacherGradeDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, Long collegeId, boolean filter) {
|
|
|
List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = new ArrayList<>();
|
|
|
- List<SurveyTeacherDistributionResult> surveyTeacherDistributionResultList = taExamCourseRecordService.surveyTeacherDistribution(examId, courseCode);
|
|
|
+ List<SurveyTeacherDistributionResult> surveyTeacherDistributionResultList = taExamCourseRecordService.surveyTeacherDistribution(examId, courseCode, filter);
|
|
|
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());
|
|
@@ -500,29 +501,39 @@ 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 new SurveyTeacherExamCourseResult();
|
|
|
+ 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)) {
|
|
|
+ BigDecimal bigDecimal = new BigDecimal(0);
|
|
|
+ return new SurveyTeacherExamCourseResult(bigDecimal, bigDecimal, bigDecimal, bigDecimal);
|
|
|
+ }
|
|
|
}
|
|
|
TAExamCourse taExamCourse = taExamCourseService.getOne(taExamCourseQueryWrapper);
|
|
|
BigDecimal bigDecimal = new BigDecimal(1);
|