Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
a1e6598d
提交
a1e6598d
authored
10月 22, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整
上级
f29dae2a
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
149 行增加
和
38 行删除
+149
-38
pom.xml
pom.xml
+2
-2
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+16
-26
RabbitConfig.java
...main/java/com/yaoyaozw/customer/configs/RabbitConfig.java
+3
-6
CustomerCommonController.java
...aoyaozw/customer/controller/CustomerCommonController.java
+8
-1
CustomerCommonLink.java
...java/com/yaoyaozw/customer/entity/CustomerCommonLink.java
+24
-0
MaterialCommonMapper.java
...va/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
+17
-0
CustomerServiceCommonService.java
...oyaozw/customer/service/CustomerServiceCommonService.java
+28
-0
CustomerDelayTextServiceImpl.java
...w/customer/service/impl/CustomerDelayTextServiceImpl.java
+1
-1
CustomerServiceCommonServiceImpl.java
...stomer/service/impl/CustomerServiceCommonServiceImpl.java
+28
-2
CustomerDelayListVO.java
...om/yaoyaozw/customer/vo/customer/CustomerDelayListVO.java
+2
-0
CustomerGraphicsDelayMapper.xml
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
+1
-0
MaterialCommonMapper.xml
src/main/resources/mapper/MaterialCommonMapper.xml
+19
-0
没有找到文件。
pom.xml
浏览文件 @
a1e6598d
...
...
@@ -224,10 +224,10 @@
<artifactId>
spring-cloud-starter-netflix-hystrix
</artifactId>
</dependency>
<dependency>
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependency>
-->
<dependency>
...
...
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
a1e6598d
...
...
@@ -19,6 +19,7 @@ import com.yaoyaozw.customer.mapper.CustomerGraphicsMapper;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionMatchService
;
import
com.yaoyaozw.customer.service.CustomerServiceCommonService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.service.RegisterUserEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
...
...
@@ -27,8 +28,6 @@ import com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
...
...
@@ -63,15 +62,13 @@ public class CustomerServiceCommonAsyncComponent {
@Autowired
private
ReferralFeignClient
referralFeignClient
;
@Autowired
private
MaterialCommonMapper
materialCommonMapper
;
private
CustomerServiceCommonService
customerServiceCommonService
;
@Autowired
private
CustomerGraphicsMapper
customerGraphicsMapper
;
@Autowired
private
KanbanCommonMapper
kanbanCommonMapper
;
@Autowired
private
CustomerGraphicsDelayMapper
customerGraphicsDelayMapper
;
@Autowired
private
RabbitTemplate
rabbitTemplate
;
@Async
(
"myExecutor"
)
...
...
@@ -241,7 +238,7 @@ public class CustomerServiceCommonAsyncComponent {
LOCAL_LOG
.
info
(
"当前处理书城: {}"
,
storeType
);
// 去重提取公众号
Set
<
String
>
accountSet
=
userVoList
.
stream
().
map
(
CrowdPackageUserVO:
:
getAccountId
).
collect
(
Collectors
.
toSet
());
List
<
AuthInfoVO
>
authInfoList
=
materialCommonMapper
.
getAuthInfoList
(
accountSet
);
List
<
AuthInfoVO
>
authInfoList
=
customerServiceCommonService
.
getAuthInfoList
(
accountSet
);
// 定义
List
<
ReferralEntity
>
referralEntityList
=
new
ArrayList
<>(
accountSet
.
size
());
for
(
AuthInfoVO
authInfoVo
:
authInfoList
)
{
...
...
@@ -308,7 +305,7 @@ public class CustomerServiceCommonAsyncComponent {
if
(
isLegal
)
{
// 去重提取公众号
Set
<
String
>
accountSet
=
userVoList
.
stream
().
map
(
CrowdPackageUserVO:
:
getAccountId
).
collect
(
Collectors
.
toSet
());
List
<
AuthInfoVO
>
authInfoList
=
materialCommonMapper
.
getAuthInfoList
(
accountSet
);
List
<
AuthInfoVO
>
authInfoList
=
customerServiceCommonService
.
getAuthInfoList
(
accountSet
);
// 定义
List
<
ReferralEntity
>
referralEntityList
=
new
ArrayList
<>(
accountSet
.
size
());
...
...
@@ -339,12 +336,16 @@ public class CustomerServiceCommonAsyncComponent {
private
void
generateMessageUsualLink
(
Map
<
String
,
List
<
CrowdPackageUserVO
>>
storeGroupMap
,
ReferralEntity
customerReferral
)
{
Map
<
String
,
String
>
storeEntityMap
=
getStoreEntityMap
(
storeGroupMap
.
keySet
());
// 获取常用链接映射关系
Map
<
String
,
Map
<
String
,
String
>>
storeToCurrentToOriginMap
=
customerServiceCommonService
.
storeCommonLinkMap
(
customerReferral
.
getName
());
storeGroupMap
.
forEach
((
storeType
,
userVoList
)
->
{
LOCAL_LOG
.
info
(
"当前处理书城: {}"
,
storeType
);
// 去重提取公众号
Set
<
String
>
accountSet
=
userVoList
.
stream
().
map
(
CrowdPackageUserVO:
:
getAccountId
).
collect
(
Collectors
.
toSet
());
List
<
AuthInfoVO
>
authInfoList
=
materialCommonMapper
.
getAuthInfoList
(
accountSet
);
List
<
AuthInfoVO
>
authInfoList
=
customerServiceCommonService
.
getAuthInfoList
(
accountSet
);
Map
<
String
,
String
>
currentToOriginMap
=
storeToCurrentToOriginMap
.
get
(
storeType
.
replaceAll
(
"_[0-9]"
,
""
));
// 定义
List
<
ReferralEntity
>
referralEntityList
=
new
ArrayList
<>(
accountSet
.
size
());
...
...
@@ -357,6 +358,13 @@ public class CustomerServiceCommonAsyncComponent {
referralEntity
.
setAccountId
(
authInfoVo
.
getAccountId
());
referralEntity
.
setStoreTypeName
(
storeEntityMap
.
get
(
storeType
));
String
name
=
referralEntity
.
getName
();
LOCAL_LOG
.
info
(
"获取到常用链接当前key: {}"
,
name
);
String
originKey
=
currentToOriginMap
.
get
(
name
);
LOCAL_LOG
.
info
(
"获取到原始常用链接key: {}"
,
originKey
);
referralEntity
.
setName
(
originKey
);
// 常用链接不需要日期
getCopyReferral
(
null
,
authInfoVo
,
referralEntity
);
referralEntityList
.
add
(
referralEntity
);
...
...
@@ -592,25 +600,7 @@ public class CustomerServiceCommonAsyncComponent {
return
userEntityList
;
}
public
void
controlSunshineFrequency
()
{
RegisterUserEntity
registerUserEntity
=
new
RegisterUserEntity
();
registerUserEntity
.
setOpenId
(
"abc"
);
registerUserEntity
.
setId
(
111L
);
registerUserEntity
.
setCustomerSort
(
10
);
String
jsonStr
=
JSONUtil
.
toJsonStr
(
registerUserEntity
);
rabbitTemplate
.
convertAndSend
(
"TTL_EXCHANGE"
,
"yg_limit"
,
jsonStr
);
}
@RabbitListener
(
queues
=
"DEATH_QUEUE"
)
public
void
handle
(
String
message
)
{
RegisterUserEntity
registerUserEntity
=
JSONUtil
.
toBean
(
message
,
RegisterUserEntity
.
class
);
LOCAL_LOG
.
info
(
"------------------收到消息:"
+
registerUserEntity
);
}
}
src/main/java/com/yaoyaozw/customer/configs/RabbitConfig.java
浏览文件 @
a1e6598d
package
com
.
yaoyaozw
.
customer
.
configs
;
import
org.springframework.amqp.core.*
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -11,17 +10,15 @@ import java.util.Map;
* @author darker
* @date 2022/10/21 16:04
*/
@Configuration
//
@Configuration
public
class
RabbitConfig
{
@Bean
/*
@Bean
public Queue directQueue(){
Map<String, Object> map = new HashMap<>(4);
map.put("x-dead-letter-exchange", "DEATH_EXCHANGE");
map.put("x-dead-letter-routing-key", "death");
map
.
put
(
"x-max-length"
,
30
);
map.put("x-message-ttl", 60000);
map
.
put
(
"x-overflow"
,
60000
);
return new Queue("YG_ACCESS_LIMIT", true, false, false, map);
}
...
...
@@ -48,7 +45,7 @@ public class RabbitConfig {
@Bean
public Binding bindingDeath(){
return BindingBuilder.bind(deathQueue()).to(deathExchange()).with("death");
}
}
*/
}
src/main/java/com/yaoyaozw/customer/controller/CustomerCommonController.java
浏览文件 @
a1e6598d
...
...
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author darker
...
...
@@ -31,9 +32,15 @@ public class CustomerCommonController {
}
@GetMapping
(
"/getCoverPicList"
)
@ApiOperation
(
"获取
书城
列表"
)
@ApiOperation
(
"获取
封面图
列表"
)
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCoverPicList
()
{
return
commonService
.
getCoverPicList
();
}
@GetMapping
(
"/getCommonLinkList"
)
@ApiOperation
(
"获取合并书城之后的常用链接列表"
)
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCommonLinkList
()
{
return
commonService
.
getCommonLinkList
();
}
}
src/main/java/com/yaoyaozw/customer/entity/CustomerCommonLink.java
0 → 100644
浏览文件 @
a1e6598d
package
com
.
yaoyaozw
.
customer
.
entity
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author darker
* @date 2022/10/22 14:58
*/
@Data
public
class
CustomerCommonLink
implements
Serializable
{
private
Long
id
;
private
String
storeType
;
private
String
originKey
;
private
String
originName
;
private
String
dictCurrentKey
;
}
src/main/java/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
浏览文件 @
a1e6598d
package
com
.
yaoyaozw
.
customer
.
mapper
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.entity.CustomerCommonLink
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -40,4 +42,19 @@ public interface MaterialCommonMapper {
*/
List
<
CommonOptionResponseVO
>
getCoverPicList
();
/**
* 让常见链接列表
*
* @return {@link List}<{@link CommonOptionResponseVO}
*/
List
<
CommonOptionResponseVO
>
getCommonLinkList
();
/**
* 让共同链接映射
*
* @param currentKey 当前key
* @return {@link List}<{@link CustomerCommonLink}>
*/
List
<
CustomerCommonLink
>
getCommonLinkMapping
(
@Param
(
"currentKey"
)
String
currentKey
);
}
src/main/java/com/yaoyaozw/customer/service/CustomerServiceCommonService.java
浏览文件 @
a1e6598d
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @author darker
...
...
@@ -32,4 +35,29 @@ public interface CustomerServiceCommonService {
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCoverPicList
();
/**
* 让常见链接列表
*
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCommonLinkList
();
/**
* 让常见链接列表
*
* @param accountSet 帐户设置
* @return {@link List}<{@link AuthInfoVO}>
*/
List
<
AuthInfoVO
>
getAuthInfoList
(
Set
<
String
>
accountSet
);
/**
* 获取书城常用链接映射
*
* @param currentKey 当前key
* @return {@link Map}<{@link String}, {@link Map}<{@link String}, {@link String}>>
*/
Map
<
String
,
Map
<
String
,
String
>>
storeCommonLinkMap
(
String
currentKey
);
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerDelayTextServiceImpl.java
浏览文件 @
a1e6598d
...
...
@@ -169,7 +169,7 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
mainH5Content
.
append
(
"\n"
).
append
(
"\n"
);
}
// 将链接中的占位符换成链接
customerContentVO
.
setContent
(
context
.
replace
(
CustomerCommonConstant
.
CUSTOMER_TEXT_URL_PLACEHOLDER
+
idx
,
"#"
));
customerContentVO
.
setContent
(
context
.
replace
(
CustomerCommonConstant
.
CUSTOMER_TEXT_URL_PLACEHOLDER
,
"#"
));
}
// 赋值链接信息
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerServiceCommonServiceImpl.java
浏览文件 @
a1e6598d
...
...
@@ -2,15 +2,17 @@ package com.yaoyaozw.customer.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.entity.CustomerCommonLink
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
import
com.yaoyaozw.customer.service.CustomerServiceCommonService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.
ArrayList
;
import
java.util.
List
;
import
java.util.
*
;
import
java.util.
stream.Collectors
;
/**
* @author darker
...
...
@@ -44,4 +46,28 @@ public class CustomerServiceCommonServiceImpl implements CustomerServiceCommonSe
return
new
GenericsResult
<>(
coverPicList
);
}
@Override
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCommonLinkList
()
{
List
<
CommonOptionResponseVO
>
commonLinkList
=
materialCommonMapper
.
getCommonLinkList
();
return
new
GenericsResult
<>(
commonLinkList
);
}
@Override
public
List
<
AuthInfoVO
>
getAuthInfoList
(
Set
<
String
>
accountSet
)
{
return
materialCommonMapper
.
getAuthInfoList
(
accountSet
);
}
@Override
public
Map
<
String
,
Map
<
String
,
String
>>
storeCommonLinkMap
(
String
currentKey
)
{
List
<
CustomerCommonLink
>
commonLinkMapping
=
materialCommonMapper
.
getCommonLinkMapping
(
currentKey
);
return
commonLinkMapping
.
stream
().
collect
(
Collectors
.
groupingBy
(
CustomerCommonLink:
:
getStoreType
,
// 第二层map
HashMap:
:
new
,
Collectors
.
groupingBy
(
CustomerCommonLink:
:
getDictCurrentKey
,
// 处理内层list
HashMap:
:
new
,
Collectors
.
collectingAndThen
(
Collectors
.
toList
(),
item
->
item
.
get
(
0
).
getOriginKey
()))));
}
}
src/main/java/com/yaoyaozw/customer/vo/customer/CustomerDelayListVO.java
浏览文件 @
a1e6598d
...
...
@@ -26,6 +26,8 @@ public class CustomerDelayListVO implements Serializable {
@ApiModelProperty
(
"客服消息类型(图文、文本)"
)
private
String
type
;
private
String
payType
;
@ApiModelProperty
(
"标题"
)
private
String
name
;
...
...
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
浏览文件 @
a1e6598d
...
...
@@ -46,6 +46,7 @@
cgd.id,
cgd.name,
cgd.type,
if(cgd.is_pay = -1, '不限', if(cgd.is_pay = 0, '未支付', '已支付')) as payType,
ai.nick_name as accountName,
cgd.post_sort as postSort,
cgd.time_interval as `timestamp` ,
...
...
src/main/resources/mapper/MaterialCommonMapper.xml
浏览文件 @
a1e6598d
...
...
@@ -33,4 +33,22 @@
order by sort
</select>
<select
id=
"getCommonLinkList"
resultType=
"com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO"
>
select
dic_key as `value`,
dic_value as `label`
from sys_dictionary
where is_deleted = 0
and group_id = 'CUSTOMER_COMMON_LINK'
and level = 3
order by sort
</select>
<select
id=
"getCommonLinkMapping"
resultType=
"com.yaoyaozw.customer.entity.CustomerCommonLink"
>
select * from customer_common_link
<if
test=
"currentKey != null and currentKey != ''"
>
where dict_current_key = #{currentKey}
</if>
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论