|  | @@ -12,7 +12,9 @@ import com.ym.dao.WhiteboardDao;
 | 
	
		
			
				|  |  |  import com.ym.job.ScheduleManager;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.CourseSchedule;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.Teacher;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.SignStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 | 
	
	
		
			
				|  | @@ -71,6 +73,9 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |      private TeacherDao teacherDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | +    private CourseScheduleDao courseScheduleDao;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  |      private TeacherAttendanceService teacherAttendanceService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
	
		
			
				|  | @@ -92,11 +97,12 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          String userId = sysUserFeignService.queryUserInfo().getId().toString();
 | 
	
		
			
				|  |  |          Teacher teacher = teacherDao.get(Integer.parseInt(userId));
 | 
	
		
			
				|  |  | +        CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -            if(teacher == null){
 | 
	
		
			
				|  |  | -                studentAttendanceService.addStudentAttendanceRecord(Integer.parseInt(roomId),Integer.parseInt(userId), StudentAttendanceStatusEnum.NORMAL);
 | 
	
		
			
				|  |  | -            }else {
 | 
	
		
			
				|  |  | +            if(teacher != null && teacher.getId() == courseSchedule.getActualTeacherId()){
 | 
	
		
			
				|  |  |                  teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId),Integer.parseInt(userId), SignStatusEnum.SIGN_IN,true);
 | 
	
		
			
				|  |  | +            }else {
 | 
	
		
			
				|  |  | +                studentAttendanceService.addStudentAttendanceRecord(Integer.parseInt(roomId),Integer.parseInt(userId), StudentAttendanceStatusEnum.NORMAL);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }catch (Exception e){
 | 
	
		
			
				|  |  |              e.printStackTrace();
 | 
	
	
		
			
				|  | @@ -236,14 +242,14 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |          SysUser user = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  |          String userId = user.getId().toString();
 | 
	
		
			
				|  |  |          Teacher teacher = teacherDao.get(user.getId());
 | 
	
		
			
				|  |  | -        if(teacher != null){
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | +        CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            if(teacher != null && teacher.getId() == courseSchedule.getActualTeacherId()){
 | 
	
		
			
				|  |  |                  teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId.substring(4)),user.getId(), SignStatusEnum.SIGN_OUT,true);
 | 
	
		
			
				|  |  | -            }catch (Exception e){
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +        }catch (Exception e){
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  |          CheckUtils.checkArgument(user != null, "user must't be null");
 | 
	
		
			
				|  |  |          CheckUtils.checkArgument(roomId != null, "roomId must't be null");
 | 
	
		
			
				|  |  |          List<Room> roomList = roomDao.findByRid(roomId);
 |