Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
5d3b35dc
提交
5d3b35dc
authored
8月 08, 2023
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
关键词复用指定关键词
上级
320e65ac
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
9 行删除
+19
-9
CustomerKeywordCopyDTO.java
...yaoyaozw/customer/dto/keyword/CustomerKeywordCopyDTO.java
+2
-0
CustomerKeywordServiceImpl.java
...ozw/customer/service/impl/CustomerKeywordServiceImpl.java
+17
-9
没有找到文件。
src/main/java/com/yaoyaozw/customer/dto/keyword/CustomerKeywordCopyDTO.java
浏览文件 @
5d3b35dc
...
@@ -17,4 +17,6 @@ public class CustomerKeywordCopyDTO implements Serializable {
...
@@ -17,4 +17,6 @@ public class CustomerKeywordCopyDTO implements Serializable {
private
List
<
AuthInfoVO
>
targetAuthList
;
private
List
<
AuthInfoVO
>
targetAuthList
;
private
List
<
String
>
targetKeywordList
;
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerKeywordServiceImpl.java
浏览文件 @
5d3b35dc
...
@@ -228,15 +228,16 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
...
@@ -228,15 +228,16 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
public
BaseResult
copy
(
CustomerKeywordCopyDTO
copyDto
)
{
public
BaseResult
copy
(
CustomerKeywordCopyDTO
copyDto
)
{
AuthInfoVO
sourceAuth
=
copyDto
.
getSourceAuth
();
AuthInfoVO
sourceAuth
=
copyDto
.
getSourceAuth
();
List
<
AuthInfoVO
>
targetAuthList
=
copyDto
.
getTargetAuthList
();
List
<
AuthInfoVO
>
targetAuthList
=
copyDto
.
getTargetAuthList
();
List
<
String
>
targetKeywordList
=
copyDto
.
getTargetKeywordList
();
long
copyFlag
=
System
.
currentTimeMillis
();
long
copyFlag
=
System
.
currentTimeMillis
();
localLog
.
info
(
"关键词复用, 复用批次号: {}, 源公众号: {}, 目标公众号: {}条
"
,
copyFlag
,
sourceAuth
.
getAccountName
(),
targetAuthList
.
size
()
);
localLog
.
info
(
"关键词复用, 复用批次号: {}, 源公众号: {}, 目标公众号: {}条
, 目标关键词列表 {}"
,
copyFlag
,
sourceAuth
.
getAccountName
(),
targetAuthList
.
size
(),
targetKeywordList
);
List
<
CustomerKeyword
>
sourceMaterialList
=
getSourceMaterialList
(
sourceAuth
.
getAppId
());
List
<
CustomerKeyword
>
sourceMaterialList
=
getSourceMaterialList
(
sourceAuth
.
getAppId
()
,
targetKeywordList
);
if
(
CollectionUtil
.
isEmpty
(
sourceMaterialList
))
{
if
(
CollectionUtil
.
isEmpty
(
sourceMaterialList
))
{
return
new
BaseResult
().
error
(
"源公众号找不到素材"
);
return
new
BaseResult
().
error
(
"源公众号找不到素材"
);
}
}
// 删除目标公众号现有的素材和链接
// 删除目标公众号现有的素材和链接
removeOriginMaterialList
(
targetAuthList
);
removeOriginMaterialList
(
targetAuthList
,
targetKeywordList
);
List
<
String
>
errorAuthList
=
null
;
List
<
String
>
errorAuthList
=
null
;
int
idx
=
1
;
int
idx
=
1
;
...
@@ -311,8 +312,12 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
...
@@ -311,8 +312,12 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
return
JSONUtil
.
toList
(
referralJsonArray
,
CommonReferralBody
.
class
);
return
JSONUtil
.
toList
(
referralJsonArray
,
CommonReferralBody
.
class
);
}
}
private
List
<
CustomerKeyword
>
getSourceMaterialList
(
String
appid
)
{
private
List
<
CustomerKeyword
>
getSourceMaterialList
(
String
appid
,
List
<
String
>
targetKeywordList
)
{
List
<
CustomerKeyword
>
sourceMaterialList
=
this
.
list
(
new
QueryWrapper
<
CustomerKeyword
>().
eq
(
"appid"
,
appid
));
QueryWrapper
<
CustomerKeyword
>
queryWrapper
=
new
QueryWrapper
<
CustomerKeyword
>().
eq
(
"appid"
,
appid
);
if
(
CollectionUtil
.
isNotEmpty
(
targetKeywordList
))
{
queryWrapper
=
queryWrapper
.
in
(
"keyword"
,
targetKeywordList
);
}
List
<
CustomerKeyword
>
sourceMaterialList
=
this
.
list
(
queryWrapper
);
if
(
CollectionUtil
.
isEmpty
(
sourceMaterialList
))
{
if
(
CollectionUtil
.
isEmpty
(
sourceMaterialList
))
{
return
null
;
return
null
;
...
@@ -337,10 +342,13 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
...
@@ -337,10 +342,13 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
return
sourceMaterialList
;
return
sourceMaterialList
;
}
}
private
void
removeOriginMaterialList
(
List
<
AuthInfoVO
>
targetList
)
{
private
void
removeOriginMaterialList
(
List
<
AuthInfoVO
>
targetList
,
List
<
String
>
targetKeywordList
)
{
List
<
String
>
targetAppidList
=
targetList
.
stream
().
map
(
AuthInfoVO:
:
getAppId
).
collect
(
Collectors
.
toList
());
List
<
String
>
targetAppidList
=
targetList
.
stream
().
map
(
AuthInfoVO:
:
getAppId
).
collect
(
Collectors
.
toList
());
QueryWrapper
<
CustomerKeyword
>
queryWrapper
=
new
QueryWrapper
<
CustomerKeyword
>().
in
(
"appid"
,
targetAppidList
);
List
<
CustomerKeyword
>
sourceMaterialList
=
this
.
list
(
new
QueryWrapper
<
CustomerKeyword
>().
in
(
"appid"
,
targetAppidList
));
if
(
CollectionUtil
.
isNotEmpty
(
targetKeywordList
))
{
queryWrapper
=
queryWrapper
.
in
(
"keyword"
,
targetKeywordList
);
}
List
<
CustomerKeyword
>
sourceMaterialList
=
this
.
list
(
queryWrapper
);
// 原来没有
// 原来没有
if
(
CollectionUtil
.
isEmpty
(
sourceMaterialList
))
{
if
(
CollectionUtil
.
isEmpty
(
sourceMaterialList
))
{
return
;
return
;
...
@@ -386,6 +394,6 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
...
@@ -386,6 +394,6 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
redisTemplate
.
opsForHash
().
delete
(
CustomerMaterialConstant
.
CUSTOMER_KEYWORD_REDIS_KEY
,
appid
);
redisTemplate
.
opsForHash
().
delete
(
CustomerMaterialConstant
.
CUSTOMER_KEYWORD_REDIS_KEY
,
appid
);
}
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论