| 
														
															@@ -11,7 +11,6 @@ import com.ym.mec.education.entity.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.education.enums.StudentAttendanceStatusEnum; 
														 | 
														
														 | 
														
															 import com.ym.mec.education.enums.StudentAttendanceStatusEnum; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.education.mapper.StudentAttendanceMapper; 
														 | 
														
														 | 
														
															 import com.ym.mec.education.mapper.StudentAttendanceMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.education.req.ClassGroupReq; 
														 | 
														
														 | 
														
															 import com.ym.mec.education.req.ClassGroupReq; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.education.req.CourseScheduleReq; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.education.resp.StudentAttendanceResp; 
														 | 
														
														 | 
														
															 import com.ym.mec.education.resp.StudentAttendanceResp; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.education.resp.StudentAttendanceStatisticsResp; 
														 | 
														
														 | 
														
															 import com.ym.mec.education.resp.StudentAttendanceStatisticsResp; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.education.service.*; 
														 | 
														
														 | 
														
															 import com.ym.mec.education.service.*; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -21,10 +20,8 @@ import org.springframework.beans.BeanUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
														
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.stereotype.Service; 
														 | 
														
														 | 
														
															 import org.springframework.stereotype.Service; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.util.CollectionUtils; 
														 | 
														
														 | 
														
															 import org.springframework.util.CollectionUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.Objects; 
														 | 
														
														 | 
														
															 import java.util.Objects; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import java.util.Optional; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /** 
														 | 
														
														 | 
														
															 /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * <p> 
														 | 
														
														 | 
														
															  * <p> 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -101,14 +98,14 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public PageResponse getPageByCourse(CourseScheduleReq courseScheduleReq) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public PageResponse getPageRollCall(ClassGroupReq classGroupReq) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (Objects.isNull(classGroupReq.getGroupId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return PageResponse.errorParam(); 
														 | 
														
														 | 
														
															             return PageResponse.errorParam(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Page<StudentAttendanceResp> pageResult = new Page<>(); 
														 | 
														
														 | 
														
															         Page<StudentAttendanceResp> pageResult = new Page<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        Page<StudentAttendance> studentAttendancePage = new Page<StudentAttendance>(courseScheduleReq.getPageNo(), courseScheduleReq.getPageSize()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Page<StudentAttendance> studentAttendancePage = new Page<StudentAttendance>(classGroupReq.getPageNo(), classGroupReq.getPageSize()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<>(); 
														 | 
														
														 | 
														
															         QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        queryWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        queryWrapper.lambda().eq(true, StudentAttendance::getClassGroupId, classGroupReq.getGroupId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         IPage<StudentAttendance> page = page(studentAttendancePage, queryWrapper); 
														 | 
														
														 | 
														
															         IPage<StudentAttendance> page = page(studentAttendancePage, queryWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (!CollectionUtils.isEmpty(page.getRecords())) { 
														 | 
														
														 | 
														
															         if (!CollectionUtils.isEmpty(page.getRecords())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             List<StudentAttendanceResp> list = Lists.newArrayList(); 
														 | 
														
														 | 
														
															             List<StudentAttendanceResp> list = Lists.newArrayList(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -131,87 +128,84 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public PageResponse statisticsList(CourseScheduleReq courseScheduleReq) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public PageResponse statisticsList(ClassGroupReq classGroupReq) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (Objects.isNull(classGroupReq.getGroupId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             PageResponse.errorParam(); 
														 | 
														
														 | 
														
															             PageResponse.errorParam(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        Page<ClassGroupStudentMapper> classGroupStudentMapperPage = new Page<ClassGroupStudentMapper>(courseScheduleReq.getPageNo(), courseScheduleReq.getPageSize()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Page<ClassGroupStudentMapper> classGroupStudentMapperPage = new Page<ClassGroupStudentMapper>(classGroupReq.getPageNo(), classGroupReq.getPageSize()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Page<StudentAttendanceStatisticsResp> pageResult = new Page(); 
														 | 
														
														 | 
														
															         Page<StudentAttendanceStatisticsResp> pageResult = new Page(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        CourseSchedule courseSchedule = courseScheduleService.getById(courseScheduleReq.getCourseScheduleId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (Objects.nonNull(courseSchedule)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            ClassGroup classGroup = groupService.getById(courseSchedule.getClassGroupId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            if (Objects.nonNull(classGroup)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                List<String> subjectNameList = subjectService.getSubjectNameList(classGroup.getSubjectIdList()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                QueryWrapper<ClassGroupStudentMapper> classGroupStudentMapperQueryWrapper = new QueryWrapper<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                classGroupStudentMapperQueryWrapper.lambda().eq(true, ClassGroupStudentMapper::getClassGroupId, classGroup.getId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        .in(true, ClassGroupStudentMapper::getStatus, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                ClassGroupStudentStatusEnum.NORMAL.getCode(), ClassGroupStudentStatusEnum.LEAVE.getCode()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                IPage<ClassGroupStudentMapper> studentMapperPage = classGroupStudentMapperService.page(classGroupStudentMapperPage, classGroupStudentMapperQueryWrapper); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if (!CollectionUtils.isEmpty(studentMapperPage.getRecords())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    List<StudentAttendanceStatisticsResp> studentAttendanceStatisticsRespList = Lists.newArrayList(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    BeanUtils.copyProperties(studentMapperPage, pageResult); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    studentMapperPage.getRecords().forEach(item -> { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        StudentAttendanceStatisticsResp resp = new StudentAttendanceStatisticsResp(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        SysUser user = userService.getById(item.getUserId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        if (Objects.nonNull(user) && StringUtils.isNotBlank(user.getRealName())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                            resp.setStudentName(user.getRealName()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        ClassGroup classGroup = groupService.getById(classGroupReq.getGroupId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (Objects.nonNull(classGroup)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            List<String> subjectNameList = subjectService.getSubjectNameList(classGroup.getSubjectIdList()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            QueryWrapper<ClassGroupStudentMapper> classGroupStudentMapperQueryWrapper = new QueryWrapper<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            classGroupStudentMapperQueryWrapper.lambda().eq(true, ClassGroupStudentMapper::getClassGroupId, classGroup.getId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    .in(true, ClassGroupStudentMapper::getStatus, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            ClassGroupStudentStatusEnum.NORMAL.getCode(), ClassGroupStudentStatusEnum.LEAVE.getCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            IPage<ClassGroupStudentMapper> studentMapperPage = classGroupStudentMapperService.page(classGroupStudentMapperPage, classGroupStudentMapperQueryWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (!CollectionUtils.isEmpty(studentMapperPage.getRecords())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                List<StudentAttendanceStatisticsResp> studentAttendanceStatisticsRespList = Lists.newArrayList(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                BeanUtils.copyProperties(studentMapperPage, pageResult); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                studentMapperPage.getRecords().forEach(item -> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    StudentAttendanceStatisticsResp resp = new StudentAttendanceStatisticsResp(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    SysUser user = userService.getById(item.getUserId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if (Objects.nonNull(user) && StringUtils.isNotBlank(user.getRealName())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        resp.setStudentName(user.getRealName()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resp.setSubjectName(subjectNameList); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //是否连续旷课 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    QueryWrapper<MusicGroupStudentFee> musicGroupStudentFeeQueryWrapper = new QueryWrapper<MusicGroupStudentFee>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    musicGroupStudentFeeQueryWrapper.lambda().eq(true, MusicGroupStudentFee::getMusicGroupId, classGroup.getMusicGroupId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, MusicGroupStudentFee::getUserId, item.getUserId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeService.getOne(musicGroupStudentFeeQueryWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if (Objects.nonNull(musicGroupStudentFee) && Objects.nonNull(musicGroupStudentFee.getContinuousAbsenteeismTimes())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        if (musicGroupStudentFee.getContinuousAbsenteeismTimes() > 1) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            resp.setTruant(true); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         } 
														 | 
														
														 | 
														
															                         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        resp.setSubjectName(subjectNameList); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        //是否连续旷课 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        QueryWrapper<MusicGroupStudentFee> musicGroupStudentFeeQueryWrapper = new QueryWrapper<MusicGroupStudentFee>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        musicGroupStudentFeeQueryWrapper.lambda().eq(true, MusicGroupStudentFee::getMusicGroupId, classGroup.getMusicGroupId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, MusicGroupStudentFee::getUserId, item.getUserId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeService.getOne(musicGroupStudentFeeQueryWrapper); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        if (Objects.nonNull(musicGroupStudentFee) && Objects.nonNull(musicGroupStudentFee.getContinuousAbsenteeismTimes())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                            if (musicGroupStudentFee.getContinuousAbsenteeismTimes() > 1) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                resp.setTruant(true); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //到课天数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    QueryWrapper<StudentAttendance> normalWrapper = new QueryWrapper<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    normalWrapper.lambda().eq(true, StudentAttendance::getClassGroupId, classGroupReq.getGroupId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getUserId, item.getUserId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.NORMAL.getCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    int normalDay = count(normalWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //旷课天数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    QueryWrapper<StudentAttendance> truantWrapper = new QueryWrapper<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    truantWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, classGroupReq.getGroupId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getUserId, item.getUserId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.TRUANT.getCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    int truantDay = count(truantWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //请假天数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    QueryWrapper<StudentAttendance> leaveWrapper = new QueryWrapper<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    leaveWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, classGroupReq.getGroupId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getUserId, item.getUserId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    int leaveDay = count(leaveWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resp.setNormalDay(normalDay); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resp.setTruantDay(truantDay); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resp.setLeaveDay(leaveDay); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //每个学生的考勤明细 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    QueryWrapper<StudentAttendance> studentAttendanceQueryWrapper = new QueryWrapper<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    studentAttendanceQueryWrapper.lambda().eq(true, StudentAttendance::getClassGroupId, classGroupReq.getGroupId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            .eq(true, StudentAttendance::getUserId, item.getUserId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    List<StudentAttendance> studentAttendanceList = list(studentAttendanceQueryWrapper); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    List<StudentAttendanceResp> studentAttendanceRespList = Lists.newArrayList(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if (!CollectionUtils.isEmpty(studentAttendanceList)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        studentAttendanceList.forEach(studentAttendance -> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            StudentAttendanceResp studentAttendanceResp = new StudentAttendanceResp(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            if (Objects.nonNull(studentAttendance.getCreateTime())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                studentAttendanceResp.setClassDate(DateUtil.date2String(studentAttendance.getCreateTime(), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                        DateUtil.DATE_FORMAT)).setClassWeek(DateUtil.date2Week(studentAttendance.getCreateTime())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                             } 
														 | 
														
														 | 
														
															                             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        //到课天数 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        QueryWrapper<StudentAttendance> normalWrapper = new QueryWrapper<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        normalWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getUserId, item.getUserId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.NORMAL.getCode()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        int normalDay = count(normalWrapper); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        //旷课天数 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        QueryWrapper<StudentAttendance> truantWrapper = new QueryWrapper<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        truantWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getUserId, item.getUserId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.TRUANT.getCode()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        int truantDay = count(truantWrapper); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        //请假天数 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        QueryWrapper<StudentAttendance> leaveWrapper = new QueryWrapper<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        leaveWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getUserId, item.getUserId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        int leaveDay = count(leaveWrapper); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        resp.setNormalDay(normalDay); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        resp.setTruantDay(truantDay); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        resp.setLeaveDay(leaveDay); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        //每个学生的考勤明细 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        QueryWrapper<StudentAttendance> studentAttendanceQueryWrapper = new QueryWrapper<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        studentAttendanceQueryWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                .eq(true, StudentAttendance::getUserId, item.getUserId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        List<StudentAttendance> studentAttendanceList = list(studentAttendanceQueryWrapper); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        List<StudentAttendanceResp> studentAttendanceRespList = Lists.newArrayList(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        if (!CollectionUtils.isEmpty(studentAttendanceList)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                            studentAttendanceList.forEach(studentAttendance -> { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                StudentAttendanceResp studentAttendanceResp = new StudentAttendanceResp(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                if (Objects.nonNull(studentAttendance.getCreateTime())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                    studentAttendanceResp.setClassDate(DateUtil.date2String(studentAttendance.getCreateTime(), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                            DateUtil.DATE_FORMAT)).setClassWeek(DateUtil.date2Week(studentAttendance.getCreateTime())); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                if (StringUtils.isNotBlank(studentAttendance.getStatus())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                    studentAttendanceResp.setStatus(StudentAttendanceStatusEnum.getMsgByCode(studentAttendance.getStatus())); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                studentAttendanceRespList.add(studentAttendanceResp); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                            }); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        resp.setList(studentAttendanceRespList); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        studentAttendanceStatisticsRespList.add(resp); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    }); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    pageResult.setRecords(studentAttendanceStatisticsRespList); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            if (StringUtils.isNotBlank(studentAttendance.getStatus())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                studentAttendanceResp.setStatus(StudentAttendanceStatusEnum.getMsgByCode(studentAttendance.getStatus())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            studentAttendanceRespList.add(studentAttendanceResp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resp.setList(studentAttendanceRespList); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    studentAttendanceStatisticsRespList.add(resp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                pageResult.setRecords(studentAttendanceStatisticsRespList); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return PageResponse.success(pageResult); 
														 | 
														
														 | 
														
															         return PageResponse.success(pageResult); 
														 |