|
@@ -11,9 +11,11 @@ import com.microsvc.toolkit.middleware.live.message.LiveRoomMessage;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.ImLiveRoomBlackDao;
|
|
|
+import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoomMember;
|
|
|
import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
|
|
|
import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
|
|
|
import com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo;
|
|
|
+import com.ym.mec.biz.service.ImLiveBroadcastRoomMemberService;
|
|
|
import com.ym.mec.biz.service.ImLiveBroadcastRoomService;
|
|
|
import com.ym.mec.biz.service.ImLiveRoomBlackService;
|
|
|
import com.ym.mec.common.entity.ImRoomMessage;
|
|
@@ -47,6 +49,8 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
|
|
|
private LivePluginContext livePluginContext;
|
|
|
@Autowired
|
|
|
private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
|
|
|
+ @Autowired
|
|
|
+ private ImLiveBroadcastRoomMemberService imLiveBroadcastRoomMemberService;
|
|
|
|
|
|
/**
|
|
|
* 查询当前机构学生 -下拉框
|
|
@@ -94,6 +98,18 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
|
|
|
imLiveRoomBlack.setType(0);
|
|
|
imLiveRoomBlack.setCreateBy(getSysUser().getId());
|
|
|
imLiveRoomBlack.setCreateTime(new Date());
|
|
|
+
|
|
|
+ // 直播间访问游客信息
|
|
|
+ ImLiveBroadcastRoomMember roomMember = imLiveBroadcastRoomMemberService.lambdaQuery()
|
|
|
+ .eq(ImLiveBroadcastRoomMember::getRoomUid, roomUid)
|
|
|
+ .eq(ImLiveBroadcastRoomMember::getUserId, userId)
|
|
|
+ .last("LIMIT 1")
|
|
|
+ .one();
|
|
|
+ if (Objects.nonNull(roomMember)) {
|
|
|
+ imLiveRoomBlack.setFingerprint(roomMember.getFingerprint());
|
|
|
+ imLiveRoomBlack.setVisitorName(roomMember.getVisitorName());
|
|
|
+ }
|
|
|
+
|
|
|
this.save(imLiveRoomBlack);
|
|
|
ImLiveBroadcastRoomVo roomVo = imLiveBroadcastRoomService.queryRoomInfo(roomUid);
|
|
|
if (roomVo == null) {
|
|
@@ -103,7 +119,7 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
|
|
|
log.info("直播房间未开播,不需要发送消息");
|
|
|
return;
|
|
|
}
|
|
|
- setBlack( userId, roomVo);
|
|
|
+ setBlack(userId, roomVo);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -115,7 +131,7 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
|
|
|
LivePluginService pluginService = livePluginContext.getPluginService(roomVo.getServiceProvider());
|
|
|
try {
|
|
|
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserById(userId);
|
|
|
+ SysUser sysUser = imLiveBroadcastRoomService.getRoomSysUser(userId, roomVo.getRoomUid());
|
|
|
if (sysUser == null) {
|
|
|
log.error("用户不存在");
|
|
|
return;
|
|
@@ -192,6 +208,7 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
|
|
|
message.setIsIncludeSender(1);
|
|
|
message.setObjectName(type);
|
|
|
message.setToChatRoomId(roomUid);
|
|
|
+
|
|
|
HashMap<String, Integer> sendMap = new HashMap<>();
|
|
|
sendMap.put("userId", userId);
|
|
|
message.setFromUserId(fromUserId.toString());
|