|
@@ -1,6 +1,7 @@
|
|
|
package com.ym.service.Impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
import com.ym.common.ApiException;
|
|
|
import com.ym.common.DisplayEnum;
|
|
|
import com.ym.common.ErrorEnum;
|
|
@@ -180,6 +181,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
List<RoomMember> memberList = roomMemberDao.findByRidAndUid(roomId, userId);
|
|
|
String midi = courseScheduleStudentPaymentDao.getMidiByCourseIdAndUserId(roomId.substring(1),userId);
|
|
|
userResult.setPlayMidiJson(JSONObject.parseObject(midi,CustomMessage.class));
|
|
|
+ Boolean handUp = false;
|
|
|
if (memberList.isEmpty()) {
|
|
|
int count = roomMemberDao.countByRidAndExcludeRole(roomId, RoleEnum.RoleAudience.getValue());
|
|
|
if (!isAudience && count == roomProperties.getMaxCount()) {
|
|
@@ -210,6 +212,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
// roomMemberDao.updateCameraByRidAndUid(roomId, userId, !isDisableCamera);
|
|
|
userResult.setCamera(roomMember.isCamera());
|
|
|
+ handUp = roomMember.isHand();
|
|
|
userResult.setHandUp(roomMember.isHand());
|
|
|
userResult.setJoinTime(roomMember.getJoinDt());
|
|
|
log.info("user exist in the room: roomId={} , userId={}, use the last role={}", roomId, userId, roleEnum);
|
|
@@ -219,6 +222,19 @@ public class RoomServiceImpl implements RoomService {
|
|
|
msg.setTimestamp(curTime);
|
|
|
msg.setUserName(userName);
|
|
|
msg.setCamera(!isDisableCamera);
|
|
|
+ Boolean playMidi = false;
|
|
|
+ if(roleEnum == RoleEnum.RoleStudent){
|
|
|
+ String midiByCourseIdAndUserId = courseScheduleStudentPaymentDao.getMidiByCourseIdAndUserId(courseSchedule.getId().toString(), userId);
|
|
|
+ //获取节拍器信息
|
|
|
+ if(StringUtils.isNotEmpty(midiByCourseIdAndUserId)){
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(midiByCourseIdAndUserId);
|
|
|
+ if(jsonObject.get("enable") != null){
|
|
|
+ playMidi = Boolean.parseBoolean(jsonObject.get("enable").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ msg.setHandUpOn(handUp);
|
|
|
+ msg.setMetronomeSwitch(playMidi);
|
|
|
imHelper.publishMessage(userId, roomId, msg);
|
|
|
if (roleEnum == RoleEnum.RoleTeacher) {
|
|
|
display = "display://type=1?userId=" + userId + "?uri=";
|