Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
f3a57d41
提交
f3a57d41
authored
11月 01, 2023
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
关回多图文配置(不入库,进缓存)
上级
b9723371
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
20 行增加
和
7 行删除
+20
-7
FollowReplySaveDTO.java
.../com/yaoyaozw/customer/dto/follow/FollowReplySaveDTO.java
+2
-0
CustomerFollowReplyMultiNewsService.java
...customer/service/CustomerFollowReplyMultiNewsService.java
+3
-2
CustomerFollowReplyMultiNewsServiceImpl.java
...service/impl/CustomerFollowReplyMultiNewsServiceImpl.java
+14
-4
CustomerFollowReplyServiceImpl.java
...customer/service/impl/CustomerFollowReplyServiceImpl.java
+1
-1
没有找到文件。
src/main/java/com/yaoyaozw/customer/dto/follow/FollowReplySaveDTO.java
浏览文件 @
f3a57d41
...
...
@@ -39,6 +39,8 @@ public class FollowReplySaveDTO implements Serializable {
private
CommonReferralBody
referralBody
;
private
AuthInfoVO
accountEntity
;
/**
* 多图文的图文列表
*/
...
...
src/main/java/com/yaoyaozw/customer/service/CustomerFollowReplyMultiNewsService.java
浏览文件 @
f3a57d41
...
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yaoyaozw.customer.dto.follow.FollowReplyMultiNewsCreateDTO
;
import
com.yaoyaozw.customer.entity.CustomerFollowReplyMultiNews
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
java.util.List
;
...
...
@@ -15,9 +16,9 @@ public interface CustomerFollowReplyMultiNewsService extends IService<CustomerFo
/**
* 保存关回多图文的图文列表
* @param replyId 关回配置的主键Id
* @param a
ppId 公众号 appId
* @param a
ccountEntity 公众号
* @param multiNewsList 图文列表
*/
void
saveFollowReplyMultiNews
(
Long
replyId
,
String
appId
,
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
);
void
saveFollowReplyMultiNews
(
Long
replyId
,
AuthInfoVO
accountEntity
,
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
);
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerFollowReplyMultiNewsServiceImpl.java
浏览文件 @
f3a57d41
...
...
@@ -16,6 +16,7 @@ import com.yaoyaozw.customer.entity.ReferralEntity;
import
com.yaoyaozw.customer.mapper.CustomerFollowReplyMultiNewsMapper
;
import
com.yaoyaozw.customer.service.CustomerFollowReplyMultiNewsService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -46,7 +47,7 @@ public class CustomerFollowReplyMultiNewsServiceImpl extends ServiceImpl<Custome
private
SnowflakeComponent
snowflakeComponent
;
@Override
public
void
saveFollowReplyMultiNews
(
Long
replyId
,
String
appId
,
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
)
{
public
void
saveFollowReplyMultiNews
(
Long
replyId
,
AuthInfoVO
accountEntity
,
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
)
{
if
(
CollectionUtil
.
isEmpty
(
multiNewsList
))
{
return
;
}
...
...
@@ -58,27 +59,36 @@ public class CustomerFollowReplyMultiNewsServiceImpl extends ServiceImpl<Custome
List
<
Long
>
multiNewsIdList
=
currentMultiNewsList
.
stream
().
map
(
CustomerFollowReplyMultiNews:
:
getId
).
collect
(
Collectors
.
toList
());
referralEntityService
.
remove
(
new
QueryWrapper
<
ReferralEntity
>().
in
(
ReferralEntity
.
COL_MATERIAL_GRAPHICS_ID
,
multiNewsIdList
));
this
.
removeByIds
(
multiNewsIdList
);
redisTemplate
.
opsForHash
().
delete
(
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
,
a
ppId
);
redisTemplate
.
opsForHash
().
delete
(
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
,
a
ccountEntity
.
getAppId
()
);
}
List
<
ReferralEntity
>
referralEntityList
=
new
ArrayList
<>(
multiNewsList
.
size
());
List
<
CustomerFollowReplyMultiNews
>
entityList
=
new
ArrayList
<>(
multiNewsList
.
size
());
// 处理链接
for
(
FollowReplyMultiNewsCreateDTO
multiNewsEntity
:
multiNewsList
)
{
CommonReferralBody
referralBody
=
multiNewsEntity
.
getReferralBody
();
referralBody
.
setAccountName
(
accountEntity
.
getAccountName
());
referralBody
.
setStoreTypeName
(
accountEntity
.
getStoreTypeName
());
referralBody
.
setStoreType
(
accountEntity
.
getStoreType
());
referralBody
.
setInfoId
(
accountEntity
.
getId
());
referralBody
.
setAccountId
(
accountEntity
.
getAccountId
());
referralBody
.
setAppId
(
accountEntity
.
getAppId
());
// 调用通用方法生成referralEntity
ReferralEntity
referralEntity
=
followReplyComponent
.
getCreateReferralEntity
(
referralBody
);
referralEntityList
.
add
(
referralEntity
);
// 将生成的链接设置到多图文表中
multiNewsEntity
.
setLinkUrl
(
referralEntity
.
getReferral
());
CustomerFollowReplyMultiNews
entity
=
new
CustomerFollowReplyMultiNews
();
BeanUtil
.
copyProperties
(
multiNewsEntity
,
entity
);
entity
.
setId
(
snowflakeComponent
.
snowflakeId
());
referralEntity
.
setId
(
entity
.
getId
());
entityList
.
add
(
entity
);
referralEntityList
.
add
(
referralEntity
);
}
localLog
.
info
(
"generate multi news size {}, referral entity size {}"
,
entityList
.
size
(),
referralEntityList
.
size
());
// 将这些多图文信息转换到缓存
List
<
NewsMessageReplyEntity
>
cacheEntityList
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
multiNewsList
),
NewsMessageReplyEntity
.
class
);
redisTemplate
.
opsForHash
().
put
(
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
,
a
ppId
,
JSONUtil
.
toJsonStr
(
cacheEntityList
));
redisTemplate
.
opsForHash
().
put
(
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
,
a
ccountEntity
.
getAppId
()
,
JSONUtil
.
toJsonStr
(
cacheEntityList
));
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerFollowReplyServiceImpl.java
浏览文件 @
f3a57d41
...
...
@@ -124,7 +124,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
// 多图文
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
=
saveDto
.
getMultiNewsList
();
localLog
.
info
(
"appId {} follow reply has multi news size {}"
,
saveDto
.
getAppid
(),
multiNewsList
.
size
());
followReplyMultiNewsService
.
saveFollowReplyMultiNews
(
entity
.
getId
(),
saveDto
.
getA
ppid
(),
saveDto
.
getMultiNewsList
());
followReplyMultiNewsService
.
saveFollowReplyMultiNews
(
entity
.
getId
(),
saveDto
.
getA
ccountEntity
(),
saveDto
.
getMultiNewsList
());
return
new
GenericsResult
<>(
true
,
"【测试】多图文关回设置成功"
);
}
else
if
(!
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
entity
.
getType
())){
// 获取书城公众号链接(图文)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论