zouxuan 2 years ago
parent
commit
c3b831d993

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -313,6 +313,9 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
         }
         studentAttendanceDao.addStudentAttendances(studentAttendances);
         List<StudentAttendance> allStudentAttendances = studentAttendanceDao.findByCourseId(studentAttendanceInfo.getCourseScheduleId());
+        if(!CollectionUtils.isEmpty(allStudentAttendances)){
+            allStudentAttendances = allStudentAttendances.stream().filter(e->e.getStatus() != null).collect(Collectors.toList());
+        }
         Map<StudentAttendanceStatusEnum, List<StudentAttendance>> studentAttendanceGroupByStatus = allStudentAttendances.stream().collect(Collectors.groupingBy(StudentAttendance::getStatus));
         Integer studentNum = studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.NORMAL) == null ? 0 : studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.NORMAL).size();
         Integer leaveStudentNum = studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.LEAVE) == null ? 0 : studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.LEAVE).size();