Browse Source

Merge remote-tracking branch 'origin/dev_v2.1.0' into dev_v2.1.0

wangliang 4 years ago
parent
commit
2cff4c18d8

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

@@ -225,11 +225,12 @@ public class ReportCommonServiceImpl implements ReportCommonService {
     @Override
     public List<SurveyTeacherGradeDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, Long collegeId) {
         List<SurveyTeacherDistributionResult> surveyTeacherDistributionResultList = taExamCourseRecordService.surveyTeacherDistribution(examId, courseCode);
+        surveyTeacherDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> !e.getAbsent()).collect(Collectors.toList());
         if (surveyTeacherDistributionResultList.size() < 1) {
             throw ExceptionResultEnum.DATA_ERROR.exception();
         }
         //过滤应届
-        List<SurveyTeacherDistributionResult> currentDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> e.getStudentCurrent() == true).collect(Collectors.toList());
+        List<SurveyTeacherDistributionResult> currentDistributionResultList = surveyTeacherDistributionResultList.stream().filter(e -> e.getStudentCurrent() == true && !e.getAbsent()).collect(Collectors.toList());
         double allTotalCount = surveyTeacherDistributionResultList.size(); // 总体人数
         double currentTotalCount = currentDistributionResultList.size(); // 应届人数
 
@@ -264,14 +265,25 @@ public class ReportCommonServiceImpl implements ReportCommonService {
                 currentCountAfter = (int) currentDistributionResultList.stream()
                         .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();
-                allCountAfter = (int) surveyTeacherDistributionResultList.stream()
-                        .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();
-                currentCountAfter = (int) currentDistributionResultList.stream()
-                        .filter(e -> minValue <= e.getAssignedScore().doubleValue() && maxValue > e.getAssignedScore().doubleValue()).count();
+                if (maxValue == 100) {
+                    allCountBefore = (int) surveyTeacherDistributionResultList.stream()//赋分前
+                            .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();
+                    currentCountBefore = (int) currentDistributionResultList.stream()//赋分前
+                            .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();
+                } else {
+                    allCountBefore = (int) surveyTeacherDistributionResultList.stream()//赋分前
+                            .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();
+                    currentCountBefore = (int) currentDistributionResultList.stream()//赋分前
+                            .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();
+                }
             } else if ("[".equals(minSign) && "]".equals(maxSign)) {
                 allCountBefore = (int) surveyTeacherDistributionResultList.stream()//赋分前
                         .filter(e -> minValue <= e.getTotalScore().doubleValue() && maxValue >= e.getTotalScore().doubleValue()).count();

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

@@ -112,7 +112,7 @@ public class TBExamCourseServiceImpl extends ServiceImpl<TBExamCourseMapper, TBE
         if (Objects.nonNull(collegeIds) && collegeIds.size() > 0) {
             return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, collegeIds);
         } else {
-            return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, Arrays.asList(sysUser.getOrgId()));
+            return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, Objects.nonNull(sysUser.getOrgId()) ? Arrays.asList(sysUser.getOrgId()) : null);
         }
     }
 

+ 2 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseRecordMapper.xml

@@ -129,7 +129,8 @@
             taecr.score_level as scoreLevel,
             taecr.rank_level as rankLevel,
             taecr.col_rank as colRank,
-            taecr.student_current as studentCurrent
+            taecr.student_current as studentCurrent,
+            tbes.absent
         FROM
             t_a_exam_course_record taecr
         join t_b_exam_record tber on