|  | @@ -5,16 +5,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.google.common.collect.Lists;
 | 
	
		
			
				|  |  | +import com.ym.mec.education.base.BaseResponse;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.base.PageResponse;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.entity.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.education.enums.ReturnCodeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.mapper.StudentAttendanceMapper;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.req.AttendClassReq;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.req.ClassGroupReq;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.req.CourseScheduleReq;
 | 
	
		
			
				|  |  | -import com.ym.mec.education.resp.AttendClassResp;
 | 
	
		
			
				|  |  | -import com.ym.mec.education.resp.StudentAttendanceResp;
 | 
	
		
			
				|  |  | -import com.ym.mec.education.resp.StudentAttendanceStatisticsResp;
 | 
	
		
			
				|  |  | +import com.ym.mec.education.req.HomeWorkReq;
 | 
	
		
			
				|  |  | +import com.ym.mec.education.resp.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.service.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.education.utils.DateUtil;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
	
		
			
				|  | @@ -23,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import java.util.ArrayList;
 | 
	
		
			
				|  |  | +import java.util.Arrays;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.Objects;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
	
		
			
				|  | @@ -51,6 +54,12 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private IMusicGroupStudentFeeService musicGroupStudentFeeService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ITeacherAttendanceService teacherAttendanceService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ICourseHomeworkService courseHomeworkService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public PageResponse getPage(ClassGroupReq classGroupReq) {
 | 
	
		
			
				|  |  |          if (Objects.isNull(classGroupReq.getGroupId())) {
 | 
	
	
		
			
				|  | @@ -243,4 +252,71 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
 | 
	
		
			
				|  |  |          return PageResponse.success(pageParam);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public PageResponse callStudent(HomeWorkReq req) {
 | 
	
		
			
				|  |  | +        if(req == null || req.getCourseScheduleId() == null){
 | 
	
		
			
				|  |  | +            return  PageResponse.errorParam();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        PageResponse response = new PageResponse();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        IPage<StudentAttendance> page = new Page<>(req.getPageNo(),req.getPageSize());
 | 
	
		
			
				|  |  | +        IPage<StudentAttendance> studentAttendanceIPage = this.page(page,new QueryWrapper<StudentAttendance>().eq("course_schedule_id_",req.getCourseScheduleId()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<CallStudentResp> callStudentResps = new ArrayList<>();
 | 
	
		
			
				|  |  | +        List<StudentAttendance> studentAttendanceList = studentAttendanceIPage.getRecords();
 | 
	
		
			
				|  |  | +        if(!CollectionUtils.isEmpty(studentAttendanceList)){
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            studentAttendanceList.forEach(e->{
 | 
	
		
			
				|  |  | +                CallStudentResp callStudentResp = new CallStudentResp();
 | 
	
		
			
				|  |  | +                callStudentResp.setUserId(e.getUserId());
 | 
	
		
			
				|  |  | +                SysUser sysUser = userService.getById(e.getUserId());
 | 
	
		
			
				|  |  | +                if(sysUser != null ){
 | 
	
		
			
				|  |  | +                    callStudentResp.setName(sysUser.getRealName());
 | 
	
		
			
				|  |  | +                    callStudentResp.setAvatar(sysUser.getAvatar());
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                callStudentResp.setStatus(e.getStatus());
 | 
	
		
			
				|  |  | +                callStudentResps.add(callStudentResp);
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        response.setTotal(Math.toIntExact(page.getTotal()));
 | 
	
		
			
				|  |  | +        response.setSize(Math.toIntExact(page.getSize()));
 | 
	
		
			
				|  |  | +        response.setCurrent(Math.toIntExact(page.getCurrent()));
 | 
	
		
			
				|  |  | +        response.setRecords(callStudentResps);
 | 
	
		
			
				|  |  | +        response.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
 | 
	
		
			
				|  |  | +        return response;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public BaseResponse signInfo(HomeWorkReq req) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(req == null || req.getCourseScheduleId() == null){
 | 
	
		
			
				|  |  | +            return  BaseResponse.errorParam();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        SignInfoResp signInfoResp = new SignInfoResp();
 | 
	
		
			
				|  |  | +        QueryWrapper<TeacherAttendance> queryWrapper = new QueryWrapper<>();
 | 
	
		
			
				|  |  | +        queryWrapper.eq("course_schedule_id_",req.getCourseScheduleId());
 | 
	
		
			
				|  |  | +        TeacherAttendance teacherAttendance = teacherAttendanceService.getOne(queryWrapper);
 | 
	
		
			
				|  |  | +        if(teacherAttendance != null){
 | 
	
		
			
				|  |  | +            signInfoResp.setSignInTime(DateUtil.date2String(teacherAttendance.getSignInTime(),DateUtil.DATE_FORMAT_DATE));
 | 
	
		
			
				|  |  | +            signInfoResp.setSignOutTime(DateUtil.date2String(teacherAttendance.getSignOutTime(),DateUtil.DATE_FORMAT_DATE));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        QueryWrapper<CourseHomework> queryWrapper1 = new QueryWrapper<>();
 | 
	
		
			
				|  |  | +        queryWrapper1.eq("course_schedule_id_",req.getCourseScheduleId());
 | 
	
		
			
				|  |  | +        CourseHomework courseHomework = courseHomeworkService.getOne(queryWrapper1);
 | 
	
		
			
				|  |  | +        if(courseHomework != null){
 | 
	
		
			
				|  |  | +            signInfoResp.setContent(courseHomework.getContent());
 | 
	
		
			
				|  |  | +            if(courseHomework.getAttachments()!= null){
 | 
	
		
			
				|  |  | +                String[] str = courseHomework.getAttachments().split(",");
 | 
	
		
			
				|  |  | +                signInfoResp.setAttachments(Arrays.asList(str));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return BaseResponse.success(signInfoResp);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  }
 |