Commit 2d2227b1 by Future

日志

parent 6087944f
......@@ -95,9 +95,6 @@ public class NormalChatAction {
@ActionMapping("/normal/send")
@ApiOperation("普通消息发送")
public void sendMsg(ActionRequest request, ChatContentVo data, String reqId) {
// if (log.isDebugEnabled()) {
// log.debug("接收到参数,reqId: {},\n data: {}, ", reqId, data);
// }
ImConversationQueryVo conversation = ehcacheService.getEhCacheConversation(data.getToConversation());
if (conversation == null) {
log.warn("会reqId: {} ,会话id: {}db中不存在", reqId, data.getToConversation());
......@@ -112,6 +109,8 @@ public class NormalChatAction {
// 查询imApplication
ImApplication imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
log.info("1");
// 给所有人(在线+离线)遍历发送
// 先查询该会话所有成员
List<ImConversationMembers> membersList = ehcacheService.getEhCacheMember("member"+conversation.getId(), conversation.getId());
......@@ -128,6 +127,7 @@ public class NormalChatAction {
}
Map<Long, ImConversationMembers> memberMap = membersList.stream().collect(Collectors.toMap(ImConversationMembers::getFkClientId, member -> member));
log.info("2");
// 判断为单聊
if (ChatTypeEnum.SINGLE.getCode().equals(conversation.getChatType())) {
// 判断是否被拉黑逻辑
......@@ -156,6 +156,7 @@ public class NormalChatAction {
}
ImMessageOnlineSend imMessageOnlineSend = assembleImMessageOnlineSend(data, imClientSender, imApplication.getId());
log.info("3");
// 入库 保存收件箱
batchSaveInbox(imApplication, imClientSender, conversation, imMessageOnlineSend.getMsgId(), membersList);
// 入库成功后 判断是否是临时会话 如果是,双方会话display状态是否是1(显示),如果不是,需要修改为是
......@@ -179,6 +180,7 @@ public class NormalChatAction {
// 不给自己发
continue;
}
log.info("6");
SendMsgThreadPool.SEND_MSG_THREAD_POOL_EXECUTOR.execute(() -> {
this.sendMsgToMember(imApplication, member, imMessageOnlineSend, data.getPush(), isPush);
});
......@@ -190,6 +192,8 @@ public class NormalChatAction {
private void sendMsgToMember(ImApplication imApplication, ImConversationMembers member, ImMessageOnlineSend imMessageOnlineSend, PushVO push, Boolean isPush) {
// 在线用户直接发消息
log.info("11");
Boolean sendSuccess = sendMsgForOnline(member.getFkClientId(), imMessageOnlineSend);
if (isPush && !sendSuccess && !member.getDoNotDisturb()) {
// 异步推送系统通知消息 5分钟内推一次消息
......@@ -215,6 +219,7 @@ public class NormalChatAction {
responseModel.setMsg(result.getMessage());
responseModel.setData(imMessageOnlineSend);
responseModel.setReqId(null);
log.info("21");
return channelSender.sendMsg(responseModel, receiverClientId);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment