|  | @@ -1472,15 +1472,62 @@ public class RoomServiceImpl implements RoomService {
 | 
											
												
													
														|  |          } else {
 |  |          } else {
 | 
											
												
													
														|  |              roomMemberDao.updateMicByRidAndUid(roomId, userId, taskInfo.isOnOff());
 |  |              roomMemberDao.updateMicByRidAndUid(roomId, userId, taskInfo.isOnOff());
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        ControlDeviceNotifyMessage msg = new ControlDeviceNotifyMessage(ActionEnum.Approve.ordinal());
 |  | 
 | 
											
												
													
														|  | -        msg.setType(taskInfo.getTypeEnum().ordinal());
 |  | 
 | 
											
												
													
														|  | -        msg.setOpUserId(userId);
 |  | 
 | 
											
												
													
														|  | -        msg.setOpUserName(authUser.getUsername());
 |  | 
 | 
											
												
													
														|  | -        imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(taskInfo.getTypeEnum().ordinal(), taskInfo.isOnOff());
 |  | 
 | 
											
												
													
														|  | -        deviceResourceMessage.setUserId(userId);
 |  | 
 | 
											
												
													
														|  | -        imHelper.publishMessage(userId, roomId, deviceResourceMessage, 1);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        String roomServiceProviter = getRoomServiceProviter(roomId);
 | 
											
												
													
														|  | 
 |  | +        if (TencentCloudRTCPlugin.PLUGIN_NAME.equals(roomServiceProviter)) {
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            // 获取RTC服务提供方
 | 
											
												
													
														|  | 
 |  | +            RTCRoomPluginService pluginService = rtcRoomPluginContext.getPluginService(TencentCloudRTCPlugin.PLUGIN_NAME);
 | 
											
												
													
														|  | 
 |  | +            // 腾讯云RTC服务
 | 
											
												
													
														|  | 
 |  | +            RTCRoomMessage.MessageContent.MessageContentBuilder action = RTCRoomMessage.MessageContent.builder()
 | 
											
												
													
														|  | 
 |  | +                    .type(ActionEnum.Approve.ordinal())
 | 
											
												
													
														|  | 
 |  | +                    .enable(taskInfo.isOnOff())
 | 
											
												
													
														|  | 
 |  | +                    .targetId(userId)
 | 
											
												
													
														|  | 
 |  | +                    .targetName(authUser.getUsername())
 | 
											
												
													
														|  | 
 |  | +                    .sendUserInfo(getSendUser(taskInfo.getApplyUserId(), RoleTeacher));
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            RTCRoomMessage roomMessage = RTCRoomMessage.builder()
 | 
											
												
													
														|  | 
 |  | +                    .objectName(RTCRoomMessage.CONTROL_DEVICE_NOTIFY_MESSAGE)
 | 
											
												
													
														|  | 
 |  | +                    .content(action.build())
 | 
											
												
													
														|  | 
 |  | +                    .toChatRoomId(roomMember.getRid())
 | 
											
												
													
														|  | 
 |  | +                    .fromUserId(roomMember.getUid())
 | 
											
												
													
														|  | 
 |  | +                    .isIncludeSender(1)
 | 
											
												
													
														|  | 
 |  | +                    .isPersisted(1)
 | 
											
												
													
														|  | 
 |  | +                    .build();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            pluginService.sendChatRoomMessage(roomMessage);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            // 腾讯云RTC服务
 | 
											
												
													
														|  | 
 |  | +            action = RTCRoomMessage.MessageContent.builder()
 | 
											
												
													
														|  | 
 |  | +                    .type(ActionEnum.Approve.ordinal())
 | 
											
												
													
														|  | 
 |  | +                    .enable(taskInfo.isOnOff())
 | 
											
												
													
														|  | 
 |  | +                    .sendUserInfo(getSendUser(roomMember.getUid(),RoleEnum.getEnumByValue(roomMember.getRole())));
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            // 腾讯云消息推送
 | 
											
												
													
														|  | 
 |  | +            RTCRoomMessage message = RTCRoomMessage.builder()
 | 
											
												
													
														|  | 
 |  | +                    .objectName(RTCRoomMessage.DEVICE_MESSAGE)
 | 
											
												
													
														|  | 
 |  | +                    .fromUserId(userId)
 | 
											
												
													
														|  | 
 |  | +                    .toChatRoomId(roomId)
 | 
											
												
													
														|  | 
 |  | +                    .content(action.build())
 | 
											
												
													
														|  | 
 |  | +                    .isPersisted(1)
 | 
											
												
													
														|  | 
 |  | +                    .isIncludeSender(0)
 | 
											
												
													
														|  | 
 |  | +                    .build();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            pluginService.sendChatRoomMessage(message);
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  | 
 |  | +            ControlDeviceNotifyMessage msg = new ControlDeviceNotifyMessage(ActionEnum.Approve.ordinal());
 | 
											
												
													
														|  | 
 |  | +            msg.setType(taskInfo.getTypeEnum().ordinal());
 | 
											
												
													
														|  | 
 |  | +            msg.setOpUserId(userId);
 | 
											
												
													
														|  | 
 |  | +            msg.setOpUserName(authUser.getUsername());
 | 
											
												
													
														|  | 
 |  | +            imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(taskInfo.getTypeEnum().ordinal(), taskInfo.isOnOff());
 | 
											
												
													
														|  | 
 |  | +            deviceResourceMessage.setUserId(userId);
 | 
											
												
													
														|  | 
 |  | +            imHelper.publishMessage(userId, roomId, deviceResourceMessage, 1);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |          return true;
 |  |          return true;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -1497,7 +1544,36 @@ public class RoomServiceImpl implements RoomService {
 | 
											
												
													
														|  |          msg.setType(taskInfo.getTypeEnum().ordinal());
 |  |          msg.setType(taskInfo.getTypeEnum().ordinal());
 | 
											
												
													
														|  |          msg.setOpUserId(userId);
 |  |          msg.setOpUserId(userId);
 | 
											
												
													
														|  |          msg.setOpUserName(authUser.getUsername());
 |  |          msg.setOpUserName(authUser.getUsername());
 | 
											
												
													
														|  | -        imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        String roomServiceProviter = getRoomServiceProviter(roomId);
 | 
											
												
													
														|  | 
 |  | +        if (TencentCloudRTCPlugin.PLUGIN_NAME.equals(roomServiceProviter)) {
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            // 获取RTC服务提供方
 | 
											
												
													
														|  | 
 |  | +            RTCRoomPluginService pluginService = rtcRoomPluginContext.getPluginService(TencentCloudRTCPlugin.PLUGIN_NAME);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            RTCRoomMessage.MessageContent.MessageContentBuilder action = RTCRoomMessage.MessageContent.builder()
 | 
											
												
													
														|  | 
 |  | +                    .type(ActionEnum.Reject.ordinal())
 | 
											
												
													
														|  | 
 |  | +                    .enable(taskInfo.isOnOff())
 | 
											
												
													
														|  | 
 |  | +                    .targetId(userId)
 | 
											
												
													
														|  | 
 |  | +                    .targetName(authUser.getUsername())
 | 
											
												
													
														|  | 
 |  | +                    .sendUserInfo(getSendUser(taskInfo.getApplyUserId(), RoleTeacher));
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            RTCRoomMessage roomMessage = RTCRoomMessage.builder()
 | 
											
												
													
														|  | 
 |  | +                    .objectName(RTCRoomMessage.CONTROL_DEVICE_NOTIFY_MESSAGE)
 | 
											
												
													
														|  | 
 |  | +                    .content(action.build())
 | 
											
												
													
														|  | 
 |  | +                    .toChatRoomId(roomMember.getRid())
 | 
											
												
													
														|  | 
 |  | +                    .fromUserId(roomMember.getUid())
 | 
											
												
													
														|  | 
 |  | +                    .isIncludeSender(1)
 | 
											
												
													
														|  | 
 |  | +                    .isPersisted(1)
 | 
											
												
													
														|  | 
 |  | +                    .build();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            pluginService.sendChatRoomMessage(roomMessage);
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  | 
 |  | +            imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |          return true;
 |  |          return true;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 |