Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
176e62c1
提交
176e62c1
authored
12月 31, 2024
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客服消息发送处理逻辑调整
上级
ff55ce09
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
34 行增加
和
5 行删除
+34
-5
TestController.java
...java/com/yaoyaozw/customer/controller/TestController.java
+23
-3
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+11
-2
没有找到文件。
src/main/java/com/yaoyaozw/customer/controller/TestController.java
浏览文件 @
176e62c1
...
...
@@ -8,10 +8,11 @@ import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import
com.yaoyaozw.customer.entity.CustomerFollowReply
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.service.AccountOrderService
;
import
com.yaoyaozw.customer.service.CustomerDelayPublishService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsService
;
import
com.yaoyaozw.customer.service.*
;
import
com.yaoyaozw.customer.service.wechat.service.WeChatService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO
;
import
com.yaoyaozw.customer.vo.referral.ReferralEntityVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -132,5 +134,23 @@ public class TestController {
}
@Resource
private
WeChatService
weChatService
;
@Resource
private
RegisterUserEntityService
registerUserEntityService
;
@Resource
private
ReferralEntityService
referralEntityService
;
@GetMapping
(
"/testSendCustomer"
)
public
void
testSendCustomer
()
{
CustomerGraphics
entity
=
customerGraphicsService
.
getById
(
1874011792770990080L
);
List
<
CrowdPackageUserVO
>
userList
=
registerUserEntityService
.
getCurrentInPackUserList
(
entity
.
getPackId
(),
false
);
List
<
ReferralEntityVo
>
referralEntityVos
=
referralEntityService
.
findReferralByCustomerGraphicsId
(
entity
.
getId
());
weChatService
.
sendCustomerMessage
(
userList
.
get
(
0
).
getAppId
(),
entity
,
userList
,
referralEntityVos
);
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
176e62c1
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -262,7 +263,12 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
//根据客服id找不同公众号的链接,并按appId分组
List
<
ReferralEntityVo
>
referralList
=
referralEntityService
.
findReferralByCustomerGraphicsId
(
customerGraphics
.
getId
());
// 提取出其中的自定义链接
List
<
ReferralEntityVo
>
customLinkList
=
referralList
.
stream
()
.
filter
(
v
->
StringUtils
.
isBlank
(
v
.
getAppid
())
&&
StringUtils
.
isNotBlank
(
v
.
getReferral
()))
.
filter
(
v
->
v
.
getNewsType
()
!=
null
&&
v
.
getNewsType
()
==
-
1
)
.
collect
(
Collectors
.
toList
());
// 非自定义链接
Map
<
String
,
List
<
ReferralEntityVo
>>
referralMap
=
referralList
.
stream
().
filter
(
a
->!
StringUtils
.
isAnyBlank
(
a
.
getReferral
(),
a
.
getAppid
())).
collect
(
Collectors
.
groupingBy
(
ReferralEntityVo:
:
getAppid
));
//循环该人群包下的所有素材
int
singleUserCount
=
0
;
...
...
@@ -270,7 +276,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
String
appid
=
usersEntry
.
getKey
();
try
{
//获取该号的链接实体
List
<
ReferralEntityVo
>
referralEntityVo
=
referralMap
.
get
(
appid
);
List
<
ReferralEntityVo
>
referralEntityVo
=
referralMap
.
getOrDefault
(
appid
,
CollectionUtil
.
newArrayList
());
if
(
CollectionUtil
.
isNotEmpty
(
customLinkList
))
{
referralEntityVo
.
addAll
(
customLinkList
);
}
//获取该号的openid
List
<
CrowdPackageUserVO
>
packageUserVo
=
usersEntry
.
getValue
();
singleUserCount
+=
packageUserVo
.
size
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论