Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
9c9aa953
提交
9c9aa953
authored
10月 13, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
去重复
上级
0e3325e3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
12 行删除
+19
-12
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+16
-11
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+1
-0
CustomerGraphicsTextServiceImpl.java
...ustomer/service/impl/CustomerGraphicsTextServiceImpl.java
+1
-1
CustomerGraphicsMapper.xml
src/main/resources/mapper/CustomerGraphicsMapper.xml
+1
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
9c9aa953
...
@@ -136,13 +136,20 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -136,13 +136,20 @@ public class CustomerServiceCommonAsyncComponent {
@Async
(
"myExecutor"
)
@Async
(
"myExecutor"
)
public
void
obtainLink
(
Long
materialId
,
CustomerGraphics
customerGraphics
,
List
<
ReferralEntity
>
referralEntityList
)
{
public
void
obtainLink
(
Long
materialId
,
CustomerGraphics
customerGraphics
,
List
<
ReferralEntity
>
referralEntityList
)
{
// 获取符合人群包条件的用户所属的公众号列表
List
<
CrowdPackageUserVO
>
userListFromPackage
=
conditionMatchService
.
getUserListFromPackage
(
customerGraphics
.
getPackId
(),
null
);
Map
<
String
,
List
<
CrowdPackageUserVO
>>
storeGroupMap
=
userListFromPackage
.
stream
().
collect
(
Collectors
.
groupingBy
(
CrowdPackageUserVO:
:
getStoreType
));
LOCAL_LOG
.
info
(
"当前包含书城: {} 个"
,
storeGroupMap
.
size
());
// 删除之前设置人群包的时候获取链接生成的数据
referralEntityService
.
ultimateDeleteReferrals
(
materialId
,
"and account_id is not null"
);
for
(
ReferralEntity
referralEntity
:
referralEntityList
)
{
for
(
ReferralEntity
referralEntity
:
referralEntityList
)
{
// 删除之前设置人群包的时候获取链接生成的数据
referralEntityService
.
ultimateDeleteReferrals
(
materialId
,
"and account_id is not null"
);
// 获取链接
// 获取链接
if
(
CustomerCommonConstant
.
REPLACE_LINK_NEWS_TYPE_LIST
.
contains
(
referralEntity
.
getNewsType
()))
{
if
(
CustomerCommonConstant
.
REPLACE_LINK_NEWS_TYPE_LIST
.
contains
(
referralEntity
.
getNewsType
()))
{
LOCAL_LOG
.
info
(
"异步获取图文客服链接"
);
LOCAL_LOG
.
info
(
"异步获取图文客服链接"
);
getAuthListLink
(
customerGraphics
,
referralEntity
);
getAuthListLink
(
storeGroupMap
,
customerGraphics
,
referralEntity
);
}
else
{
}
else
{
LOCAL_LOG
.
info
(
"newsType: {}, 不需要获取链接"
,
referralEntity
.
getNewsType
());
LOCAL_LOG
.
info
(
"newsType: {}, 不需要获取链接"
,
referralEntity
.
getNewsType
());
}
}
...
@@ -164,15 +171,10 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -164,15 +171,10 @@ public class CustomerServiceCommonAsyncComponent {
return
userEntityList
;
return
userEntityList
;
}
}
private
void
getAuthListLink
(
CustomerGraphics
customerMain
,
ReferralEntity
customerReferral
)
{
private
void
getAuthListLink
(
Map
<
String
,
List
<
CrowdPackageUserVO
>>
storeGroupMap
,
CustomerGraphics
customerMain
,
ReferralEntity
customerReferral
)
{
Long
packId
=
customerMain
.
getPackId
();
Long
packId
=
customerMain
.
getPackId
();
LOCAL_LOG
.
info
(
"开始异步处理客服链接, 客服标题: {}, 人群包主键: {}"
,
customerMain
.
getName
(),
packId
);
LOCAL_LOG
.
info
(
"开始异步处理客服链接, 客服标题: {}, 人群包主键: {}"
,
customerMain
.
getName
(),
packId
);
// 获取符合人群包条件的用户所属的公众号列表
List
<
CrowdPackageUserVO
>
userListFromPackage
=
conditionMatchService
.
getUserListFromPackage
(
packId
,
null
);
Map
<
String
,
List
<
CrowdPackageUserVO
>>
storeGroupMap
=
userListFromPackage
.
stream
().
collect
(
Collectors
.
groupingBy
(
CrowdPackageUserVO:
:
getStoreType
));
LOCAL_LOG
.
info
(
"当前包含书城: {} 个"
,
storeGroupMap
.
size
());
// 遍历处理书城
// 遍历处理书城
Integer
newsType
=
customerReferral
.
getNewsType
();
Integer
newsType
=
customerReferral
.
getNewsType
();
// 一个书城一个书城地处理
// 一个书城一个书城地处理
...
@@ -235,6 +237,7 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -235,6 +237,7 @@ public class CustomerServiceCommonAsyncComponent {
storeGroupMap
.
forEach
((
storeType
,
userVoList
)
->
{
storeGroupMap
.
forEach
((
storeType
,
userVoList
)
->
{
LOCAL_LOG
.
info
(
"当前处理书城: {}"
,
storeType
);
LOCAL_LOG
.
info
(
"当前处理书城: {}"
,
storeType
);
boolean
isLegal
=
true
;
boolean
isLegal
=
true
;
String
configId
=
null
;
// 阳光、掌中云 需要获取configId
// 阳光、掌中云 需要获取configId
if
(
storeType
.
equals
(
CustomerCommonConstant
.
STORE_NAME_YANG_GUANG
)
||
storeType
.
equals
(
CustomerCommonConstant
.
STORE_NAME_ZHANG_ZHONG_YUN
))
{
if
(
storeType
.
equals
(
CustomerCommonConstant
.
STORE_NAME_YANG_GUANG
)
||
storeType
.
equals
(
CustomerCommonConstant
.
STORE_NAME_ZHANG_ZHONG_YUN
))
{
R
activityConfig
=
referralFeignClient
.
getActivityConfig
(
customerReferral
.
getRechargeAmount
().
stripTrailingZeros
().
toPlainString
(),
storeType
,
null
);
R
activityConfig
=
referralFeignClient
.
getActivityConfig
(
customerReferral
.
getRechargeAmount
().
stripTrailingZeros
().
toPlainString
(),
storeType
,
null
);
...
@@ -247,9 +250,8 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -247,9 +250,8 @@ public class CustomerServiceCommonAsyncComponent {
if
(!
CollectionUtil
.
isEmpty
(
activityConfigList
))
{
if
(!
CollectionUtil
.
isEmpty
(
activityConfigList
))
{
// 转换config
// 转换config
Map
<
String
,
String
>
configMap
=
activityConfigList
.
stream
().
collect
(
Collectors
.
toMap
(
key
->
key
.
getLabel
().
replaceAll
(
"[^(0-9.送)]"
,
""
),
CommonOptionResponseVO:
:
getValue
,
(
o1
,
o2
)
->
o2
));
Map
<
String
,
String
>
configMap
=
activityConfigList
.
stream
().
collect
(
Collectors
.
toMap
(
key
->
key
.
getLabel
().
replaceAll
(
"[^(0-9.送)]"
,
""
),
CommonOptionResponseVO:
:
getValue
,
(
o1
,
o2
)
->
o2
));
String
configId
=
configMap
.
get
(
activityContent
);
configId
=
configMap
.
get
(
activityContent
);
LOCAL_LOG
.
info
(
"活动内容: {} 获取到configId: {}"
,
activityContent
,
configId
);
LOCAL_LOG
.
info
(
"活动内容: {} 获取到configId: {}"
,
activityContent
,
configId
);
customerReferral
.
setConfigId
(
configId
);
if
(
ObjectUtil
.
isNull
(
configId
))
{
if
(
ObjectUtil
.
isNull
(
configId
))
{
isLegal
=
false
;
isLegal
=
false
;
}
}
...
@@ -258,6 +260,8 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -258,6 +260,8 @@ public class CustomerServiceCommonAsyncComponent {
LOCAL_LOG
.
info
(
"无法获取资源配置, 中断当前循环"
);
LOCAL_LOG
.
info
(
"无法获取资源配置, 中断当前循环"
);
}
}
}
}
customerReferral
.
setConfigId
(
configId
);
String
tempId
=
CustomerStoreTemplateEnum
.
getTempId
(
storeType
);
String
tempId
=
CustomerStoreTemplateEnum
.
getTempId
(
storeType
);
customerReferral
.
setTemplateId
(
tempId
);
customerReferral
.
setTemplateId
(
tempId
);
...
@@ -287,6 +291,7 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -287,6 +291,7 @@ public class CustomerServiceCommonAsyncComponent {
}
}
// 批量新增
// 批量新增
LOCAL_LOG
.
info
(
"保存书城: {} 的链接实体, 数量:{}条"
,
storeType
,
referralEntityList
.
size
());
referralEntityService
.
saveBatch
(
referralEntityList
);
referralEntityService
.
saveBatch
(
referralEntityList
);
}
}
});
});
...
...
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
9c9aa953
...
@@ -39,6 +39,7 @@ public class CustomerCommonConstant {
...
@@ -39,6 +39,7 @@ public class CustomerCommonConstant {
public
final
static
String
CUSTOMER_TEXT_URL_PLACEHOLDER
=
"{url}-"
;
public
final
static
String
CUSTOMER_TEXT_URL_PLACEHOLDER
=
"{url}-"
;
public
final
static
String
CUSTOMER_TEXT_CONTENT_PLACEHOLDER
=
"{content}"
;
public
final
static
String
CUSTOMER_TEXT_CONTENT_PLACEHOLDER
=
"{content}"
;
public
final
static
String
H5_STYLE_CODE
=
" style='color: blue'"
;
public
final
static
Integer
USUAL_LINK_NEWS_TYPE
=
3
;
public
final
static
Integer
USUAL_LINK_NEWS_TYPE
=
3
;
public
final
static
String
USUAL_LINK_NEWS_TYPE_NAME
=
"常用"
;
public
final
static
String
USUAL_LINK_NEWS_TYPE_NAME
=
"常用"
;
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsTextServiceImpl.java
浏览文件 @
9c9aa953
...
@@ -140,7 +140,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
...
@@ -140,7 +140,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
}
}
idx
+=
1
;
idx
+=
1
;
}
}
customerGraphics
.
setContent
(
mainH5Content
.
toString
());
customerGraphics
.
setContent
(
mainH5Content
.
toString
()
.
replace
(
CustomerCommonConstant
.
H5_STYLE_CODE
,
""
)
);
customerGraphics
.
setReferralSize
(
replaceLinkTypeNum
);
customerGraphics
.
setReferralSize
(
replaceLinkTypeNum
);
detailVO
.
setContentList
(
contentList
);
detailVO
.
setContentList
(
contentList
);
// 更新连接表
// 更新连接表
...
...
src/main/resources/mapper/CustomerGraphicsMapper.xml
浏览文件 @
9c9aa953
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
select
select
cg.id,
cg.id,
cg.pack_id as packId,
cg.name,
cg.name,
cg.type,
cg.type,
cg.post_time as postTime,
cg.post_time as postTime,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论