zouxuan hace 4 años
padre
commit
6926cb4196

+ 1 - 0
mec-im/src/main/java/com/ym/common/ErrorEnum.java

@@ -17,6 +17,7 @@ public enum ErrorEnum {
     ERR_IM_TOKEN_ERROR(10, "IM token error"),
     ERR_CREATE_ROOM_ERROR(11, "Create room error"),
     ERR_JOIN_ROOM_ERROR(12, "Join room error"),
+    JOIN_ROOM_ERROR(35, "Join room error"),
     ERR_MESSAGE_ERROR(13, "IM Message send error"),
 
 

+ 4 - 0
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -22,6 +22,7 @@ import com.ym.mec.biz.dal.entity.TeacherAttendance;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.SignStatusEnum;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.TeacherAttendanceService;
@@ -124,6 +125,9 @@ public class RoomServiceImpl implements RoomService {
         String userId = sysUser.getId().toString();
         Teacher teacher = teacherDao.get(Integer.parseInt(userId));
         CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
+        if(courseSchedule.getTeachMode() == TeachModeEnum.OFFLINE){
+            throw new ApiException(ErrorEnum.JOIN_ROOM_ERROR, "加入房间失败,请前往线下教室");
+        }
         if(teacher != null && userId.equals(courseSchedule.getActualTeacherId())){
             courseScheduleStudentPaymentDao.adjustPlayMidi(Long.parseLong(roomId),null,null);
             userName = sysUser.getRealName();