Procházet zdrojové kódy

修改点名详情 考勤统计入参

肖玮 před 5 roky
rodič
revize
e8f1dd4026

+ 0 - 13
mec-education/src/main/java/com/ym/mec/education/controller/App.java

@@ -1,13 +0,0 @@
-package com.ym.mec.education.controller;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 5 - 8
mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java

@@ -2,9 +2,7 @@ package com.ym.mec.education.controller;
 
 import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.base.PageResponse;
-import com.ym.mec.education.enums.ReturnCodeEnum;
 import com.ym.mec.education.req.ClassGroupReq;
-import com.ym.mec.education.req.CourseScheduleReq;
 import com.ym.mec.education.resp.CourseScheduleResp;
 import com.ym.mec.education.service.ICourseScheduleService;
 import io.swagger.annotations.Api;
@@ -16,7 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import java.util.Objects;
 
 /**
  * @program: mec
@@ -39,15 +36,15 @@ public class CourseScheduleController {
         return courseScheduleService.getPage(classGroupReq);
     }
 
-    @PostMapping("/info")
+    @PostMapping("/infoByGroupId")
     @ApiOperation("点名详情-头信息")
-    public BaseResponse<CourseScheduleResp> getInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
-        return courseScheduleService.getInfo(courseScheduleReq);
+    public BaseResponse<CourseScheduleResp> getInfoByGroupId(@RequestBody ClassGroupReq courseScheduleReq) {
+        return courseScheduleService.getInfoByGroupId(courseScheduleReq);
     }
 
     @PostMapping("/statisticsInfo")
     @ApiOperation("历史考勤统计-头信息")
-    public BaseResponse getStatisticsInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
-        return courseScheduleService.getStatisticsInfo(courseScheduleReq);
+    public BaseResponse getStatisticsInfo(@RequestBody ClassGroupReq classGroupReq) {
+        return courseScheduleService.getStatisticsInfo(classGroupReq);
     }
 }

+ 5 - 6
mec-education/src/main/java/com/ym/mec/education/controller/StudentAttendanceController.java

@@ -2,7 +2,6 @@ package com.ym.mec.education.controller;
 
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.req.ClassGroupReq;
-import com.ym.mec.education.req.CourseScheduleReq;
 import com.ym.mec.education.service.IStudentAttendanceService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -34,16 +33,16 @@ public class StudentAttendanceController {
         return studentAttendanceService.getPage(classGroupReq);
     }
 
-    @PostMapping("/listByCourse")
+    @PostMapping("/listRollCall")
     @ApiOperation("点名详情-考勤列表")
-    public PageResponse listByCourse(@RequestBody CourseScheduleReq courseScheduleReq) {
-        return studentAttendanceService.getPageByCourse(courseScheduleReq);
+    public PageResponse listRollCall(@RequestBody ClassGroupReq classGroupReq) {
+        return studentAttendanceService.getPageRollCall(classGroupReq);
     }
 
     @PostMapping("/statisticsList")
     @ApiOperation("历史考勤统计-考勤列表")
-    public PageResponse statisticsList(@RequestBody CourseScheduleReq courseScheduleReq) {
-        return studentAttendanceService.statisticsList(courseScheduleReq);
+    public PageResponse statisticsList(@RequestBody ClassGroupReq classGroupReq) {
+        return studentAttendanceService.statisticsList(classGroupReq);
     }
 
 }

+ 2 - 2
mec-education/src/main/java/com/ym/mec/education/resp/StudentAttendanceResp.java

@@ -9,12 +9,12 @@ import java.util.List;
 
 /**
  * @program: mec
- * @description: 考勤出参
+ * @description: 学生考勤出参
  * @author: xw
  * @create: 2019-09-26 15:24
  */
 @Data
-@ApiModel(description = "考勤出参")
+@ApiModel(description = "学生考勤出参")
 @Accessors(chain = true)
 public class StudentAttendanceResp implements Serializable {
 

+ 4 - 4
mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java

@@ -26,15 +26,15 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
 
     /**
      * 根据课程计划id获取课程计划详情
-     * @param courseScheduleReq
+     * @param classGroupReq
      * @return
      */
-    BaseResponse getInfo(CourseScheduleReq courseScheduleReq);
+    BaseResponse getInfoByGroupId(ClassGroupReq classGroupReq);
 
     /**
      * 历史考勤统计-头信息
-     * @param courseScheduleReq
+     * @param classGroupReq
      * @return
      */
-    BaseResponse getStatisticsInfo(CourseScheduleReq courseScheduleReq);
+    BaseResponse getStatisticsInfo(ClassGroupReq classGroupReq);
 }

+ 13 - 3
mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.StudentAttendance;
 import com.ym.mec.education.req.ClassGroupReq;
-import com.ym.mec.education.req.CourseScheduleReq;
 
 /**
  * <p>
@@ -18,8 +17,19 @@ public interface IStudentAttendanceService extends IService<StudentAttendance> {
 
     PageResponse getPage(ClassGroupReq classGroupReq);
 
-    PageResponse getPageByCourse(CourseScheduleReq courseScheduleReq);
+    /**
+     * 点名详情-学生考勤列表
+     *
+     * @param classGroupReq
+     * @return
+     */
+    PageResponse getPageRollCall(ClassGroupReq classGroupReq);
 
-    PageResponse statisticsList(CourseScheduleReq courseScheduleReq);
+    /**
+     * 历史考勤统计-列表
+     * @param classGroupReq
+     * @return
+     */
+    PageResponse statisticsList(ClassGroupReq classGroupReq);
 
 }

+ 35 - 19
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java

@@ -12,7 +12,6 @@ import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.education.enums.TeachTypeEnum;
 import com.ym.mec.education.mapper.CourseScheduleMapper;
 import com.ym.mec.education.req.ClassGroupReq;
-import com.ym.mec.education.req.CourseScheduleReq;
 import com.ym.mec.education.resp.CourseScheduleResp;
 import com.ym.mec.education.service.*;
 import com.ym.mec.education.utils.DateUtil;
@@ -21,6 +20,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
+
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
@@ -95,12 +95,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     }
 
     @Override
-    public BaseResponse<CourseScheduleResp> getInfo(CourseScheduleReq courseScheduleReq) {
-        if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) {
+    public BaseResponse<CourseScheduleResp> getInfoByGroupId(ClassGroupReq classGroupReq) {
+        if (Objects.isNull(classGroupReq.getGroupId())) {
             return BaseResponse.errorParam();
         }
-        CourseSchedule courseSchedule = getById(courseScheduleReq.getCourseScheduleId());
         CourseScheduleResp courseScheduleResp = new CourseScheduleResp();
+        CourseSchedule courseSchedule = getLastCourseSchedule(classGroupReq.getGroupId());
         if (Objects.nonNull(courseSchedule)) {
             if (Objects.nonNull(courseSchedule.getClassDate())) {
                 courseScheduleResp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate()) + "(" +
@@ -116,7 +116,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
                         ifPresent(sysUser -> courseScheduleResp.setTeacher(sysUser.getRealName()));
             }
             QueryWrapper<StudentAttendance> studentAttendanceQueryWrapper = new QueryWrapper<>();
-            studentAttendanceQueryWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId())
+            studentAttendanceQueryWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId())
                     .orderByDesc(true, StudentAttendance::getCreateTime);
             List<StudentAttendance> studentAttendanceList = studentAttendanceService.list(studentAttendanceQueryWrapper);
             if (!CollectionUtils.isEmpty(studentAttendanceList)) {
@@ -128,11 +128,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
             //总人数
             Integer totalCount = count();
             //请假
-            leaveWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId())
+            leaveWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId())
                     .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode());
             Integer leaveCount = studentAttendanceService.count(leaveWrapper);
             //正常
-            normalWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId())
+            normalWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId())
                     .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.NORMAL.getCode());
             Integer normalCount = studentAttendanceService.count(normalWrapper);
             courseScheduleResp.setLeaveNum(leaveCount);
@@ -144,21 +144,18 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     }
 
     @Override
-    public BaseResponse getStatisticsInfo(CourseScheduleReq courseScheduleReq) {
-        if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) {
+    public BaseResponse getStatisticsInfo(ClassGroupReq classGroupReq) {
+        if (Objects.isNull(classGroupReq.getGroupId())) {
             return BaseResponse.errorParam();
         }
-        CourseSchedule courseSchedule = getById(courseScheduleReq.getCourseScheduleId());
+        ClassGroup classGroup = groupService.getById(classGroupReq.getGroupId());
         CourseScheduleResp courseScheduleResp = new CourseScheduleResp();
-        if (Objects.nonNull(courseSchedule)) {
-            ClassGroup classGroup = groupService.getById(courseSchedule.getClassGroupId());
-            if (Objects.nonNull(classGroup)) {
-                if (Objects.nonNull(classGroup.getCurrentClassTimes()) && Objects.nonNull(classGroup.getTotalClassTimes())) {
-                    courseScheduleResp.setAlreadyInClass(classGroup.getCurrentClassTimes() + "/" + classGroup.getTotalClassTimes());
-                }
-                if (Objects.nonNull(classGroup.getStudentNum())) {
-                    courseScheduleResp.setStudentNum(classGroup.getStudentNum());
-                }
+        if (Objects.nonNull(classGroup)) {
+            if (Objects.nonNull(classGroup.getCurrentClassTimes()) && Objects.nonNull(classGroup.getTotalClassTimes())) {
+                courseScheduleResp.setAlreadyInClass(classGroup.getCurrentClassTimes() + "/" + classGroup.getTotalClassTimes());
+            }
+            if (Objects.nonNull(classGroup.getStudentNum())) {
+                courseScheduleResp.setStudentNum(classGroup.getStudentNum());
             }
             //退团人数
             QueryWrapper<MusicGroupQuit> musicGroupQuitQueryWrapper = new QueryWrapper<>();
@@ -168,4 +165,23 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
         }
         return BaseResponse.success(courseScheduleResp);
     }
+
+    /**
+     * 获取最新的课表记录
+     * @param classGroupId
+     * @return
+     */
+    public CourseSchedule getLastCourseSchedule(Integer classGroupId) {
+        QueryWrapper<CourseSchedule> courseScheduleQueryWrapper = new QueryWrapper<>();
+        courseScheduleQueryWrapper.lambda().eq(true, CourseSchedule::getClassGroupId, classGroupId)
+                .orderByDesc(true, CourseSchedule::getCreateTime);
+        List<CourseSchedule> courseScheduleList = list(courseScheduleQueryWrapper);
+        if (!CollectionUtils.isEmpty(courseScheduleList)) {
+            Optional<CourseSchedule> first = courseScheduleList.stream().findFirst();
+            if (first.isPresent()) {
+                return first.get();
+            }
+        }
+        return null;
+    }
 }

+ 77 - 83
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

@@ -11,7 +11,6 @@ import com.ym.mec.education.entity.*;
 import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.education.mapper.StudentAttendanceMapper;
 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.StudentAttendanceStatisticsResp;
 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.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-
 import java.util.List;
 import java.util.Objects;
-import java.util.Optional;
 
 /**
  * <p>
@@ -101,14 +98,14 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
     }
 
     @Override
-    public PageResponse getPageByCourse(CourseScheduleReq courseScheduleReq) {
-        if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) {
+    public PageResponse getPageRollCall(ClassGroupReq classGroupReq) {
+        if (Objects.isNull(classGroupReq.getGroupId())) {
             return PageResponse.errorParam();
         }
         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.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId());
+        queryWrapper.lambda().eq(true, StudentAttendance::getClassGroupId, classGroupReq.getGroupId());
         IPage<StudentAttendance> page = page(studentAttendancePage, queryWrapper);
         if (!CollectionUtils.isEmpty(page.getRecords())) {
             List<StudentAttendanceResp> list = Lists.newArrayList();
@@ -131,87 +128,84 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
     }
 
     @Override
-    public PageResponse statisticsList(CourseScheduleReq courseScheduleReq) {
-        if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) {
+    public PageResponse statisticsList(ClassGroupReq classGroupReq) {
+        if (Objects.isNull(classGroupReq.getGroupId())) {
             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();
-        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);