|  | @@ -37,7 +37,6 @@ import com.ym.utils.DateTimeUtils;
 | 
											
												
													
														|  |  import com.ym.utils.IdentifierUtils;
 |  |  import com.ym.utils.IdentifierUtils;
 | 
											
												
													
														|  |  import com.ym.whiteboard.WhiteBoardHelper;
 |  |  import com.ym.whiteboard.WhiteBoardHelper;
 | 
											
												
													
														|  |  import lombok.extern.slf4j.Slf4j;
 |  |  import lombok.extern.slf4j.Slf4j;
 | 
											
												
													
														|  | -import lombok.val;
 |  | 
 | 
											
												
													
														|  |  import org.apache.commons.lang3.StringUtils;
 |  |  import org.apache.commons.lang3.StringUtils;
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  |  import org.springframework.data.redis.core.RedisTemplate;
 |  |  import org.springframework.data.redis.core.RedisTemplate;
 | 
											
										
											
												
													
														|  | @@ -115,7 +114,7 @@ public class RoomServiceImpl implements RoomService {
 | 
											
												
													
														|  |          while (true){
 |  |          while (true){
 | 
											
												
													
														|  |              String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 |  |              String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 | 
											
												
													
														|  |              String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 |  |              String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 | 
											
												
													
														|  | -            schedule = courseScheduleDao.getLastCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            schedule = courseScheduleDao.getFirstCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
 | 
											
												
													
														|  |              if(schedule != null){
 |  |              if(schedule != null){
 | 
											
												
													
														|  |                  roomId = schedule.getId().toString();
 |  |                  roomId = schedule.getId().toString();
 | 
											
												
													
														|  |              }else {
 |  |              }else {
 | 
											
										
											
												
													
														|  | @@ -125,6 +124,27 @@ public class RoomServiceImpl implements RoomService {
 | 
											
												
													
														|  |          return Integer.parseInt(roomId);
 |  |          return Integer.parseInt(roomId);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    @Transactional(rollbackFor = Exception.class)
 | 
											
												
													
														|  | 
 |  | +    public String getCloseNetworkRoomTime(CourseSchedule courseSchedule,String continueCourseTime){
 | 
											
												
													
														|  | 
 |  | +        String autoCloseNetworkRoomTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_AFTER_BUFFER_TIME,courseSchedule.getTenantId());
 | 
											
												
													
														|  | 
 |  | +        if(StringUtils.isEmpty(autoCloseNetworkRoomTime)){
 | 
											
												
													
														|  | 
 |  | +            autoCloseNetworkRoomTime = "15";
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        CourseSchedule schedule = courseSchedule;
 | 
											
												
													
														|  | 
 |  | +        //如果当前课程是连堂课,那么获取第一节课的课程编号
 | 
											
												
													
														|  | 
 |  | +        while (true){
 | 
											
												
													
														|  | 
 |  | +            String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 | 
											
												
													
														|  | 
 |  | +            String endClassTime = DateUtil.format(schedule.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 | 
											
												
													
														|  | 
 |  | +            schedule = courseScheduleDao.getLastCourse(schedule.getClassGroupId(),classDate + " " + endClassTime,schedule.getActualTeacherId(),continueCourseTime);
 | 
											
												
													
														|  | 
 |  | +            if(schedule != null){
 | 
											
												
													
														|  | 
 |  | +                autoCloseNetworkRoomTime = DateUtil.minutesBetween(new Date(),schedule.getEndClassTime()) + "";
 | 
											
												
													
														|  | 
 |  | +            }else {
 | 
											
												
													
														|  | 
 |  | +                break;
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        return autoCloseNetworkRoomTime;
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public BaseResponse joinRoom(String roomId) throws Exception {
 |  |      public BaseResponse joinRoom(String roomId) throws Exception {
 | 
											
										
											
												
													
														|  | @@ -163,21 +183,17 @@ public class RoomServiceImpl implements RoomService {
 | 
											
												
													
														|  |              continueCourseTime = "5";
 |  |              continueCourseTime = "5";
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        String autoCloseNetworkRoomTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_AFTER_BUFFER_TIME,courseSchedule.getTenantId());
 |  | 
 | 
											
												
													
														|  | -        if(StringUtils.isEmpty(autoCloseNetworkRoomTime)){
 |  | 
 | 
											
												
													
														|  | -            autoCloseNetworkRoomTime = "15";
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  |          RoomResult roomResult = new RoomResult();
 |  |          RoomResult roomResult = new RoomResult();
 | 
											
												
													
														|  | -        roomResult.setAutoCloseNetworkRoomTime(autoCloseNetworkRoomTime);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        roomResult.setAutoCloseNetworkRoomTime(this.getCloseNetworkRoomTime(courseSchedule,continueCourseTime));
 | 
											
												
													
														|  |          CourseSchedule schedule = courseSchedule;
 |  |          CourseSchedule schedule = courseSchedule;
 | 
											
												
													
														|  |          //如果当前课程是连堂课,那么获取第一节课的课程编号
 |  |          //如果当前课程是连堂课,那么获取第一节课的课程编号
 | 
											
												
													
														|  |          while (true){
 |  |          while (true){
 | 
											
												
													
														|  |              String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 |  |              String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 | 
											
												
													
														|  |              String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 |  |              String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 | 
											
												
													
														|  | -            schedule = courseScheduleDao.getLastCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            schedule = courseScheduleDao.getFirstCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
 | 
											
												
													
														|  |              if(schedule != null){
 |  |              if(schedule != null){
 | 
											
												
													
														|  |                  roomId = schedule.getId().toString();
 |  |                  roomId = schedule.getId().toString();
 | 
											
												
													
														|  | -                roomResult.setAutoCloseFlag(false);
 |  | 
 | 
											
												
													
														|  | 
 |  | +//                roomResult.setAutoCloseFlag(false);
 | 
											
												
													
														|  |              }else {
 |  |              }else {
 | 
											
												
													
														|  |                  break;
 |  |                  break;
 | 
											
												
													
														|  |              }
 |  |              }
 |