zouxuan 4 年之前
父節點
當前提交
931e73de1d

+ 71 - 65
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -518,13 +518,15 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 			}*/
         } else if (signStatusEnum == SignStatusEnum.SIGN_OUT) {
+            studentAttendance.setStatus(statusEnum);
+            studentAttendance.setSignOutTime(date);
             String classDate = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
-            String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+//            String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
             String endClassTime = DateUtil.format(courseSchedule.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
             //上课时间
-            Date classStartDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+//            Date classStartDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
             Date classEndDateTime = DateUtil.stringToDate(classDate + " " + endClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-            if (DateUtil.minutesBetween(classEndDateTime, date) >= 0) {
+            if (DateUtil.minutesBetween(classEndDateTime, date) > 0) {
                 String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
                 if (StringUtils.isEmpty(continueCourseTime)) {
                     continueCourseTime = "5";
@@ -543,80 +545,84 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
                         break;
                     }
                 }
-                if (courseSchedules.size() > 0) {
-                    //获取总上课时长
-                    int totalMinutes = DateUtil.minutesBetween(classStartDateTime, date);
-                    //减去第一节课时长
-                    int firstMinutes = courseScheduleDao.getSingleClassMinutes(courseScheduleId.longValue());
-                    totalMinutes -= firstMinutes;
-                    if (totalMinutes > 0) {
-                        String courseClassDate;
-                        String courseStartDateTime;
-                        String courseEndDateTime;
-                        for (int i = 0; i < courseSchedules.size(); i++) {
-                            courseClassDate = DateUtil.format(courseSchedules.get(i).getClassDate(), DateUtil.DEFAULT_PATTERN);
-                            courseStartDateTime = DateUtil.format(courseSchedules.get(i).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-                            courseEndDateTime = DateUtil.format(courseSchedules.get(i).getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-                            Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-                            Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-                            StudentAttendance byStatusAndCourseScheduleId = studentAttendanceDao.findByStatusAndCourseScheduleId(userId, courseSchedules.get(i).getId().intValue());
-                            Date signOutTime = date;
-                            if (date.before(startDateTime)) {
-                                continue;
-                            }
-                            if (i < courseSchedules.size() - 1 && date.after(endDateTime)) {
-                                //不是最后一节连堂课,并且签退时间大于课程结束时间,签退时间等于课程结束时间
-                                signOutTime = endDateTime;
-                            }
-                            if (byStatusAndCourseScheduleId != null) {
-                                if (byStatusAndCourseScheduleId.getSignOutTime() != null) {
-                                    continue;
+                if(courseSchedules.size() > 0){
+                    String courseClassDate;
+                    String courseStartDateTime;
+                    String courseEndDateTime;
+                    String format2 = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
+                    String format3 = DateUtil.format(courseSchedule.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+                    Date date1 = DateUtil.stringToDate(format2 + " " + format3, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+                    studentAttendance.setSignOutTime(date1);
+                    for (int i = 0; i < courseSchedules.size(); i++) {
+                        courseClassDate = DateUtil.format(courseSchedules.get(i).getClassDate(), DateUtil.DEFAULT_PATTERN);
+                        courseStartDateTime = DateUtil.format(courseSchedules.get(i).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+                        Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+                        //如果是接下来的第一节连堂课,并且签退时间不大于课程开始时间,那么跳出循环
+                        if(i == 0 && !date.after(startDateTime)){
+                            studentAttendance.setSignOutTime(date);
+                            break;
+                        }
+                        courseEndDateTime = DateUtil.format(courseSchedules.get(i).getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+                        Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+
+                        //不是最后一节课
+                        if(i < courseSchedules.size() - 1){
+                            //大于课程结束时间
+                            if(date.after(endDateTime)){
+                                String format = DateUtil.format(courseSchedules.get(i + 1).getClassDate(), DateUtil.DEFAULT_PATTERN);
+                                String format1 = DateUtil.format(courseSchedules.get(i + 1).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+                                Date stringToDate = DateUtil.stringToDate(format + " " + format1, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+                                //大于下一节课开始时间
+                                if(date.after(stringToDate)){
+                                    //当前课程签退时间为课程结束时间
+                                    upsetAttendance(userId,startDateTime,endDateTime,courseSchedules.get(i));
+                                }else {
+                                    //当前课程签退时间为退出时间
+                                    upsetAttendance(userId,startDateTime,date,courseSchedules.get(i));
                                 }
-                                if (byStatusAndCourseScheduleId.getSignInTime() != null) {
-                                    startDateTime = null;
+                            }else {
+                                if(date.after(startDateTime)){
+                                    //小于课程结束时间
+                                    upsetAttendance(userId,startDateTime,date,courseSchedules.get(i));
                                 }
-                                byStatusAndCourseScheduleId.setSignInTime(startDateTime);
-                                byStatusAndCourseScheduleId.setSignOutTime(signOutTime);
-                                byStatusAndCourseScheduleId.setStatus(statusEnum);
-                                byStatusAndCourseScheduleId.setUpdateTime(date);
-                                studentAttendanceDao.update(byStatusAndCourseScheduleId);
-                            } else {
-                                byStatusAndCourseScheduleId = new StudentAttendance();
-                                byStatusAndCourseScheduleId.setSignOutTime(signOutTime);
-                                byStatusAndCourseScheduleId.setStatus(statusEnum);
-                                byStatusAndCourseScheduleId.setSignInTime(startDateTime);
-                                byStatusAndCourseScheduleId.setUpdateTime(date);
-                                byStatusAndCourseScheduleId.setUserId(userId);
-                                byStatusAndCourseScheduleId.setTeacherId(courseSchedule.getActualTeacherId());
-                                byStatusAndCourseScheduleId.setClassGroupId(courseSchedules.get(i).getClassGroupId());
-                                byStatusAndCourseScheduleId.setCourseScheduleId(courseSchedules.get(i).getId());
-                                byStatusAndCourseScheduleId.setMusicGroupId(courseSchedules.get(i).getMusicGroupId());
-                                byStatusAndCourseScheduleId.setGroupType(courseSchedules.get(i).getGroupType());
-                                byStatusAndCourseScheduleId.setCurrentClassTimes(classGroup.getCurrentClassTimes() + 1);
-                                studentAttendanceDao.insert(byStatusAndCourseScheduleId);
+                                break;
                             }
-                            if (studentAttendance.getSignOutTime() == null) {
-                                studentAttendance.setStatus(statusEnum);
-                                studentAttendance.setSignOutTime(classEndDateTime);
+                        }else {
+                            if(date.after(startDateTime)){
+                                //小于课程结束时间
+                                upsetAttendance(userId,startDateTime,date,courseSchedules.get(i));
                             }
                         }
                     }
-                } else {
-                    studentAttendance.setStatus(statusEnum);
-                    studentAttendance.setSignOutTime(date);
                 }
-                if (studentAttendance.getSignOutTime() == null) {
-                    studentAttendance.setStatus(statusEnum);
-                    studentAttendance.setSignOutTime(date);
-                }
-            } else {
-                studentAttendance.setStatus(statusEnum);
-                studentAttendance.setSignOutTime(date);
             }
         }
         studentAttendanceDao.update(studentAttendance);
     }
 
+    public void upsetAttendance(Integer userId,Date signInTime,Date signOutTime,CourseSchedule courseSchedule){
+        StudentAttendance studentAttendance = studentAttendanceDao.findByStatusAndCourseScheduleId(userId, courseSchedule.getId().intValue());
+        if(studentAttendance == null){
+            studentAttendance = new StudentAttendance();
+            studentAttendance.setSignOutTime(signOutTime);
+            studentAttendance.setStatus(StudentAttendanceStatusEnum.NORMAL);
+            studentAttendance.setSignInTime(signInTime);
+            studentAttendance.setUserId(userId);
+            studentAttendance.setTeacherId(courseSchedule.getActualTeacherId());
+            studentAttendance.setClassGroupId(courseSchedule.getClassGroupId());
+            studentAttendance.setCourseScheduleId(courseSchedule.getId());
+            studentAttendance.setMusicGroupId(courseSchedule.getMusicGroupId());
+            studentAttendance.setGroupType(courseSchedule.getGroupType());
+            studentAttendanceDao.insert(studentAttendance);
+        }else {
+            studentAttendance.setSignOutTime(signOutTime);
+            studentAttendance.setStatus(StudentAttendanceStatusEnum.NORMAL);
+            studentAttendance.setSignInTime(signInTime);
+            studentAttendanceDao.update(studentAttendance);
+        }
+
+    }
+
     @Override
     public PageInfo<StudentAttendance> findStudentAttendance(QueryInfo queryInfo) {
         PageInfo<StudentAttendance> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());

+ 86 - 75
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -276,13 +276,9 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		Date classEndDateTime = DateUtil.stringToDate(classDate + " " + endClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
 //		Date classEndDateAdd60Minutes = DateUtil.addMinutes(classEndDateTime, 60);
 //		Date classEndDateCut10Minutes = DateUtil.addMinutes(classEndDateTime, -10);
-		Date add1Minutes = DateUtil.addMinutes(classStartDateTime, -1);
+
 //		Date add60Minutes = DateUtil.addMinutes(classStartDateTime, -60);
 		//签到
-		String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
-		if(StringUtils.isEmpty(continueCourseTime)){
-			continueCourseTime = "5";
-		}
 		if(teacherAttendance.getSignInTime() == null && SignStatusEnum.SIGN_IN.equals(signStatus)){
 			YesOrNoEnum yesOrNoEnum = courseScheduleService.enableOnlyNormalAttendance(courseSchedule.getStartClassTime(),
 					userId.longValue(),
@@ -291,33 +287,30 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			teacherAttendance.setSignInTime(date);
 			teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
 			teacherAttendance.setCurrentClassTimes(classGroup.getCurrentClassTimes() + 1);
-			boolean isSign = false;
-			if(yesOrNoEnum == YesOrNoEnum.YES){
-				isSign = true;
-			}else if(DateUtil.minutesBetween(date,add1Minutes) > 0){
-				//正常签到范围(开始之前)
-				isSign = true;
-			}else {
-				//异常签到范围(开始之后)
-				isSign = true;
+			Date add1Minutes = DateUtil.addMinutes(classStartDateTime, -1);
+			if(yesOrNoEnum != YesOrNoEnum.YES && DateUtil.minutesBetween(date,add1Minutes) <= 0){
 				teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
 			}
-			if(isSign){
-				teacherAttendanceDao.update(teacherAttendance);
-				if(courseSchedule.getTeachMode() == TeachModeEnum.ONLINE){
-					//获取所有当前课程的学生列表
-					Map<Integer,String> userMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(courseScheduleDao.findStudentMap(courseScheduleId))),HashMap.class);
-					if(userMap != null && userMap.size() > 0){
-						String name = subjectDao.findNames(classGroup.getSubjectIdList());
-						sysMessageService.batchSendMessage(MessageSender.JIGUANG,MessageTypeEnum.STUDENT_PUSH_ONLINE_COURSE_ACTION,userMap,
-								null,0,"6?sealClassId=" + courseScheduleId + "&subjectName=" + name ,"STUDENT",courseSchedule.getName());
-					}
+			teacherAttendanceDao.update(teacherAttendance);
+			if(courseSchedule.getTeachMode() == TeachModeEnum.ONLINE){
+				//获取所有当前课程的学生列表
+				Map<Integer,String> userMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(courseScheduleDao.findStudentMap(courseScheduleId))),HashMap.class);
+				if(userMap != null && userMap.size() > 0){
+					String name = subjectDao.findNames(classGroup.getSubjectIdList());
+					sysMessageService.batchSendMessage(MessageSender.JIGUANG,MessageTypeEnum.STUDENT_PUSH_ONLINE_COURSE_ACTION,userMap,
+							null,0,"6?sealClassId=" + courseScheduleId + "&subjectName=" + name ,"STUDENT",courseSchedule.getName());
 				}
 			}
 		}
 		//签退
 		if(SignStatusEnum.SIGN_OUT.equals(signStatus)){
-			if(DateUtil.minutesBetween(classEndDateTime,date) >= 0){
+			teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
+			teacherAttendance.setSignOutTime(date);
+			if(DateUtil.minutesBetween(classEndDateTime,date) > 0){
+				String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
+				if(StringUtils.isEmpty(continueCourseTime)){
+					continueCourseTime = "5";
+				}
 				List<CourseSchedule> courseSchedules = new ArrayList<>();
 				CourseSchedule cs = courseSchedule;
 				while (true){
@@ -334,62 +327,57 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 					}
 				}
 				if(courseSchedules.size() > 0){
-					//获取总上课时长
-					int totalMinutes = DateUtil.minutesBetween(classStartDateTime, date);
-					//减去第一节课时长
-					int firstMinutes = courseScheduleDao.getSingleClassMinutes(courseScheduleId.longValue());
-					totalMinutes -= firstMinutes;
-					if(totalMinutes > 0){
-						String courseClassDate;
-						String courseStartDateTime;
-						String courseEndDateTime;
-						for (int i = 0; i < courseSchedules.size(); i++) {
-							courseClassDate = DateUtil.format(courseSchedules.get(i).getClassDate(), DateUtil.DEFAULT_PATTERN);
-							courseStartDateTime = DateUtil.format(courseSchedules.get(i).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-							courseEndDateTime = DateUtil.format(courseSchedules.get(i).getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-							Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-							Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-							Date signOutTime = date;
-							if(date.before(startDateTime)){
-								continue;
-							}
-							if(i < courseSchedules.size() - 1 && date.after(endDateTime)){
-								//不是最后一节连堂课,并且签退时间大于课程结束时间,签退时间等于课程结束时间
-								signOutTime = endDateTime;
-							}
-							//如果签退时间大于课程结束时间
-							//如果当前课程没有签退记录,那么正常更新
-							TeacherAttendance personalAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(userId.longValue(),courseSchedules.get(i).getId());
-							if(personalAttendance != null && personalAttendance.getSignOutStatus() == YesOrNoEnum.NO){
-								continue;
-							}
-							//如果当前课程有签到时间,那么只更新签退时间和状态
-							if(personalAttendance.getSignInTime() != null){
-								startDateTime = null;
-							}
-							if(personalAttendance.getSignOutTime() != null){
-								continue;
-							}
+					String courseClassDate;
+					String courseStartDateTime;
+					String courseEndDateTime;
+					String format2 = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
+					String format3 = DateUtil.format(courseSchedule.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+					Date date1 = DateUtil.stringToDate(format2 + " " + format3, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+					teacherAttendance.setSignOutTime(date1);
+					for (int i = 0; i < courseSchedules.size(); i++) {
+						courseClassDate = DateUtil.format(courseSchedules.get(i).getClassDate(), DateUtil.DEFAULT_PATTERN);
+						courseStartDateTime = DateUtil.format(courseSchedules.get(i).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+						Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+
+						//如果是接下来的第一节连堂课,并且签退时间不大于课程开始时间,那么跳出循环
+						if(i == 0 && !date.after(startDateTime)){
+							teacherAttendance.setSignOutTime(date);
+							break;
+						}
+						courseEndDateTime = DateUtil.format(courseSchedules.get(i).getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+						Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+						//不是最后一节课
+						if(i < courseSchedules.size() - 1){
+							//大于课程结束时间
 							if(date.after(endDateTime)){
-								teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),startDateTime,signOutTime,1);
-							}else if (date.equals(endDateTime)){
-								teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),startDateTime,signOutTime,1);
+								String format = DateUtil.format(courseSchedules.get(i + 1).getClassDate(), DateUtil.DEFAULT_PATTERN);
+								String format1 = DateUtil.format(courseSchedules.get(i + 1).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+								Date stringToDate = DateUtil.stringToDate(format + " " + format1, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+								//大于下一节课开始时间
+								if(date.after(stringToDate)){
+									//当前课程签退时间为课程结束时间
+									upsetAttendance(userId,startDateTime,endDateTime,YesOrNoEnum.YES,courseSchedules.get(i));
+								}else {
+									//当前课程签退时间为退出时间
+									upsetAttendance(userId,startDateTime,date,YesOrNoEnum.YES,courseSchedules.get(i));
+								}
 							}else {
-								teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),startDateTime,signOutTime,0);
+								if(date.after(startDateTime)){
+									//小于课程结束时间,异常签退
+									upsetAttendance(userId,startDateTime,date,YesOrNoEnum.NO,courseSchedules.get(i));
+								}
+								break;
 							}
-							if(teacherAttendance.getSignOutTime() == null){
-								teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
-								teacherAttendance.setSignOutTime(classEndDateTime);
+						}else {
+							if(date.after(startDateTime)){
+								if(date.after(endDateTime)){
+									upsetAttendance(userId,startDateTime,date,YesOrNoEnum.YES,courseSchedules.get(i));
+								}else {
+									upsetAttendance(userId,startDateTime,date,YesOrNoEnum.NO,courseSchedules.get(i));
+								}
 							}
 						}
 					}
-				}else {
-					teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
-					teacherAttendance.setSignOutTime(date);
-				}
-				if(teacherAttendance.getSignOutTime() == null){
-					teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
-					teacherAttendance.setSignOutTime(date);
 				}
 			}else {
 				teacherAttendance.setSignOutStatus(YesOrNoEnum.NO);
@@ -399,6 +387,29 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		}
 	}
 
+	public void upsetAttendance(Integer userId,Date signInTime,Date signOutTime,YesOrNoEnum status,CourseSchedule courseSchedule){
+		TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(userId.longValue(),courseSchedule.getId());
+		if(teacherAttendance == null){
+			teacherAttendance = new TeacherAttendance();
+			teacherAttendance.setGroupType(courseSchedule.getGroupType());
+			teacherAttendance.setTeacherId(userId);
+			teacherAttendance.setMusicGroupId(courseSchedule.getMusicGroupId());
+			teacherAttendance.setClassGroupId(courseSchedule.getClassGroupId());
+			teacherAttendance.setCourseScheduleId(courseSchedule.getId());
+			teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
+			teacherAttendance.setSignOutStatus(status);
+			teacherAttendance.setSignOutTime(signOutTime);
+			teacherAttendance.setSignInTime(signInTime);
+			teacherAttendanceDao.insert(teacherAttendance);
+		}else {
+			teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
+			teacherAttendance.setSignOutStatus(status);
+			teacherAttendance.setSignOutTime(signOutTime);
+			teacherAttendance.setSignInTime(signInTime);
+			teacherAttendanceDao.update(teacherAttendance);
+		}
+	}
+
 	@Override
 	public PageInfo getTeacherPersonalAttendances(TeacherCloseQueryInfo queryInfo) {
 		PageInfo<TeacherPersonalAttendanceDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3090,7 +3090,7 @@
         WHERE cs.class_group_id_ = #{classGroupId}
         AND TIMESTAMPDIFF(MINUTE, CONCAT(cs.class_date_," ",cs.end_class_time_),#{startTime}) &lt;= #{continueCourseTime}
         AND TIMESTAMPDIFF(MINUTE, CONCAT(cs.class_date_," ",cs.end_class_time_),#{startTime}) >= 0
-        AND cs.actual_teacher_id_ = #{teacherId} AND ta.sign_in_time_ IS NOT NULL AND sa.id_ IS NOT NULL
+        AND cs.actual_teacher_id_ = #{teacherId} AND (ta.sign_in_time_ IS NOT NULL OR sa.id_ IS NOT NULL)
         ORDER BY cs.class_date_ DESC,cs.end_class_time_ DESC
         LIMIT 1
     </select>

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -40,7 +40,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentAttendance" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_attendance
-        (group_type_,music_group_id_,class_group_id_,course_schedule_id_,user_id_,teacher_id_,status_,create_time_,update_time_,remark_,current_class_times_,sign_in_time_,sign_out_time_)
+        (group_type_,music_group_id_,class_group_id_,course_schedule_id_,user_id_,teacher_id_,status_,create_time_,
+        update_time_,remark_,current_class_times_,sign_in_time_,sign_out_time_)
         VALUES(#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{classGroupId},
         #{courseScheduleId},#{userId},#{teacherId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),
         #{remark},#{currentClassTimes},#{signInTime},#{signOutTime})
@@ -102,7 +103,7 @@
             <if test="currentClassTimes != null">
                 current_class_times_ = #{currentClassTimes},
             </if>
-            update_time_=NOW()
+            update_time_ = NOW()
         </set>
         WHERE id_ = #{id}
     </update>

+ 43 - 57
mec-im/src/main/java/com/ym/controller/RoomController.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.common.ApiException;
 import com.ym.common.BaseResponse;
 import com.ym.common.ErrorEnum;
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.pojo.*;
 import com.ym.service.MessageService;
 import com.ym.service.RoomService;
@@ -25,32 +24,25 @@ public class RoomController{
     RoomService roomService;
     @Autowired
     MessageService messageService;
-    @Autowired
-    SysUserFeignService sysUserFeignService;
 
     @RequestMapping(value = "/join", method = RequestMethod.POST)
-    public Object joinRoom(@RequestBody ReqUserData data)
-            throws ApiException, Exception {
-        RoomResult roomResult = roomService.joinRoom(data.getUserName(), data.getRoomId(), data.isAudience(), data.isDisableCamera(),data.isMusicMode());
-        return new BaseResponse<>(roomResult);
-    }
-
-    @RequestMapping(value = "/queryNoJoinStu", method = RequestMethod.GET)
-    public Object queryNoJoinStu(String roomId){
-        return new BaseResponse<>(roomService.queryNoJoinStu(roomId));
+    public Object joinRoom(@RequestBody ReqUserData data) throws Exception {
+        return new BaseResponse<>(roomService.joinRoom(data.getRoomId()));
     }
 
     @RequestMapping(value = "/signIn", method = RequestMethod.POST)
     public Object signIn(Long roomId){
-        roomService.signIn(roomId);
         return new BaseResponse<>();
     }
 
     @RequestMapping(value = "/leave", method = RequestMethod.POST)
-    public Object leaveRoom(@RequestBody ReqUserData data)
-            throws ApiException, Exception {
-        boolean result = roomService.leaveRoom(data.getRoomId());
-        return new BaseResponse<>(result);
+    public Object leaveRoom(@RequestBody ReqUserData data){
+        return new BaseResponse<>();
+    }
+
+    @RequestMapping(value = "/queryNoJoinStu", method = RequestMethod.GET)
+    public Object queryNoJoinStu(String roomId){
+        return new BaseResponse<>(roomService.queryNoJoinStu(roomId));
     }
 
     @RequestMapping(value = "/sendImPlayMidiMessage", method = RequestMethod.POST)
@@ -60,40 +52,34 @@ public class RoomController{
     }
 
     @RequestMapping(value = "/statusSync")
-    public Object statusSync(@RequestBody String body) throws Exception {
+    public void statusSync(@RequestBody String body) throws Exception {
         ChannelStateNotify notify = JSONObject.parseObject(body, ChannelStateNotify.class);
         log.info("statusSyncParam: {}",JSONObject.toJSON(notify));
-        boolean result = false;
-        if(notify.getEvent() == 12 || notify.getEvent() == 3){
-            result = roomService.statusSync(notify.getChannelId(), notify.getUserId());
-        }else if(notify.getEvent() == 11){
-//            Teacher teacher = teacherDao.get(Integer.parseInt(notify.getUserId()));
-//            Long roomId = Long.parseLong(notify.getChannelId().substring(1));
-//            CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
-//            if(teacher != null && teacher.getId().equals(courseSchedule.getActualTeacherId())){
-//                roomService.joinRoom(teacher.getRealName(),roomId.toString(),false,false);
-//            }else {
-//                roomService.joinRoom(teacher.getUsername(),roomId.toString(),false,false);
-//            }
+        String roomId = notify.getChannelId();
+        String userId = notify.getUserId();
+        switch (notify.getEvent()){
+            case 11:
+                //成员加入
+                roomService.joinRoomSuccess(roomId, userId);
+                break;
+            case 12:
+                //成员退出
+                roomService.leaveRoomSuccess(roomId, userId);
+                break;
         }
-        return new BaseResponse<>(result);
-    }
-
-    @RequestMapping(value = "/statusImMsg")
-    public void statusImMsg(@RequestBody String body) throws Exception {
-        System.out.println("");
+//        roomService.statusSync(notify);
     }
 
     @RequestMapping(value = "/downgrade", method = RequestMethod.POST)
     public Object downRole(@RequestBody ReqChangeUserRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.downgrade(data.getRoomId(), data.getUsers());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/kick", method = RequestMethod.POST)
     public Object kickMember(@RequestBody ReqUserData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.kickMember(data.getRoomId());
         return new BaseResponse<>(result);
     }
@@ -101,14 +87,14 @@ public class RoomController{
     //only teacher
     @RequestMapping(value = "/display", method = RequestMethod.POST)
     public Object display(@RequestBody ReqDisplayData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.display(data.getRoomId(), data.getType(), data.getUri(),data.getUserId());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/whiteboard/create", method = RequestMethod.POST)
     public Object createWhiteBoard(@RequestBody ReqWhiteboardData data)
-            throws ApiException, Exception {
+            throws Exception {
         String result = roomService.createWhiteBoard(data.getRoomId());
         return new BaseResponse<>(result);
     }
@@ -116,21 +102,21 @@ public class RoomController{
 
     @RequestMapping(value = "/whiteboard/delete", method = RequestMethod.POST)
     public Object destroyWhiteBoard(@RequestBody ReqWhiteboardData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.deleteWhiteboard(data.getRoomId(), data.getWhiteboardId());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/whiteboard/list", method = RequestMethod.GET)
     public Object getWhiteBoard(@RequestParam String roomId)
-            throws ApiException, Exception {
+            throws Exception {
         List<RoomResult.WhiteboardResult> whiteboards = roomService.getWhiteboard(roomId);
         return new BaseResponse<>(whiteboards);
     }
 
     @RequestMapping(value = "/device/approve", method = RequestMethod.POST)
     public Object approveControlDevice(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         result = roomService.approveControlDevice(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
@@ -138,7 +124,7 @@ public class RoomController{
 
     @RequestMapping(value = "/device/reject", method = RequestMethod.POST)
     public Object rejectControlDevice(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         result = roomService.rejectControlDevice(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
@@ -146,7 +132,7 @@ public class RoomController{
 
     @RequestMapping(value = "/device/control", method = RequestMethod.POST)
     public Object controlDevice(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         if (data.getCameraOn() != null) {
             result = roomService.controlDevice(data.getRoomId(), data.getUserId(), DeviceTypeEnum.Camera, data.getCameraOn());
@@ -171,7 +157,7 @@ public class RoomController{
 
     @RequestMapping(value = "/device/sync", method = RequestMethod.POST)
     public Object syncDeviceState(@RequestBody ReqDeviceControlData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result;
         if (data.getCameraOn() != null) {
             result = roomService.syncDeviceState(data.getRoomId(), DeviceTypeEnum.Camera, data.getCameraOn());
@@ -189,70 +175,70 @@ public class RoomController{
 
     @RequestMapping(value = "/whiteboard/turn-page", method = RequestMethod.POST)
     public Object turnPage(@RequestBody ReqWhiteboardData data)
-            throws ApiException, Exception {
+            throws Exception {
         boolean result = roomService.turnWhiteBoardPage(data.getRoomId(), data.getWhiteboardId(), data.getPage());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/members", method = RequestMethod.GET)
     public Object getMembers(@RequestParam String roomId)
-            throws ApiException, Exception {
+            throws Exception {
         List<RoomResult.MemberResult> whiteboards = roomService.getMembers(roomId);
         return new BaseResponse<>(whiteboards);
     }
 
     @RequestMapping(value = "/speech/apply", method = RequestMethod.POST)
     public Object apply(@RequestBody ReqSpeechData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.applySpeech(data.getRoomId());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/speech/approve", method = RequestMethod.POST)
     public Object approval(@RequestBody ReqSpeechData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.approveSpeech(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/speech/reject", method = RequestMethod.POST)
     public Object reject(@RequestBody ReqSpeechData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.rejectSpeech(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/transfer", method = RequestMethod.POST)
     public Object transfer(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.transfer(data.getRoomId(), data.getUserId());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/upgrade/invite", method = RequestMethod.POST)
     public Object inviteUpgradeRole(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.inviteUpgradeRole(data.getRoomId(), data.getUserId(), data.getRole());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/upgrade/approve", method = RequestMethod.POST)
     public Object approveUpgradeRole(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.approveUpgradeRole(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/upgrade/reject", method = RequestMethod.POST)
     public Object rejectUpgradeRole(@RequestBody ReqUpgradeRoleData data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.rejectUpgradeRole(data.getRoomId(), data.getTicket());
         return new BaseResponse<>(result);
     }
 
     @RequestMapping(value = "/change-role", method = RequestMethod.POST)
     public Object changeRole(@RequestBody ReqChangeRole data)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.changeRole(data.getRoomId(), data.getUserId(), data.getRole());
         return new BaseResponse<>(result);
     }
@@ -262,7 +248,7 @@ public class RoomController{
                                      @RequestParam(value = "timestamp", required = false) String timestamp,
                                      @RequestParam(value = "nonce", required = false) String nonce,
                                      @RequestParam(value = "signature", required = false) String signature)
-            throws ApiException, Exception {
+            throws Exception {
         Boolean result = roomService.memberOnlineStatus(statusList, nonce, timestamp, signature);
         return new BaseResponse<>(result);
     }

+ 0 - 2
mec-im/src/main/java/com/ym/dao/HereWhiteDao.java

@@ -7,7 +7,5 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface HereWhiteDao extends JpaRepository<HereWhite, Long> {
 
-    HereWhite findById(Integer id);
-
     HereWhite findByCourseScheduleId(Integer id);
 }

+ 5 - 13
mec-im/src/main/java/com/ym/dao/RoomDao.java

@@ -16,26 +16,18 @@ import java.util.List;
  */
 @Repository
 public interface RoomDao extends JpaRepository<Room, Long> {
-    public List<Room> findByRid(String rid);
+    Room findByRid(String rid);
 
-    @Transactional
     @Modifying
-    public int deleteByRid(String rid);
+    int deleteByRid(String rid);
 
-    public boolean existsByRid(String rid);
+    boolean existsByRid(String rid);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room set display=?2 where rid=?1", nativeQuery = true)
-    public int updateDisplayByRid(String rid, String display);
+    int updateDisplayByRid(String rid, String display);
 
-    @Transactional
-    @Modifying
-    @Query(value = "update rongyun_room set play_midi_json=?2 where rid=?1", nativeQuery = true)
-    public int updatePlayMidiByRid(String rid, String playMidi);
-
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room set whiteboard_name_index=?2 where rid=?1", nativeQuery = true)
-    public int updateWhiteboardNameIndexByRid(String rid, int whiteboardNameIndex);
+    int updateWhiteboardNameIndexByRid(String rid, int whiteboardNameIndex);
 }

+ 17 - 31
mec-im/src/main/java/com/ym/dao/RoomMemberDao.java

@@ -6,7 +6,6 @@ import org.springframework.data.jpa.repository.Lock;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.stereotype.Repository;
-import org.springframework.transaction.annotation.Transactional;
 
 import javax.persistence.LockModeType;
 import java.util.List;
@@ -16,64 +15,51 @@ import java.util.List;
  */
 @Repository
 public interface RoomMemberDao extends JpaRepository<RoomMember, Long> {
-    public List<RoomMember> findByRid(String rid);
+    List<RoomMember> findByRid(String rid);
 
     @Lock(value = LockModeType.PESSIMISTIC_WRITE)
-    public List<RoomMember> findByRidAndUid(String rid, String uid);
+    RoomMember findByRidAndUid(String rid, String uid);
 
-    public List<RoomMember> findByRidAndRole(String rid, int role);
+    List<RoomMember> findByRidAndRole(String rid, int role);
 
-    public List<RoomMember> findByUid(String uid);
-
-    public int countByRidAndRole(String rid, int role);
+    List<RoomMember> findByUid(String uid);
 
     @Modifying
-    @Transactional
-    public int deleteByRid(String roomId);
+    int deleteByRid(String roomId);
 
     @Query(value = "select count(*) from rongyun_room_member where rid=?1", nativeQuery = true)
-    public int countByRid(String roomId);
+    int countByRid(String roomId);
 
     @Query(value = "select count(*) from rongyun_room_member where rid=?1 and role!=?2", nativeQuery = true)
-    public int countByRidAndExcludeRole(String roomId, int excludeRole);
+    int countByRidAndExcludeRole(String roomId, int excludeRole);
 
-    @Transactional
     @Modifying
     @Query(value = "delete from rongyun_room_member where rid=?1 and uid=?2", nativeQuery = true)
-    public int deleteUserByRidAndUid(String rid, String uid);
+    int deleteUserByRidAndUid(String rid, String uid);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room_member set role=?3 where rid=?1 and uid=?2", nativeQuery = true)
-    public int updateRoleByRidAndUid(String rid, String uid, int role);
-
-    @Transactional
-    @Modifying
-    @Query(value = "update rongyun_room_member set role=?3 where rid=?1 and role=?2", nativeQuery = true)
-    public int updateRoleByRidAndRole(String rid, int role);
+    int updateRoleByRidAndUid(String rid, String uid, int role);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room_member set camera=?3 where rid=?1 and uid=?2", nativeQuery = true)
-    public int updateCameraByRidAndUid(String rid, String uid, boolean camera);
+    int updateCameraByRidAndUid(String rid, String uid, boolean camera);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room_member set mic=?3 where rid=?1 and uid=?2", nativeQuery = true)
-    public int updateMicByRidAndUid(String rid, String uid, boolean mic);
+    int updateMicByRidAndUid(String rid, String uid, boolean mic);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room_member set hand=?3 where rid=?1 and uid=?2", nativeQuery = true)
-    public int updateHandByRidAndUid(String rid, String uid, boolean hand);
+    int updateHandByRidAndUid(String rid, String uid, boolean hand);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_room_member set music_mode=?3 where rid=?1 and uid=?2", nativeQuery = true)
-    public int updateMusicByRidAndUid(String rid, String uid, boolean musicMode);
+    int updateMusicByRidAndUid(String rid, String uid, boolean musicMode);
 
-    public boolean existsByRidAndUid(String rid, String uid);
-
-    public boolean existsByRidAndRole(String rid, int role);
+    boolean existsByRidAndUid(String rid, String uid);
 
+    @Modifying
+    @Query(value = "DELETE FROM rongyun_room_member WHERE rid = ?1 AND uid != ?2", nativeQuery = true)
+    void deleteRoomMember(String roomId, String userId);
 }

+ 0 - 2
mec-im/src/main/java/com/ym/dao/SpeechDao.java

@@ -11,6 +11,4 @@ import java.util.List;
  */
 @Repository
 public interface SpeechDao extends CrudRepository<ScheduledTaskInfo, String> {
-
-    List<ScheduledTaskInfo> findByTicket(String ticket);
 }

+ 2 - 5
mec-im/src/main/java/com/ym/dao/UserDao.java

@@ -13,12 +13,9 @@ import java.util.List;
  */
 @Repository
 public interface UserDao extends JpaRepository<UserInfo, Long> {
-    //will query with "select * from TABLE where user_id = 'userId'"
-    public List<UserInfo> findByUid(String uid);
 
-    public List<UserInfo> findByName(String name);
+    UserInfo findByUid(String uid);
 
-    @Transactional
     @Modifying
-    public int deleteByUid(String uid);
+    int deleteByUid(String uid);
 }

+ 9 - 10
mec-im/src/main/java/com/ym/dao/WhiteboardDao.java

@@ -14,23 +14,22 @@ import java.util.List;
  */
 @Repository
 public interface WhiteboardDao extends JpaRepository<Whiteboard, Long> {
-    public List<Whiteboard> findByRid(String rid);
-    public List<Whiteboard> findByRidAndCreator(String rid, String creator);
-    public List<Whiteboard> findByRidAndWbid(String rid, String wbid);
+    List<Whiteboard> findByRid(String rid);
 
-    public int deleteByRid(String rid);
+    List<Whiteboard> findByRidAndCreator(String rid, String creator);
+
+    List<Whiteboard> findByRidAndWbid(String rid, String wbid);
+
+    int deleteByRid(String rid);
 
-    @Transactional
     @Modifying
-    public int deleteByWbid(String wbid);
+    int deleteByWbid(String wbid);
 
-    @Transactional
     @Modifying
     @Query(value = "delete from rongyun_whiteboard where rid=?1 and creator=?2", nativeQuery = true)
-    public int deleteByRidAndCreator(String rid, String creator);
+    int deleteByRidAndCreator(String rid, String creator);
 
-    @Transactional
     @Modifying
     @Query(value = "update rongyun_whiteboard set cur_pg=?3 where wbid=?2 and rid=?1", nativeQuery = true)
-    public int updatePageByRidAndWbid(String rid, String wbid, int page);
+    int updatePageByRidAndWbid(String rid, String wbid, int page);
 }

文件差異過大導致無法顯示
+ 244 - 380
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java


+ 28 - 36
mec-im/src/main/java/com/ym/service/RoomService.java

@@ -1,7 +1,5 @@
 package com.ym.service;
 
-import com.ym.common.ApiException;
-import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.RongyunBasicUserDto;
 import com.ym.pojo.*;
 
@@ -12,62 +10,61 @@ import java.util.List;
  */
 public interface RoomService {
     //everyone
-    public RoomResult joinRoom(String userName, String roomId, boolean isAudience, boolean isDisableCamera,boolean isMusicMode) throws ApiException, Exception;
-
-    void signIn(Long roomId);
-
-    public Boolean leaveRoom(String roomId) throws ApiException, Exception;
+    RoomResult joinRoom(String roomId) throws Exception;
 
     //only host
-    public Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws ApiException, Exception;
+    Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws Exception;
+
+    Boolean kickMember(String roomId) throws Exception;
 
-    public Boolean kickMember(String roomId) throws ApiException, Exception;
+    public void joinRoomSuccess(String roomId,String userId) throws Exception;
 
+    public void leaveRoomSuccess(String roomId,String userId) throws Exception;
 
     //only teacher
-    public Boolean display(String roomId, int type, String uri, String userId) throws ApiException, Exception;
+    Boolean display(String roomId, int type, String uri, String userId) throws Exception;
 
-    public String createWhiteBoard(String roomId) throws ApiException, Exception;
+    String createWhiteBoard(String roomId) throws Exception;
 
-    public Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws ApiException, Exception;
+    Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws Exception;
 
-    public List<RoomResult.WhiteboardResult> getWhiteboard(String roomId) throws ApiException, Exception;
+    List<RoomResult.WhiteboardResult> getWhiteboard(String roomId) throws Exception;
 
-    public Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws ApiException, Exception;
+    Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws Exception;
 
-    public Boolean controlDevice(String roomId, String userId, DeviceTypeEnum type, boolean enable) throws ApiException, Exception;
+    Boolean controlDevice(String roomId, String userId, DeviceTypeEnum type, boolean enable) throws Exception;
 
     Boolean batchControlDevice(ReqDeviceControlData data) throws Exception;
 
-    public Boolean approveControlDevice(String roomId, String ticket) throws ApiException, Exception;
+    Boolean approveControlDevice(String roomId, String ticket) throws Exception;
 
-    public Boolean rejectControlDevice(String roomId, String ticket) throws ApiException, Exception;
+    Boolean rejectControlDevice(String roomId, String ticket) throws Exception;
 
 
-    public List<RoomResult.MemberResult> getMembers(String roomId) throws  ApiException, Exception;
+    List<RoomResult.MemberResult> getMembers(String roomId) throws  Exception;
 
-    public Boolean applySpeech(String roomId) throws  ApiException, Exception;
+    Boolean applySpeech(String roomId) throws  Exception;
 
-    public Boolean approveSpeech(String roomId, String requestId) throws  ApiException, Exception;
+    Boolean approveSpeech(String roomId, String requestId) throws  Exception;
 
-    public Boolean rejectSpeech(String roomId, String requestId) throws  ApiException, Exception;
+    Boolean rejectSpeech(String roomId, String requestId) throws  Exception;
 
 
-    public Boolean transfer(String roomId, String userId) throws ApiException, Exception;
+    Boolean transfer(String roomId, String userId) throws Exception;
 
-    public Boolean inviteUpgradeRole(String roomId, String userId, int role) throws  ApiException, Exception;
-    public Boolean approveUpgradeRole(String roomId, String ticket) throws ApiException, Exception;
-    public Boolean rejectUpgradeRole(String roomId, String ticket) throws ApiException, Exception;
+    Boolean inviteUpgradeRole(String roomId, String userId, int role) throws  Exception;
+    Boolean approveUpgradeRole(String roomId, String ticket) throws Exception;
+    Boolean rejectUpgradeRole(String roomId, String ticket) throws Exception;
 
-    public Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws ApiException, Exception;
+    Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws Exception;
 
-    public Boolean changeRole(String roomId, String userId, int role) throws ApiException, Exception;
+    Boolean changeRole(String roomId, String userId, int role) throws Exception;
 
-    public void destroyRoom(String roomId);
-    public Boolean memberOnlineStatus(List<ReqMemberOnlineStatus> statusList, String nonce, String timestamp, String signature) throws ApiException, Exception;
-    public void userIMOfflineKick(String userId);
+    void destroyRoom(String roomId);
+    Boolean memberOnlineStatus(List<ReqMemberOnlineStatus> statusList, String nonce, String timestamp, String signature) throws Exception;
+    void userIMOfflineKick(String userId);
 
-    boolean statusSync(String roomId,String userId) throws Exception;
+    void statusSync(ChannelStateNotify notify) throws Exception;
 
     /**
      * 发送节拍器消息
@@ -80,9 +77,4 @@ public interface RoomService {
      * @return
      */
     List<RongyunBasicUserDto> queryNoJoinStu(String roomId);
-
-    /**
-     * 发送节拍器自定义消息
-     */
-//    void sendImPlayMidiMessage(PlayMidiMessageData playMidiMessageData);
 }

部分文件因文件數量過多而無法顯示