Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
42445d1d
提交
42445d1d
authored
10月 14, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
延时客服
上级
b79b3207
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
197 行增加
和
56 行删除
+197
-56
BaseResult.java
src/main/java/com/yaoyaozw/customer/common/BaseResult.java
+9
-0
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+115
-19
CustomerDelayGraphicsController.java
.../customer/controller/CustomerDelayGraphicsController.java
+2
-2
CustomerGraphicsDelay.java
...a/com/yaoyaozw/customer/entity/CustomerGraphicsDelay.java
+9
-4
CustomerGraphicsDelayMapper.java
...yaoyaozw/customer/mapper/CustomerGraphicsDelayMapper.java
+3
-1
CustomerGraphicsDelayService.java
...oyaozw/customer/service/CustomerGraphicsDelayService.java
+2
-1
CustomerGraphicsDelayServiceImpl.java
...stomer/service/impl/CustomerGraphicsDelayServiceImpl.java
+32
-26
AuthInfoVO.java
src/main/java/com/yaoyaozw/customer/vo/AuthInfoVO.java
+10
-0
CustomerGraphicsDelayMapper.xml
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
+15
-3
没有找到文件。
src/main/java/com/yaoyaozw/customer/common/BaseResult.java
浏览文件 @
42445d1d
...
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.common;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yaoyaozw.customer.constants.ApiResultConstant
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
/**
* @author darker
...
...
@@ -37,6 +38,14 @@ public class BaseResult {
}
return
this
;
}
public
BaseResult
success
(
String
message
)
{
this
.
success
=
Boolean
.
TRUE
;
this
.
code
=
ApiResultConstant
.
SUCCESS_CODE
;
if
(
ObjectUtil
.
isNull
(
this
.
message
))
{
this
.
message
=
StringUtils
.
isBlank
(
message
)
?
ApiResultConstant
.
SUCCESS_MSG
:
message
;
}
return
this
;
}
/**
* 错误
...
...
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
42445d1d
差异被折叠。
点击展开。
src/main/java/com/yaoyaozw/customer/controller/CustomerDelayGraphicsController.java
浏览文件 @
42445d1d
...
...
@@ -74,8 +74,8 @@ public class CustomerDelayGraphicsController {
@ApiOperation
(
"所有公众号"
)
@GetMapping
(
"/getAuthList"
)
public
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
@RequestParam
(
required
=
false
)
String
keyword
)
{
return
customerGraphicsDelayService
.
getAuthList
(
keyword
);
public
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
required
=
false
)
String
appId
)
{
return
customerGraphicsDelayService
.
getAuthList
(
keyword
,
appId
);
}
@ApiOperation
(
"时间间隔"
)
...
...
src/main/java/com/yaoyaozw/customer/entity/CustomerGraphicsDelay.java
浏览文件 @
42445d1d
package
com
.
yaoyaozw
.
customer
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -60,6 +58,12 @@ public class CustomerGraphicsDelay implements Serializable {
private
Integer
sendStatus
;
/**
* 原文链接
*/
@TableField
(
value
=
"source_url"
)
private
String
sourceUrl
;
/**
* 是否是历史遗留
*/
@TableField
(
value
=
"is_history"
)
...
...
@@ -105,6 +109,7 @@ public class CustomerGraphicsDelay implements Serializable {
* 逻辑删除
*/
@TableField
(
value
=
"is_deleted"
)
@TableLogic
private
Integer
isDeleted
;
@TableField
(
exist
=
false
)
...
...
src/main/java/com/yaoyaozw/customer/mapper/CustomerGraphicsDelayMapper.java
浏览文件 @
42445d1d
...
...
@@ -48,9 +48,11 @@ public interface CustomerGraphicsDelayMapper extends BaseMapper<CustomerGraphics
* 让时间间隔列表
*
* @param keyword 关键词
* @param keywordList 关键词拆分
* @param storeType 书城
* @return {@link List}<{@link AuthInfoVO}>
*/
List
<
AuthInfoVO
>
getAuthList
(
@Param
(
"keyword"
)
String
keyword
);
List
<
AuthInfoVO
>
getAuthList
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"keywordList"
)
List
<
String
>
keywordList
,
@Param
(
"storeType"
)
String
storeType
);
/**
* 让时间间隔列表
...
...
src/main/java/com/yaoyaozw/customer/service/CustomerGraphicsDelayService.java
浏览文件 @
42445d1d
...
...
@@ -85,9 +85,10 @@ public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsD
* 获得认证列表
*
* @param keyword 关键字
* @param appId 公众号id
* @return {@link GenericsResult}<{@link List}<{@link AuthInfoVO}>>
*/
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
String
keyword
);
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
String
keyword
,
String
appId
);
/**
* 让时间间隔列表
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsDelayServiceImpl.java
浏览文件 @
42445d1d
...
...
@@ -3,15 +3,13 @@ package com.yaoyaozw.customer.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.components.CustomerServiceCommonAsyncComponent
;
import
com.yaoyaozw.customer.components.SnowflakeComponent
;
import
com.yaoyaozw.customer.components.TokenManager
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
...
...
@@ -51,6 +49,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
private
final
static
Logger
localLog
=
LoggerFactory
.
getLogger
(
CustomerGraphicsDelayServiceImpl
.
class
);
private
final
static
String
EMPTY_STR
=
" "
;
@Autowired
private
TokenManager
tokenManager
;
@Autowired
...
...
@@ -61,6 +61,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
private
AuthorizerInfoService
authorizerInfoService
;
@Autowired
private
KanbanCommonMapper
kanbanCommonMapper
;
@Autowired
private
CustomerServiceCommonAsyncComponent
commonAsyncComponent
;
@Override
...
...
@@ -174,7 +176,7 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
// 找到号下面的所有的客服素材
List
<
CustomerGraphicsDelay
>
sourceCustomerList
=
super
.
list
(
new
QueryWrapper
<
CustomerGraphicsDelay
>().
eq
(
"app_id"
,
appId
));
List
<
Long
>
sourceMainIdList
=
sourceCustomerList
.
stream
().
map
(
CustomerGraphicsDelay:
:
getId
).
collect
(
Collectors
.
toList
());
// 获取原始链接素材
// 获取原始链接素材
图文只有一条、文本有多条
List
<
ReferralEntity
>
referralEntityList
=
referralEntityService
.
list
(
new
QueryWrapper
<
ReferralEntity
>().
in
(
"material_graphics_id"
,
sourceMainIdList
));
Map
<
Long
,
List
<
ReferralEntity
>>
referralGroupMap
=
referralEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ReferralEntity:
:
getMaterialGraphicsId
));
...
...
@@ -186,36 +188,40 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
localLog
.
info
(
"当前复用书城: {}"
,
storeTypeName
);
sourceAuthInfo
.
setStoreTypeName
(
storeTypeName
);
for
(
String
targetAppId
:
targetAppList
)
{
// 遍历要复用的素材
for
(
CustomerGraphicsDelay
item
:
sourceCustomerList
)
{
// 设置所属链接
item
.
setBelongReferralList
(
referralGroupMap
.
get
(
item
.
getId
()));
// 为公众号设置书城名
item
.
setAuthorizerInfo
(
sourceAuthInfo
);
}
for
(
String
targetAppId
:
targetAppList
)
{
// 构造目标公众号的信息
AuthorizerInfo
targetAuthInfo
=
authMap
.
get
(
targetAppId
);
if
(
ObjectUtil
.
isNull
(
targetAuthInfo
))
{
localLog
.
info
(
"appId: {} 找不到对应公众号"
,
targetAppId
);
// 执行下一个公众号
continue
;
}
targetAuthInfo
.
setStoreTypeName
(
storeTypeName
);
// 遍历要复用的素材
for
(
CustomerGraphicsDelay
item
:
sourceCustomerList
)
{
// 设置所属链接
item
.
setBelongReferralList
(
referralGroupMap
.
get
(
item
.
getId
()));
// 为公众号设置书城名
item
.
setAuthorizerInfo
(
sourceAuthInfo
);
// 执行复用
}
// 异步复用
commonAsyncComponent
.
obtainDelayGraphicsLink
(
sourceCustomerList
,
targetAuthInfo
);
}
return
n
ull
;
return
n
ew
BaseResult
().
success
(
"复用进行中, 请等待"
)
;
}
@Override
public
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
String
keyword
)
{
List
<
AuthInfoVO
>
authList
=
super
.
baseMapper
.
getAuthList
(
keyword
);
public
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
String
keyword
,
String
appId
)
{
String
storeType
=
null
;
if
(
ObjectUtil
.
isNotNull
(
appId
))
{
AuthorizerInfo
authInfo
=
authorizerInfoService
.
getOne
(
new
QueryWrapper
<
AuthorizerInfo
>().
eq
(
"appid"
,
appId
));
storeType
=
authInfo
.
getStoreType
();
}
List
<
String
>
keywordList
=
null
;
// 拆分多关键词
if
(
ObjectUtil
.
isNotNull
(
keyword
)
&&
keyword
.
contains
(
EMPTY_STR
))
{
String
[]
keywordSplit
=
keyword
.
split
(
EMPTY_STR
);
keywordList
=
Arrays
.
asList
(
keywordSplit
);
keyword
=
null
;
}
List
<
AuthInfoVO
>
authList
=
super
.
baseMapper
.
getAuthList
(
keyword
,
keywordList
,
storeType
);
return
new
GenericsResult
<>(
authList
);
}
...
...
src/main/java/com/yaoyaozw/customer/vo/AuthInfoVO.java
浏览文件 @
42445d1d
...
...
@@ -2,6 +2,7 @@ package com.yaoyaozw.customer.vo;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yaoyaozw.customer.entity.AuthorizerInfo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -33,4 +34,13 @@ public class AuthInfoVO implements Serializable {
@ApiModelProperty
(
"书城名"
)
private
String
storeTypeName
;
public
void
putPropertyValue
(
AuthorizerInfo
authorizerInfo
)
{
this
.
id
=
authorizerInfo
.
getId
();
this
.
accountId
=
authorizerInfo
.
getAccountId
();
this
.
appId
=
authorizerInfo
.
getAppid
();
this
.
accountName
=
authorizerInfo
.
getNickName
();
this
.
storeType
=
authorizerInfo
.
getStoreType
();
this
.
storeTypeName
=
authorizerInfo
.
getStoreTypeName
();
}
}
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
浏览文件 @
42445d1d
...
...
@@ -97,8 +97,19 @@
nick_name as accountName,
store_type as storeType
from authorizer_info
<if
test=
"keyword != null and keyword != ''"
>
where nick_name like concat('%', #{keyword}, '%')
</if>
<where>
<if
test=
"keyword != null and keyword != ''"
>
and nick_name like concat('%', #{keyword}, '%')
</if>
<if
test=
"keywordList != null and keywordList.size() != 0"
>
and nick_name in
<foreach
collection=
"keywordList"
separator=
","
open=
"("
close=
")"
item=
"splitKeyword"
>
#{splitKeyword}
</foreach>
</if>
<if
test=
"storeType != null and storeType != ''"
>
and store_type = #{storeType}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论