Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 89cb9da5
authored
Jan 04, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
聊天记录群消息查询修改
1 parent
3e913b23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
41 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeChatContactMapping.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/msgaudit/GroupChatVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatContactMappingServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeChatContactMapping.java
View file @
89cb9da
...
...
@@ -3,7 +3,6 @@ package com.linkwechat.wecom.domain;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.wecom.domain.dto.msgaudit.GroupChatVo
;
import
lombok.Data
;
...
...
@@ -80,7 +79,7 @@ public class WeChatContactMapping {
* 群信息
*/
@TableField
(
exist
=
false
)
private
GroupChatVo
roomInfo
;
private
WeGroup
roomInfo
;
/**
* 最后一条聊天数据
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/msgaudit/GroupChatVo.java
deleted
100644 → 0
View file @
3e913b2
package
com
.
linkwechat
.
wecom
.
domain
.
dto
.
msgaudit
;
import
lombok.Data
;
/**
* @author sxw
* @description
* @date 2020/12/30 23:41
**/
@Data
public
class
GroupChatVo
{
/**客户群ID*/
private
String
chat_id
;
/**群名*/
private
String
name
;
/**群主ID*/
private
String
owner
;
/**群的创建时间*/
private
long
create_time
;
/**群公告*/
private
String
notice
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatContactMappingServiceImpl.java
View file @
89cb9da
...
...
@@ -2,7 +2,6 @@ package com.linkwechat.wecom.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.json.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -10,7 +9,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.github.pagehelper.PageInfo
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.core.domain.elastic.ElasticSearchEntity
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.wecom.client.WeCustomerClient
;
import
com.linkwechat.wecom.client.WeCustomerGroupClient
;
...
...
@@ -18,15 +16,15 @@ import com.linkwechat.wecom.client.WeMsgAuditClient;
import
com.linkwechat.wecom.client.WeUserClient
;
import
com.linkwechat.wecom.domain.WeChatContactMapping
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeGroup
;
import
com.linkwechat.wecom.domain.WeUser
;
import
com.linkwechat.wecom.domain.dto.WeUserDto
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupDetail
;
import
com.linkwechat.wecom.domain.dto.msgaudit.GroupChatVo
;
import
com.linkwechat.wecom.mapper.WeChatContactMappingMapper
;
import
com.linkwechat.wecom.mapper.WeCustomerMapper
;
import
com.linkwechat.wecom.mapper.WeUserMapper
;
import
com.linkwechat.wecom.service.IWeChatContactMappingService
;
import
com.linkwechat.wecom.service.IWeConversationArchiveService
;
import
com.linkwechat.wecom.service.IWeGroupService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -61,6 +59,8 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
private
WeMsgAuditClient
weMsgAuditClient
;
@Autowired
private
IWeConversationArchiveService
weConversationArchiveService
;
@Autowired
private
IWeGroupService
weGroupService
;
/**
* 查询聊天关系映射
...
...
@@ -97,10 +97,8 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
item
.
setFinalChatContext
(
weConversationArchiveService
.
getFinalChatContactInfo
(
item
.
getFromId
(),
item
.
getReceiveId
()));
}
else
if
(
StringUtils
.
isNotEmpty
(
item
.
getRoomId
()))
{
//获取群信息
CustomerGroupDetail
customerGroupDetail
=
weCustomerGroupClient
.
groupChatDetail
(
new
CustomerGroupDetail
().
new
Params
(
item
.
getRoomId
()));
GroupChatVo
groupChatVo
=
new
GroupChatVo
();
BeanUtil
.
copyProperties
(
customerGroupDetail
.
getGroup_chat
().
get
(
0
),
groupChatVo
);
item
.
setRoomInfo
(
groupChatVo
);
WeGroup
weGroup
=
weGroupService
.
getOne
(
new
LambdaQueryWrapper
<
WeGroup
>().
eq
(
WeGroup:
:
getChatId
,
item
.
getRoomId
()));
item
.
setRoomInfo
(
weGroup
);
item
.
setFinalChatContext
(
weConversationArchiveService
.
getFinalChatRoomContactInfo
(
item
.
getFromId
(),
item
.
getRoomId
()));
}
});
...
...
@@ -188,11 +186,8 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
fromWeChatContactMapping
.
setIsCustom
(
reveiceType
);
}
else
{
fromWeChatContactMapping
.
setRoomId
(
chatData
.
getString
(
"roomid"
));
CustomerGroupDetail
customerGroupDetail
=
weCustomerGroupClient
.
groupChatDetail
(
new
CustomerGroupDetail
().
new
Params
(
chatData
.
getString
(
"roomid"
)));
GroupChatVo
groupChatVo
=
new
GroupChatVo
();
BeanUtil
.
copyProperties
(
customerGroupDetail
.
getGroup_chat
().
get
(
0
),
groupChatVo
);
chatData
.
put
(
"roomInfo"
,
JSONObject
.
parse
(
JSONObject
.
toJSONString
(
groupChatVo
)));
WeGroup
weGroup
=
weGroupService
.
getOne
(
new
LambdaQueryWrapper
<
WeGroup
>().
eq
(
WeGroup:
:
getChatId
,
chatData
.
getString
(
"roomid"
)));
chatData
.
put
(
"roomInfo"
,
JSONObject
.
parse
(
JSONObject
.
toJSONString
(
weGroup
)));
}
}
//接收人映射数据
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment