Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
b79b3207
提交
b79b3207
authored
10月 14, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'customer_service_SZlu'
上级
ec5df316
a290d60b
显示空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
933 行增加
和
111 行删除
+933
-111
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+44
-21
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+12
-0
CustomerDelayController.java
...yaoyaozw/customer/controller/CustomerDelayController.java
+0
-51
CustomerDelayGraphicsController.java
.../customer/controller/CustomerDelayGraphicsController.java
+87
-0
CustomerMessageTextController.java
...zw/customer/controller/CustomerMessageTextController.java
+4
-4
CustomerDelayQueryDTO.java
...yaoyaozw/customer/dto/customer/CustomerDelayQueryDTO.java
+7
-5
CustomerDelaySaveDTO.java
.../yaoyaozw/customer/dto/customer/CustomerDelaySaveDTO.java
+25
-3
CustomerMessageSaveDTO.java
...aoyaozw/customer/dto/customer/CustomerMessageSaveDTO.java
+1
-1
AuthorizerInfo.java
...ain/java/com/yaoyaozw/customer/entity/AuthorizerInfo.java
+104
-0
CustomerGraphicsDelay.java
...a/com/yaoyaozw/customer/entity/CustomerGraphicsDelay.java
+64
-2
AuthorizerInfoMapper.java
...va/com/yaoyaozw/customer/mapper/AuthorizerInfoMapper.java
+18
-0
CustomerGraphicsDelayMapper.java
...yaoyaozw/customer/mapper/CustomerGraphicsDelayMapper.java
+39
-2
AuthorizerInfoService.java
.../com/yaoyaozw/customer/service/AuthorizerInfoService.java
+16
-0
CustomerGraphicsDelayService.java
...oyaozw/customer/service/CustomerGraphicsDelayService.java
+80
-0
CustomerGraphicsTextService.java
...aoyaozw/customer/service/CustomerGraphicsTextService.java
+7
-7
CustomerTextDelayService.java
...m/yaoyaozw/customer/service/CustomerTextDelayService.java
+19
-0
AuthorizerInfoServiceImpl.java
...aozw/customer/service/impl/AuthorizerInfoServiceImpl.java
+19
-0
CustomerGraphicsDelayServiceImpl.java
...stomer/service/impl/CustomerGraphicsDelayServiceImpl.java
+196
-2
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+3
-5
CustomerGraphicsTextServiceImpl.java
...ustomer/service/impl/CustomerGraphicsTextServiceImpl.java
+6
-6
CustomerTextDelayServiceImpl.java
...w/customer/service/impl/CustomerTextDelayServiceImpl.java
+22
-0
AuthInfoVO.java
src/main/java/com/yaoyaozw/customer/vo/AuthInfoVO.java
+12
-0
CustomerDelayGraphicsDetailVO.java
...w/customer/vo/customer/CustomerDelayGraphicsDetailVO.java
+43
-0
CustomerDelayListVO.java
...om/yaoyaozw/customer/vo/customer/CustomerDelayListVO.java
+34
-1
CustomerMessageTextDetailVO.java
...ozw/customer/vo/customer/CustomerMessageTextDetailVO.java
+1
-1
application-dev.yml
src/main/resources/application-dev.yml
+1
-0
CustomerGraphicsDelayMapper.xml
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
+68
-0
CustomerGraphicsMapper.xml
src/main/resources/mapper/CustomerGraphicsMapper.xml
+1
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
b79b3207
...
...
@@ -14,10 +14,12 @@ import com.yaoyaozw.customer.constants.CrowdPackageCommonConstant;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.entity.CustomerGraphicsDelay
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.entity.RegisterUserEntity
;
import
com.yaoyaozw.customer.enums.CustomerStoreTemplateEnum
;
import
com.yaoyaozw.customer.feigns.ReferralFeignClient
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsMapper
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
...
...
@@ -69,6 +71,8 @@ public class CustomerServiceCommonAsyncComponent {
private
CustomerGraphicsMapper
customerGraphicsMapper
;
@Autowired
private
KanbanCommonMapper
kanbanCommonMapper
;
@Autowired
private
CustomerGraphicsDelayMapper
customerGraphicsDelayMapper
;
@Async
(
"myExecutor"
)
...
...
@@ -135,44 +139,49 @@ public class CustomerServiceCommonAsyncComponent {
}
@Async
(
"myExecutor"
)
public
void
obtainLink
(
Long
materialId
,
CustomerGraphics
customerGraphics
,
List
<
ReferralEntity
>
referralEntityList
)
{
for
(
ReferralEntity
referralEntity
:
referralEntityList
)
{
public
void
obtainMessageLink
(
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
)
{
// 获取链接
if
(
CustomerCommonConstant
.
REPLACE_LINK_NEWS_TYPE_LIST
.
contains
(
referralEntity
.
getNewsType
()))
{
LOCAL_LOG
.
info
(
"异步获取图文客服链接"
);
get
AuthListLink
(
customerGraphics
,
referralEntity
);
get
MessageAuthListLink
(
storeGroupMap
,
customerGraphics
,
referralEntity
);
}
else
{
LOCAL_LOG
.
info
(
"newsType: {}, 不需要获取链接"
,
referralEntity
.
getNewsType
());
}
}
// 处理完之后将状态改为待发送
customerGraphics
.
setSendStatus
(
2
);
customerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_LINK_FINISH
);
customerGraphicsMapper
.
updateById
(
customerGraphics
);
}
@Async
(
"myExecutor"
)
public
void
obtainDelayLink
(
Long
materialId
,
CustomerGraphicsDelay
customerGraphicsDelay
,
List
<
ReferralEntity
>
referralEntityList
)
{
private
List
<
RegisterUserEntity
>
encapsulateUserEntity
(
List
<
CrowdPackageUserVO
>
userList
)
{
List
<
RegisterUserEntity
>
userEntityList
=
new
ArrayList
<>();
for
(
CrowdPackageUserVO
crowdPackageUserVO
:
userList
)
{
RegisterUserEntity
registerUserEntity
=
new
RegisterUserEntity
();
registerUserEntity
.
setId
(
crowdPackageUserVO
.
getId
());
registerUserEntity
.
setInPackage
(
crowdPackageUserVO
.
getInPackage
());
userEntityList
.
add
(
registerUserEntity
);
}
return
userEntityList
;
}
private
void
getAuthListLink
(
CustomerGraphics
customerMain
,
ReferralEntity
customerReferral
)
{
private
void
getMessageAuthListLink
(
Map
<
String
,
List
<
CrowdPackageUserVO
>>
storeGroupMap
,
CustomerGraphics
customerMain
,
ReferralEntity
customerReferral
)
{
Long
packId
=
customerMain
.
getPackId
();
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
();
// 一个书城一个书城地处理
...
...
@@ -235,6 +244,7 @@ public class CustomerServiceCommonAsyncComponent {
storeGroupMap
.
forEach
((
storeType
,
userVoList
)
->
{
LOCAL_LOG
.
info
(
"当前处理书城: {}"
,
storeType
);
boolean
isLegal
=
true
;
String
configId
=
null
;
// 阳光、掌中云 需要获取configId
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
);
...
...
@@ -247,9 +257,8 @@ public class CustomerServiceCommonAsyncComponent {
if
(!
CollectionUtil
.
isEmpty
(
activityConfigList
))
{
// 转换config
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
);
customerReferral
.
setConfigId
(
configId
);
if
(
ObjectUtil
.
isNull
(
configId
))
{
isLegal
=
false
;
}
...
...
@@ -258,6 +267,8 @@ public class CustomerServiceCommonAsyncComponent {
LOCAL_LOG
.
info
(
"无法获取资源配置, 中断当前循环"
);
}
}
customerReferral
.
setConfigId
(
configId
);
String
tempId
=
CustomerStoreTemplateEnum
.
getTempId
(
storeType
);
customerReferral
.
setTemplateId
(
tempId
);
...
...
@@ -287,6 +298,7 @@ public class CustomerServiceCommonAsyncComponent {
}
// 批量新增
LOCAL_LOG
.
info
(
"保存书城: {} 的链接实体, 数量:{}条"
,
storeType
,
referralEntityList
.
size
());
referralEntityService
.
saveBatch
(
referralEntityList
);
}
});
...
...
@@ -367,5 +379,16 @@ public class CustomerServiceCommonAsyncComponent {
}
private
List
<
RegisterUserEntity
>
encapsulateUserEntity
(
List
<
CrowdPackageUserVO
>
userList
)
{
List
<
RegisterUserEntity
>
userEntityList
=
new
ArrayList
<>();
for
(
CrowdPackageUserVO
crowdPackageUserVO
:
userList
)
{
RegisterUserEntity
registerUserEntity
=
new
RegisterUserEntity
();
registerUserEntity
.
setId
(
crowdPackageUserVO
.
getId
());
registerUserEntity
.
setInPackage
(
crowdPackageUserVO
.
getInPackage
());
userEntityList
.
add
(
registerUserEntity
);
}
return
userEntityList
;
}
}
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
b79b3207
...
...
@@ -39,6 +39,7 @@ public class CustomerCommonConstant {
public
final
static
String
CUSTOMER_TEXT_URL_PLACEHOLDER
=
"{url}-"
;
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
String
USUAL_LINK_NEWS_TYPE_NAME
=
"常用"
;
...
...
@@ -51,6 +52,17 @@ public class CustomerCommonConstant {
public
final
static
String
CUSTOMER_TYPE_NAME_TEXT
=
"文本"
;
public
final
static
Integer
SEND_STATUS_WAITING
=
0
;
public
final
static
Integer
SEND_STATUS_LINK_GETTING
=
1
;
public
final
static
Integer
SEND_STATUS_LINK_FINISH
=
2
;
public
final
static
Integer
SEND_STATUS_SENT_SUCCESS
=
3
;
public
final
static
Integer
SEND_STATUS_SENT_FAIL
=
4
;
public
static
String
getCustomerType
(
String
type
)
{
if
(
ObjectUtil
.
isNull
(
type
))
{
return
null
;
...
...
src/main/java/com/yaoyaozw/customer/controller/CustomerDelayController.java
deleted
100644 → 0
浏览文件 @
ec5df316
package
com
.
yaoyaozw
.
customer
.
controller
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelayQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelaySaveDTO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayListVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author darker
* @date 2022/9/15 11:13
*/
@Api
(
tags
=
"延时客服接口"
)
@RestController
@RequestMapping
(
"/customer-service/delay"
)
public
class
CustomerDelayController
{
@ApiOperation
(
"新增"
)
@PostMapping
(
"/insert"
)
public
BaseResult
insertCustomerDelay
(
@RequestBody
CustomerDelaySaveDTO
saveDto
)
{
return
new
BaseResult
().
success
();
}
@ApiOperation
(
"编辑"
)
@PostMapping
(
"/edit"
)
public
BaseResult
updateCustomerDelay
(
@RequestBody
CustomerDelaySaveDTO
saveDto
)
{
return
new
BaseResult
().
success
();
}
@ApiOperation
(
"查询"
)
@PostMapping
(
"/pageList"
)
public
GenericsResult
<
List
<
CustomerDelayListVO
>>
pageList
(
@RequestBody
CustomerDelayQueryDTO
queryDto
)
{
return
new
GenericsResult
<>(
new
ArrayList
<>());
}
@ApiOperation
(
"删除"
)
@GetMapping
(
"/remove/{id}"
)
public
BaseResult
removeCustomerDelay
(
@PathVariable
(
"id"
)
Long
id
)
{
return
new
BaseResult
().
success
();
}
}
src/main/java/com/yaoyaozw/customer/controller/CustomerDelayGraphicsController.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelayQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelaySaveDTO
;
import
com.yaoyaozw.customer.service.CustomerGraphicsDelayService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.CommonOptionResponseVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayListVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayGraphicsDetailVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author darker
* @date 2022/9/15 11:13
*/
@Api
(
tags
=
"延时客服接口"
)
@RestController
@RequestMapping
(
"/customer-service/delay/graphics"
)
public
class
CustomerDelayGraphicsController
{
@Autowired
private
CustomerGraphicsDelayService
customerGraphicsDelayService
;
@ApiOperation
(
"新增"
)
@PostMapping
(
"/insert"
)
public
BaseResult
insertCustomerDelay
(
@RequestBody
CustomerDelaySaveDTO
saveDto
)
{
return
customerGraphicsDelayService
.
insertCustomerDelay
(
saveDto
);
}
@ApiOperation
(
"获取详情"
)
@GetMapping
(
"/detail/{id}"
)
public
GenericsResult
<
CustomerDelayGraphicsDetailVO
>
getCustomerDelayDetail
(
@PathVariable
(
"id"
)
Long
id
)
{
return
customerGraphicsDelayService
.
getCustomerDelayDetail
(
id
);
}
@ApiOperation
(
"查询"
)
@PostMapping
(
"/pageList"
)
public
GenericsResult
<
PageInfo
<
CustomerDelayListVO
>>
pageList
(
@RequestBody
CustomerDelayQueryDTO
queryDto
)
{
return
customerGraphicsDelayService
.
pageList
(
queryDto
);
}
@ApiOperation
(
"获取已生成客服的公众号列表"
)
@GetMapping
(
"/getExistCustomerAccount"
)
public
GenericsResult
<
List
<
AuthInfoVO
>>
getExistCustomerAccount
(
@RequestParam
(
required
=
false
)
String
keyword
)
{
return
customerGraphicsDelayService
.
getExistCustomerAccount
(
keyword
);
}
@ApiOperation
(
"删除"
)
@GetMapping
(
"/remove/{id}"
)
public
BaseResult
removeCustomerDelay
(
@PathVariable
(
"id"
)
Long
id
)
{
return
customerGraphicsDelayService
.
removeCustomerDelay
(
id
);
}
@ApiOperation
(
"批量删除"
)
@PostMapping
(
"/removeBatch"
)
public
BaseResult
removeBatch
(
@RequestBody
List
<
Long
>
idList
)
{
return
customerGraphicsDelayService
.
removeBatch
(
idList
);
}
@ApiOperation
(
"复用"
)
@PostMapping
(
"/copy"
)
public
BaseResult
copy
(
@RequestParam
String
appId
,
@RequestBody
List
<
String
>
targetAppList
)
{
return
customerGraphicsDelayService
.
copy
(
appId
,
targetAppList
);
}
@ApiOperation
(
"所有公众号"
)
@GetMapping
(
"/getAuthList"
)
public
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
@RequestParam
(
required
=
false
)
String
keyword
)
{
return
customerGraphicsDelayService
.
getAuthList
(
keyword
);
}
@ApiOperation
(
"时间间隔"
)
@GetMapping
(
"/getTimeIntervalList"
)
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getTimeIntervalList
()
{
return
customerGraphicsDelayService
.
getTimeIntervalList
();
}
}
src/main/java/com/yaoyaozw/customer/controller/CustomerMessageTextController.java
浏览文件 @
b79b3207
...
...
@@ -4,7 +4,7 @@ import com.yaoyaozw.customer.common.GenericsResult;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageTextSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
com.yaoyaozw.customer.service.CustomerGraphicsTextService
;
import
com.yaoyaozw.customer.vo.customer.Customer
Graphic
TextDetailVO
;
import
com.yaoyaozw.customer.vo.customer.Customer
Message
TextDetailVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -30,19 +30,19 @@ public class CustomerMessageTextController {
@ApiOperation
(
"新增客服内容"
)
@PostMapping
(
"/insertCustomerContent"
)
public
GenericsResult
<
Customer
Graphic
TextDetailVO
>
insertCustomerContent
(
@RequestBody
CustomerReferralDTO
referralDto
)
{
public
GenericsResult
<
Customer
Message
TextDetailVO
>
insertCustomerContent
(
@RequestBody
CustomerReferralDTO
referralDto
)
{
return
textService
.
insertCustomerContent
(
referralDto
);
}
@ApiOperation
(
"获取文本客服详情"
)
@GetMapping
(
"/detail/{id}"
)
public
GenericsResult
<
Customer
Graphic
TextDetailVO
>
getCustomerTextDetail
(
@PathVariable
(
"id"
)
Long
id
)
{
public
GenericsResult
<
Customer
Message
TextDetailVO
>
getCustomerTextDetail
(
@PathVariable
(
"id"
)
Long
id
)
{
return
textService
.
getCustomerTextDetail
(
id
);
}
@ApiOperation
(
"删除单条文本内容"
)
@GetMapping
(
"/removeCustomerContent/{contentId}"
)
public
GenericsResult
<
Customer
Graphic
TextDetailVO
>
removeCustomerContent
(
@PathVariable
(
"contentId"
)
Long
contentId
)
{
public
GenericsResult
<
Customer
Message
TextDetailVO
>
removeCustomerContent
(
@PathVariable
(
"contentId"
)
Long
contentId
)
{
return
textService
.
removeCustomerContent
(
contentId
);
}
...
...
src/main/java/com/yaoyaozw/customer/dto/customer/CustomerDelayQueryDTO.java
浏览文件 @
b79b3207
...
...
@@ -12,17 +12,19 @@ import java.io.Serializable;
* @author darker
* @date 2022/9/15 11:20
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@ApiModel
(
"延时客服列表查询实体"
)
public
class
CustomerDelayQueryDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3580731044930990755L
;
public
class
CustomerDelayQueryDTO
extends
PageParams
implements
Serializable
{
@ApiModelProperty
(
"消息名称关键词"
)
private
String
messageK
eyword
;
private
String
k
eyword
;
@ApiModelProperty
(
"客服消息类型"
)
private
Integer
messageType
;
private
String
type
;
@ApiModelProperty
(
"公众号AppID"
)
private
String
appId
;
}
src/main/java/com/yaoyaozw/customer/dto/customer/CustomerDelaySaveDTO.java
浏览文件 @
b79b3207
...
...
@@ -13,13 +13,35 @@ import java.io.Serializable;
@Data
@ApiModel
(
"延时客服保存实体"
)
public
class
CustomerDelaySaveDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3396784031787662255L
;
@ApiModelProperty
(
"主键ID"
)
private
Long
id
;
@ApiModelProperty
(
"公众号appId"
)
private
String
appId
;
@ApiModelProperty
(
"客服消息名称"
)
private
String
messageName
;
private
String
name
;
@ApiModelProperty
(
"客服消息类型(图文、文本)"
)
private
String
type
;
@ApiModelProperty
(
"客服消息类型(图文、文本)"
)
private
String
extendTitle
;
@ApiModelProperty
(
"客服消息类型(图文、文本)"
)
private
Integer
messageType
;
private
String
coverUrl
;
@ApiModelProperty
(
"文本内容"
)
private
String
content
;
@ApiModelProperty
(
"发文序号"
)
private
Integer
postSort
;
@ApiModelProperty
(
"发文间隔时间"
)
private
Long
timeInterval
;
@ApiModelProperty
(
"消息内容实体"
)
private
CustomerReferralDTO
customerReferralDto
;
}
src/main/java/com/yaoyaozw/customer/dto/customer/CustomerMessageSaveDTO.java
浏览文件 @
b79b3207
...
...
@@ -11,7 +11,7 @@ import java.io.Serializable;
* @date 2022/9/15 11:14
*/
@Data
@ApiModel
(
"
延时客服
保存实体"
)
@ApiModel
(
"
客服消息
保存实体"
)
public
class
CustomerMessageSaveDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4269904448093268275L
;
...
...
src/main/java/com/yaoyaozw/customer/entity/AuthorizerInfo.java
0 → 100644
浏览文件 @
b79b3207
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
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author didi
* @Create 2022/3/23 19:26
*/
@ApiModel
(
value
=
"authorizer_info"
)
@Data
@TableName
(
value
=
"authorizer_info"
)
public
class
AuthorizerInfo
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
INPUT
)
@ApiModelProperty
(
value
=
""
)
private
Long
id
;
@TableField
(
value
=
"`alias`"
)
@ApiModelProperty
(
value
=
""
)
private
String
alias
;
@TableField
(
value
=
"appid"
)
@ApiModelProperty
(
value
=
""
)
private
String
appid
;
@TableField
(
value
=
"create_time"
)
@ApiModelProperty
(
value
=
""
)
private
Date
createTime
;
@TableField
(
value
=
"head_img"
)
@ApiModelProperty
(
value
=
""
)
private
String
headImg
;
@TableField
(
value
=
"nick_name"
)
@ApiModelProperty
(
value
=
""
)
private
String
nickName
;
@TableField
(
value
=
"principal_name"
)
@ApiModelProperty
(
value
=
""
)
private
String
principalName
;
@TableField
(
value
=
"qrcode_url"
)
@ApiModelProperty
(
value
=
""
)
private
String
qrcodeUrl
;
@TableField
(
value
=
"service_type_info"
)
@ApiModelProperty
(
value
=
""
)
private
String
serviceTypeInfo
;
@TableField
(
value
=
"user_name"
)
@ApiModelProperty
(
value
=
""
)
private
String
userName
;
@TableField
(
value
=
"verify_type_info"
)
@ApiModelProperty
(
value
=
""
)
private
String
verifyTypeInfo
;
@TableField
(
value
=
"account_id"
)
@ApiModelProperty
(
value
=
""
)
private
String
accountId
;
@TableField
(
value
=
"store_type"
)
@ApiModelProperty
(
value
=
""
)
private
String
storeType
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
""
)
private
String
storeTypeName
;
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
COL_ID
=
"id"
;
public
static
final
String
COL_ALIAS
=
"alias"
;
public
static
final
String
COL_APPID
=
"appid"
;
public
static
final
String
COL_CREATE_TIME
=
"create_time"
;
public
static
final
String
COL_HEAD_IMG
=
"head_img"
;
public
static
final
String
COL_NICK_NAME
=
"nick_name"
;
public
static
final
String
COL_PRINCIPAL_NAME
=
"principal_name"
;
public
static
final
String
COL_QRCODE_URL
=
"qrcode_url"
;
public
static
final
String
COL_SERVICE_TYPE_INFO
=
"service_type_info"
;
public
static
final
String
COL_USER_NAME
=
"user_name"
;
public
static
final
String
COL_VERIFY_TYPE_INFO
=
"verify_type_info"
;
public
static
final
String
COL_ACCOUNT_ID
=
"account_id"
;
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/entity/CustomerGraphicsDelay.java
浏览文件 @
b79b3207
...
...
@@ -6,13 +6,20 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
lombok.Data
;
/**
* 客户图形延迟
*
* @author Admin
* @date 2022/10/13
*/
@Data
@TableName
(
value
=
"customer_graphics_delay"
)
public
class
CustomerGraphicsDelay
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ID_WORKER
)
private
Long
id
;
/**
...
...
@@ -22,6 +29,43 @@ public class CustomerGraphicsDelay implements Serializable {
private
String
appId
;
/**
* 标题
*/
@TableField
(
value
=
"name"
)
private
String
name
;
/**
* 类型
*/
@TableField
(
value
=
"type"
)
private
String
type
;
/**
* 推广标题
*/
@TableField
(
value
=
"extend_title"
)
private
String
extendTitle
;
/**
* 文本内容
*/
@TableField
(
value
=
"content"
)
private
String
content
;
/**
* 状态
*/
@TableField
(
value
=
"send_status"
)
private
Integer
sendStatus
;
/**
* 是否是历史遗留
*/
@TableField
(
value
=
"is_history"
)
private
Integer
isHistory
;
/**
* 发送序列
*/
@TableField
(
value
=
"post_sort"
)
...
...
@@ -61,7 +105,13 @@ public class CustomerGraphicsDelay implements Serializable {
* 逻辑删除
*/
@TableField
(
value
=
"is_deleted"
)
private
Boolean
isDeleted
;
private
Integer
isDeleted
;
@TableField
(
exist
=
false
)
private
List
<
ReferralEntity
>
belongReferralList
;
@TableField
(
exist
=
false
)
private
AuthorizerInfo
authorizerInfo
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -82,4 +132,15 @@ public class CustomerGraphicsDelay implements Serializable {
public
static
final
String
COL_GMT_MODIFIED
=
"gmt_modified"
;
public
static
final
String
COL_IS_DELETED
=
"is_deleted"
;
public
void
initOperateInfo
(
Long
userId
,
Boolean
isCreate
)
{
Date
now
=
new
Date
();
if
(
isCreate
)
{
this
.
createUser
=
userId
;
this
.
gmtCreate
=
now
;
}
this
.
gmtModified
=
now
;
this
.
modifiedUser
=
userId
;
}
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/mapper/AuthorizerInfoMapper.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
mapper
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yaoyaozw.customer.entity.AuthorizerInfo
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Author didi
* @Create 2022/3/23 19:26
*/
@Mapper
@DS
(
"material"
)
public
interface
AuthorizerInfoMapper
extends
BaseMapper
<
AuthorizerInfo
>
{
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/mapper/CustomerGraphicsDelayMapper.java
浏览文件 @
b79b3207
...
...
@@ -2,8 +2,12 @@ package com.yaoyaozw.customer.mapper;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelayQueryDTO
;
import
com.yaoyaozw.customer.entity.CustomerGraphicsDelay
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.CommonOptionResponseVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayListVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -11,16 +15,48 @@ import java.util.List;
import
java.util.Set
;
@DS
(
"material"
)
@Mapper
public
interface
CustomerGraphicsDelayMapper
extends
BaseMapper
<
CustomerGraphicsDelay
>
{
/**
* 根据appid找延时客服
*
* @param appidList
* @return
*/
List
<
CustomerDelayItemVO
>
findAllDelayCustomerMessage
(
@Param
(
"appidList"
)
Set
<
String
>
appidList
);
List
<
CustomerDelayItemVO
>
findDelayCustomerMessageByRange
(
@Param
(
"appidList"
)
Set
<
String
>
appidList
,
@Param
(
"maxSort"
)
Integer
maxSort
);
List
<
CustomerDelayItemVO
>
findDelayCustomerMessageByRange
(
@Param
(
"appidList"
)
Set
<
String
>
appidList
,
@Param
(
"maxSort"
)
Integer
maxSort
);
/**
* 页面列表
*
* @param queryDto 查询dto
* @return {@link List}<{@link CustomerDelayListVO}>
*/
List
<
CustomerDelayListVO
>
pageList
(
CustomerDelayQueryDTO
queryDto
);
/**
* 得到客户账户存在
*
* @param keyword 关键字
* @return {@link List}<{@link AuthInfoVO}>
*/
List
<
AuthInfoVO
>
getExistCustomerAccount
(
@Param
(
"keyword"
)
String
keyword
);
/**
* 让时间间隔列表
*
* @param keyword 关键词
* @return {@link List}<{@link AuthInfoVO}>
*/
List
<
AuthInfoVO
>
getAuthList
(
@Param
(
"keyword"
)
String
keyword
);
/**
* 让时间间隔列表
*
* @return {@link List}<{@link CommonOptionResponseVO}>
*/
List
<
CommonOptionResponseVO
>
getTimeIntervalList
();
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/service/AuthorizerInfoService.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yaoyaozw.customer.entity.AuthorizerInfo
;
/**
* 授权人信息服务
*
* @author Admin
* @date 2022/10/14
*/
public
interface
AuthorizerInfoService
extends
IService
<
AuthorizerInfo
>
{
}
src/main/java/com/yaoyaozw/customer/service/CustomerGraphicsDelayService.java
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.github.pagehelper.PageInfo
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelayQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelaySaveDTO
;
import
com.yaoyaozw.customer.entity.CustomerGraphicsDelay
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.CommonOptionResponseVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayGraphicsDetailVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayListVO
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -15,5 +24,76 @@ public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsD
List
<
CustomerDelayItemVO
>
findAllDelayCustomerMessage
(
Set
<
String
>
appidList
,
Integer
maxSortRage
);
/**
* 插入客户延迟
*
* @param saveDto 保存dto
* @return {@link BaseResult}
*/
BaseResult
insertCustomerDelay
(
CustomerDelaySaveDTO
saveDto
);
/**
* 得到客户延迟细节
*
* @param id id
* @return {@link GenericsResult}<{@link CustomerDelayGraphicsDetailVO}>
*/
GenericsResult
<
CustomerDelayGraphicsDetailVO
>
getCustomerDelayDetail
(
Long
id
);
/**
* 页面列表
*
* @param queryDto 查询dto
* @return {@link GenericsResult}<{@link PageInfo}<{@link CustomerDelayListVO}>>
*/
GenericsResult
<
PageInfo
<
CustomerDelayListVO
>>
pageList
(
CustomerDelayQueryDTO
queryDto
);
/**
* 得到客户账户存在
*
* @param keyword 关键词
* @return {@link GenericsResult}<{@link List}<{@link AuthInfoVO}>>
*/
GenericsResult
<
List
<
AuthInfoVO
>>
getExistCustomerAccount
(
String
keyword
);
/**
* 删除客户延迟
*
* @param id id
* @return {@link BaseResult}
*/
BaseResult
removeCustomerDelay
(
Long
id
);
/**
* 删除批处理
*
* @param idList id列表
* @return {@link BaseResult}
*/
BaseResult
removeBatch
(
List
<
Long
>
idList
);
/**
* 复制
*
* @param appId 应用程序id
* @param targetAppList 目标应用程序列表
* @return {@link BaseResult}
*/
BaseResult
copy
(
String
appId
,
List
<
String
>
targetAppList
);
/**
* 获得认证列表
*
* @param keyword 关键字
* @return {@link GenericsResult}<{@link List}<{@link AuthInfoVO}>>
*/
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
String
keyword
);
/**
* 让时间间隔列表
*
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getTimeIntervalList
();
}
src/main/java/com/yaoyaozw/customer/service/CustomerGraphicsTextService.java
浏览文件 @
b79b3207
...
...
@@ -5,7 +5,7 @@ import com.yaoyaozw.customer.common.GenericsResult;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageTextSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.vo.customer.Customer
Graphic
TextDetailVO
;
import
com.yaoyaozw.customer.vo.customer.Customer
Message
TextDetailVO
;
/**
...
...
@@ -26,24 +26,24 @@ public interface CustomerGraphicsTextService extends IService<CustomerGraphics>
* 新增客户内容
*
* @param referralDto 推荐dto
* @return {@link GenericsResult}<{@link Customer
Graphic
TextDetailVO}>
* @return {@link GenericsResult}<{@link Customer
Message
TextDetailVO}>
*/
GenericsResult
<
Customer
Graphic
TextDetailVO
>
insertCustomerContent
(
CustomerReferralDTO
referralDto
);
GenericsResult
<
Customer
Message
TextDetailVO
>
insertCustomerContent
(
CustomerReferralDTO
referralDto
);
/**
* 获取文本客服详情
*
* @param id 主键id
* @return {@link GenericsResult}<{@link Customer
Graphic
TextDetailVO}>
* @return {@link GenericsResult}<{@link Customer
Message
TextDetailVO}>
*/
GenericsResult
<
Customer
Graphic
TextDetailVO
>
getCustomerTextDetail
(
Long
id
);
GenericsResult
<
Customer
Message
TextDetailVO
>
getCustomerTextDetail
(
Long
id
);
/**
* 删除客户内容
*
* @param contentId 文本内容id
* @return {@link GenericsResult}<{@link Customer
Graphic
TextDetailVO}>
* @return {@link GenericsResult}<{@link Customer
Message
TextDetailVO}>
*/
GenericsResult
<
Customer
Graphic
TextDetailVO
>
removeCustomerContent
(
Long
contentId
);
GenericsResult
<
Customer
Message
TextDetailVO
>
removeCustomerContent
(
Long
contentId
);
}
src/main/java/com/yaoyaozw/customer/service/CustomerTextDelayService.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yaoyaozw.customer.entity.CustomerGraphicsDelay
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO
;
import
java.util.List
;
import
java.util.Set
;
/**
* @author darker
* @date 2022/9/15 11:13
*/
public
interface
CustomerTextDelayService
extends
IService
<
CustomerGraphicsDelay
>
{
}
src/main/java/com/yaoyaozw/customer/service/impl/AuthorizerInfoServiceImpl.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.entity.AuthorizerInfo
;
import
com.yaoyaozw.customer.mapper.AuthorizerInfoMapper
;
import
com.yaoyaozw.customer.service.AuthorizerInfoService
;
import
org.springframework.stereotype.Service
;
/**
* 授权人信息服务impl
*
* @author Admin
* @date 2022/10/14
*/
@Service
public
class
AuthorizerInfoServiceImpl
extends
ServiceImpl
<
AuthorizerInfoMapper
,
AuthorizerInfo
>
implements
AuthorizerInfoService
{
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsDelayServiceImpl.java
浏览文件 @
b79b3207
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.SnowflakeComponent
;
import
com.yaoyaozw.customer.components.TokenManager
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelayQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerDelaySaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
com.yaoyaozw.customer.entity.AuthorizerInfo
;
import
com.yaoyaozw.customer.entity.CustomerGraphicsDelay
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.service.AuthorizerInfoService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsDelayService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.CommonOptionResponseVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayGraphicsDetailVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayListVO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @author darker
...
...
@@ -17,6 +49,18 @@ import java.util.Set;
@Service
public
class
CustomerGraphicsDelayServiceImpl
extends
ServiceImpl
<
CustomerGraphicsDelayMapper
,
CustomerGraphicsDelay
>
implements
CustomerGraphicsDelayService
{
private
final
static
Logger
localLog
=
LoggerFactory
.
getLogger
(
CustomerGraphicsDelayServiceImpl
.
class
);
@Autowired
private
TokenManager
tokenManager
;
@Autowired
private
SnowflakeComponent
snowflakeComponent
;
@Autowired
private
ReferralEntityService
referralEntityService
;
@Autowired
private
AuthorizerInfoService
authorizerInfoService
;
@Autowired
private
KanbanCommonMapper
kanbanCommonMapper
;
@Override
...
...
@@ -30,5 +74,155 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
return
baseMapper
.
findAllDelayCustomerMessage
(
appidList
);
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResult
insertCustomerDelay
(
CustomerDelaySaveDTO
saveDto
)
{
CustomerGraphicsDelay
customerGraphicsDelay
=
new
CustomerGraphicsDelay
();
BeanUtil
.
copyProperties
(
saveDto
,
customerGraphicsDelay
);
// 初始化操作信息
customerGraphicsDelay
.
initOperateInfo
(
tokenManager
.
getUserIdFromToken
(),
ObjectUtil
.
isNull
(
saveDto
.
getId
()));
if
(
ObjectUtil
.
isNull
(
customerGraphicsDelay
.
getId
()))
{
long
id
=
snowflakeComponent
.
snowflakeId
();
localLog
.
info
(
"是新增, 新生成ID: {}"
,
id
);
customerGraphicsDelay
.
setId
(
id
);
}
customerGraphicsDelay
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_LINK_GETTING
);
boolean
mainResult
=
super
.
saveOrUpdate
(
customerGraphicsDelay
);
if
(!
mainResult
)
{
localLog
.
info
(
"主体数据生成异常"
);
return
new
BaseResult
().
error
(
"新增/更新 主体数据异常"
);
}
localLog
.
info
(
"生成referral数据"
);
ReferralEntity
referralEntity
=
new
ReferralEntity
();
referralEntity
.
setMaterialGraphicsId
(
customerGraphicsDelay
.
getId
());
BeanUtil
.
copyProperties
(
referralEntity
,
saveDto
.
getCustomerReferralDto
());
boolean
referralResult
=
referralEntityService
.
saveOrUpdate
(
referralEntity
);
if
(!
referralResult
)
{
localLog
.
info
(
"referral数据生成异常, 回滚事务"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
// TODO: 2022/10/14 生成链接
return
new
BaseResult
().
success
();
}
@Override
public
GenericsResult
<
CustomerDelayGraphicsDetailVO
>
getCustomerDelayDetail
(
Long
id
)
{
CustomerGraphicsDelay
customerGraphicsDelay
=
super
.
getById
(
id
);
if
(
ObjectUtil
.
isNull
(
customerGraphicsDelay
))
{
return
new
GenericsResult
<>(
false
,
"找不到主体数据"
);
}
CustomerDelayGraphicsDetailVO
customerDelayGraphicsDetailVO
=
new
CustomerDelayGraphicsDetailVO
();
BeanUtil
.
copyProperties
(
customerGraphicsDelay
,
customerDelayGraphicsDetailVO
);
// 查询链接数据
ReferralEntity
referralEntity
=
referralEntityService
.
getOne
(
new
QueryWrapper
<
ReferralEntity
>().
eq
(
"material_graphics_id"
,
id
));
if
(
ObjectUtil
.
isNull
(
referralEntity
))
{
return
new
GenericsResult
<>(
false
,
"找不到链接数据"
);
}
CustomerReferralDTO
customerReferralDto
=
new
CustomerReferralDTO
();
BeanUtil
.
copyProperties
(
referralEntity
,
customerReferralDto
);
customerDelayGraphicsDetailVO
.
setCustomerReferralDto
(
customerReferralDto
);
return
new
GenericsResult
<>(
customerDelayGraphicsDetailVO
);
}
@Override
public
GenericsResult
<
PageInfo
<
CustomerDelayListVO
>>
pageList
(
CustomerDelayQueryDTO
queryDto
)
{
PageHelper
.
startPage
(
queryDto
.
getCurrentPage
(),
queryDto
.
getPageSize
());
List
<
CustomerDelayListVO
>
customerDelayList
=
super
.
baseMapper
.
pageList
(
queryDto
);
PageInfo
<
CustomerDelayListVO
>
pageResult
=
new
PageInfo
<>(
customerDelayList
);
return
new
GenericsResult
<>(
pageResult
);
}
@Override
public
GenericsResult
<
List
<
AuthInfoVO
>>
getExistCustomerAccount
(
String
keyword
)
{
List
<
AuthInfoVO
>
existCustomerAccount
=
super
.
baseMapper
.
getExistCustomerAccount
(
keyword
);
return
new
GenericsResult
<>(
existCustomerAccount
);
}
@Override
public
BaseResult
removeCustomerDelay
(
Long
id
)
{
return
null
;
}
@Override
public
BaseResult
removeBatch
(
List
<
Long
>
idList
)
{
return
null
;
}
@Override
public
BaseResult
copy
(
String
appId
,
List
<
String
>
targetAppList
)
{
List
<
AuthorizerInfo
>
authorizerInfoList
=
authorizerInfoService
.
list
();
Map
<
String
,
AuthorizerInfo
>
authMap
=
authorizerInfoList
.
stream
().
collect
(
Collectors
.
toMap
(
AuthorizerInfo:
:
getAppid
,
Function
.
identity
()));
AuthorizerInfo
sourceAuthInfo
=
authMap
.
get
(
appId
);
if
(
ObjectUtil
.
isNull
(
sourceAuthInfo
))
{
return
new
BaseResult
().
error
(
"找不到公众号信息"
);
}
String
accountId
=
sourceAuthInfo
.
getAccountId
();
localLog
.
info
(
"原始accountId: {}"
,
accountId
);
// 找到号下面的所有的客服素材
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
));
// 遍历处理
HashSet
<
String
>
storeTypeKeySet
=
CollectionUtil
.
newHashSet
(
sourceAuthInfo
.
getStoreType
());
List
<
CommonOptionResponseVO
>
storeTypeList
=
kanbanCommonMapper
.
getStoreTypeEntity
(
storeTypeKeySet
);
// 这里只有一个
String
storeTypeName
=
storeTypeList
.
get
(
0
).
getName
();
localLog
.
info
(
"当前复用书城: {}"
,
storeTypeName
);
sourceAuthInfo
.
setStoreTypeName
(
storeTypeName
);
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
);
// 执行复用
}
}
return
null
;
}
@Override
public
GenericsResult
<
List
<
AuthInfoVO
>>
getAuthList
(
String
keyword
)
{
List
<
AuthInfoVO
>
authList
=
super
.
baseMapper
.
getAuthList
(
keyword
);
return
new
GenericsResult
<>(
authList
);
}
@Override
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getTimeIntervalList
()
{
List
<
CommonOptionResponseVO
>
timeIntervalList
=
super
.
baseMapper
.
getTimeIntervalList
();
return
new
GenericsResult
<>(
timeIntervalList
);
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
b79b3207
...
...
@@ -39,12 +39,10 @@ import com.yaoyaozw.customer.service.CrowdPackageConditionService;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.CommonOptionResponseVO
;
import
com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageDetailVO
;
import
com.yaoyaozw.customer.vo.customer.*
;
import
com.yaoyaozw.customer.service.*
;
import
com.yaoyaozw.customer.service.wechat.service.WeChatService
;
import
com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageListVO
;
import
org.apache.commons.lang3.StringUtils
;
import
com.yaoyaozw.customer.vo.referral.ReferralEntityVo
;
import
org.slf4j.Logger
;
...
...
@@ -222,10 +220,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
byId
.
setPackId
(
packId
);
// 设置状态为链接生成中
byId
.
setSendStatus
(
1
);
byId
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_LINK_GETTING
);
boolean
result
=
super
.
updateById
(
byId
);
if
(
result
)
{
commonAsyncComponent
.
obtainLink
(
id
,
byId
,
referralEntityList
);
commonAsyncComponent
.
obtain
Message
Link
(
id
,
byId
,
referralEntityList
);
return
new
BaseResult
().
success
();
}
return
new
BaseResult
().
error
(
"更新失败"
);
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsTextServiceImpl.java
浏览文件 @
b79b3207
...
...
@@ -17,7 +17,7 @@ import com.yaoyaozw.customer.mapper.CustomerGraphicsMapper;
import
com.yaoyaozw.customer.service.CustomerGraphicsTextService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.customer.CustomerContentVO
;
import
com.yaoyaozw.customer.vo.customer.Customer
Graphic
TextDetailVO
;
import
com.yaoyaozw.customer.vo.customer.Customer
Message
TextDetailVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -63,7 +63,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
GenericsResult
<
Customer
Graphic
TextDetailVO
>
insertCustomerContent
(
CustomerReferralDTO
referralDto
)
{
public
GenericsResult
<
Customer
Message
TextDetailVO
>
insertCustomerContent
(
CustomerReferralDTO
referralDto
)
{
System
.
out
.
println
(
referralDto
);
...
...
@@ -83,7 +83,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
}
@Override
public
GenericsResult
<
Customer
Graphic
TextDetailVO
>
getCustomerTextDetail
(
Long
id
)
{
public
GenericsResult
<
Customer
Message
TextDetailVO
>
getCustomerTextDetail
(
Long
id
)
{
// 查询主体数据
CustomerGraphics
customerGraphics
=
super
.
getById
(
id
);
if
(
ObjectUtil
.
isNull
(
customerGraphics
))
{
...
...
@@ -91,7 +91,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
return
new
GenericsResult
<>(
false
,
"找不到主体数据"
);
}
// 赋值主体数据
Customer
GraphicTextDetailVO
detailVO
=
new
CustomerGraphic
TextDetailVO
();
Customer
MessageTextDetailVO
detailVO
=
new
CustomerMessage
TextDetailVO
();
BeanUtil
.
copyProperties
(
customerGraphics
,
detailVO
);
detailVO
.
setPostTime
(
customerGraphics
.
getPostTimeStr
());
...
...
@@ -140,7 +140,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
}
idx
+=
1
;
}
customerGraphics
.
setContent
(
mainH5Content
.
toString
());
customerGraphics
.
setContent
(
mainH5Content
.
toString
()
.
replace
(
CustomerCommonConstant
.
H5_STYLE_CODE
,
""
)
);
customerGraphics
.
setReferralSize
(
replaceLinkTypeNum
);
detailVO
.
setContentList
(
contentList
);
// 更新连接表
...
...
@@ -157,7 +157,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
}
@Override
public
GenericsResult
<
Customer
Graphic
TextDetailVO
>
removeCustomerContent
(
Long
contentId
)
{
public
GenericsResult
<
Customer
Message
TextDetailVO
>
removeCustomerContent
(
Long
contentId
)
{
ReferralEntity
referralEntity
=
referralEntityService
.
getById
(
contentId
);
if
(
ObjectUtil
.
isNull
(
referralEntity
))
{
return
new
GenericsResult
<>(
false
,
"找不到主体数据"
);
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerTextDelayServiceImpl.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.entity.CustomerGraphicsDelay
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper
;
import
com.yaoyaozw.customer.service.CustomerTextDelayService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
/**
* @author darker
* @date 2022/9/15 11:13
*/
@Service
public
class
CustomerTextDelayServiceImpl
extends
ServiceImpl
<
CustomerGraphicsDelayMapper
,
CustomerGraphicsDelay
>
implements
CustomerTextDelayService
{
private
final
static
Logger
localLog
=
LoggerFactory
.
getLogger
(
CustomerTextDelayServiceImpl
.
class
);
}
src/main/java/com/yaoyaozw/customer/vo/AuthInfoVO.java
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
vo
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -11,14 +14,23 @@ import java.io.Serializable;
@Data
public
class
AuthInfoVO
implements
Serializable
{
@ApiModelProperty
(
"主键ID"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
@ApiModelProperty
(
"appId"
)
private
String
appId
;
@ApiModelProperty
(
"渠道号"
)
private
String
accountId
;
@ApiModelProperty
(
"公众号名"
)
private
String
accountName
;
@ApiModelProperty
(
"书城拼音"
)
private
String
storeType
;
@ApiModelProperty
(
"书城名"
)
private
String
storeTypeName
;
}
src/main/java/com/yaoyaozw/customer/vo/customer/CustomerDelayGraphicsDetailVO.java
0 → 100644
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
vo
.
customer
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author darker
* @date 2022/10/8 17:13
*/
@Data
public
class
CustomerDelayGraphicsDetailVO
implements
Serializable
{
@ApiModelProperty
(
"客服消息id"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
@ApiModelProperty
(
"公众号ID"
)
private
String
appId
;
@ApiModelProperty
(
"标题"
)
private
String
name
;
@ApiModelProperty
(
"客服消息类型(图文、文本)"
)
private
String
type
;
@ApiModelProperty
(
"是否支付 0-否 1-是"
)
private
Integer
isPay
;
@ApiModelProperty
(
"素材图片路径"
)
private
String
coverUrl
;
@ApiModelProperty
(
"素材文本内容"
)
private
String
content
;
@ApiModelProperty
(
"链接相关内容"
)
private
CustomerReferralDTO
customerReferralDto
;
}
src/main/java/com/yaoyaozw/customer/vo/customer/CustomerDelayListVO.java
浏览文件 @
b79b3207
package
com
.
yaoyaozw
.
customer
.
vo
.
customer
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -10,9 +14,38 @@ import java.io.Serializable;
*/
@Data
public
class
CustomerDelayListVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
7050943048581039251L
;
@ApiModelProperty
(
"客服消息id"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
@ApiModelProperty
(
"公众号"
)
private
String
accountName
;
@ApiModelProperty
(
"客服消息类型(图文、文本)"
)
private
String
type
;
@ApiModelProperty
(
"标题"
)
private
String
name
;
@ApiModelProperty
(
"消息发送时间"
)
private
String
postTime
;
@ApiModelProperty
(
"发文排序"
)
private
Integer
postSort
;
@ApiModelProperty
(
"时间间隔"
)
private
String
timeInterval
;
@ApiModelProperty
(
"发送状态值"
)
private
String
sendStatus
;
@ApiModelProperty
(
"发送状态描述"
)
private
String
sendStatusStr
;
public
String
getType
()
{
return
CustomerCommonConstant
.
getCustomerType
(
this
.
type
);
}
}
src/main/java/com/yaoyaozw/customer/vo/customer/Customer
Graphic
TextDetailVO.java
→
src/main/java/com/yaoyaozw/customer/vo/customer/Customer
Message
TextDetailVO.java
浏览文件 @
b79b3207
...
...
@@ -15,7 +15,7 @@ import java.util.List;
*/
@Data
@ApiModel
(
"文本客服详情实体"
)
public
class
Customer
Graphic
TextDetailVO
implements
Serializable
{
public
class
Customer
Message
TextDetailVO
implements
Serializable
{
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
"主键id"
)
...
...
src/main/resources/application-dev.yml
浏览文件 @
b79b3207
...
...
@@ -17,6 +17,7 @@ mybatis-plus:
cache-enabled
:
false
call-setters-on-nulls
:
true
jdbc-type-for-null
:
'
null'
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
logging
:
level
:
com.example.material.mapper
:
debug
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
浏览文件 @
b79b3207
...
...
@@ -34,4 +34,71 @@
</select>
<select
id=
"pageList"
resultType=
"com.yaoyaozw.customer.vo.customer.CustomerDelayListVO"
>
select
cgd.id,
cgd.name,
cgd.type,
ai.nick_name as accountName,
cgd.post_sort as postSort,
t_dic.dic_value as timeInterval,
s_dic.dic_value as sendStatus
from customer_graphics_delay cgd
left join authorizer_info ai
on cgd.app_id = ai.appid
left join sys_dictionary t_dic
on t_dic.group_id = 'CUSTOMER_TIME_INTERVAL'
and t_dic.dic_key = cgd.time_interval
left join sys_dictionary s_dic
on s_dic.group_id = 'CUSTOMER_SEND_STATUS'
and s_dic.dic_key = cgd.send_status
</select>
<select
id=
"getExistCustomerAccount"
resultType=
"com.yaoyaozw.customer.vo.AuthInfoVO"
>
select
ai.id,
ai.appid as appId,
ai.account_id as accountId,
ai.nick_name as accountName,
ai.store_type as storeType
from authorizer_info ai
right join (
select distinct app_id from customer_graphics_delay
where is_deleted = 0 and app_id is not null and app_id != ''
) mid
on ai.appid = mid.app_id
<if
test=
"keyword != null and keyword != ''"
>
where ai.nick_name like concat('%', #{keyword}, '%')
</if>
</select>
<select
id=
"getTimeIntervalList"
resultType=
"com.yaoyaozw.customer.vo.CommonOptionResponseVO"
>
select
dic_value as name,
dic_key as `key`
from sys_dictionary
where is_deleted = 0
and group_id = 'CUSTOMER_TIME_INTERVAL'
order by sort
</select>
<select
id=
"getAuthList"
resultType=
"com.yaoyaozw.customer.vo.AuthInfoVO"
>
select
id,
appid as appId,
account_id as accountId,
nick_name as accountName,
store_type as storeType
from authorizer_info
<if
test=
"keyword != null and keyword != ''"
>
where nick_name like concat('%', #{keyword}, '%')
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/CustomerGraphicsMapper.xml
浏览文件 @
b79b3207
...
...
@@ -22,6 +22,7 @@
select
cg.id,
cg.pack_id as packId,
cg.name,
cg.type,
cg.post_time as postTime,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论