|  | @@ -5,12 +5,10 @@ import com.yonge.cooleshow.biz.dal.dto.CourseHomeworkReviewDto;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.dto.CourseHomeworkSaveDto;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.dto.CourseScheduleHomeworkSearch;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.TeacherAttendance;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 | 
	
		
			
				|  |  | -import com.yonge.cooleshow.biz.dal.service.CourseHomeworkService;
 | 
	
		
			
				|  |  | -import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 | 
	
		
			
				|  |  | -import com.yonge.cooleshow.biz.dal.service.ImGroupService;
 | 
	
		
			
				|  |  | -import com.yonge.cooleshow.biz.dal.service.SysUserService;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.service.*;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.vo.CountVo;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.vo.CourseHomeworkDetailVo;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo;
 | 
	
	
		
			
				|  | @@ -30,6 +28,7 @@ import javax.annotation.Resource;
 | 
	
		
			
				|  |  |  import javax.validation.Valid;
 | 
	
		
			
				|  |  |  import java.util.ArrayList;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Objects;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * Description 老师课后作业相关接口
 | 
	
	
		
			
				|  | @@ -44,15 +43,14 @@ public class CourseHomeworkController extends BaseController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private SysUserService sysUserService;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private CourseScheduleService courseScheduleService;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private CourseHomeworkService courseHomeworkService;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private ImGroupService imGroupService;
 | 
	
		
			
				|  |  | +    @Resource
 | 
	
		
			
				|  |  | +    private TeacherAttendanceService teacherAttendanceService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "未布置的课后作业数量")
 | 
	
		
			
				|  |  |      @GetMapping(value="/count")
 | 
	
	
		
			
				|  | @@ -77,12 +75,16 @@ public class CourseHomeworkController extends BaseController {
 | 
	
		
			
				|  |  |      public HttpResponseResult<CourseHomeworkDetailVo> detail(@ApiParam(value = "课程编号ID", required = true)
 | 
	
		
			
				|  |  |                                                                   @PathVariable("courseId") Long courseId,
 | 
	
		
			
				|  |  |                                                               @PathVariable("studentId") Long studentId) {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HttpResponseResult info = checkCourseSchedule(courseId,sysUserService.getUserId());
 | 
	
		
			
				|  |  | +        Long userId = sysUserService.getUserId();
 | 
	
		
			
				|  |  | +        HttpResponseResult info = checkCourseSchedule(courseId,userId);
 | 
	
		
			
				|  |  |          if (info != null) return info;
 | 
	
		
			
				|  |  |          CourseHomeworkDetailVo detailVo = courseHomeworkService.getCourseHomeworkDetailByCourseId(courseId, studentId);
 | 
	
		
			
				|  |  |          if (detailVo != null) {
 | 
	
		
			
				|  |  |              detailVo.setImUserId(imGroupService.getImUserId(String.valueOf(detailVo.getStudentId()),ClientEnum.STUDENT.name()));
 | 
	
		
			
				|  |  | +            //获取老师考勤信息
 | 
	
		
			
				|  |  | +            TeacherAttendance one = teacherAttendanceService.lambdaQuery().eq(TeacherAttendance::getCourseScheduleId, courseId)
 | 
	
		
			
				|  |  | +                    .eq(TeacherAttendance::getTeacherId, userId).last("limit 1").one();
 | 
	
		
			
				|  |  | +            detailVo.setAttendanceStatus(Objects.nonNull(one));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          return succeed(detailVo);
 |