Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
6e87f898
提交
6e87f898
authored
10月 18, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
延时客服-文本-finish
上级
b09ed005
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
152 行增加
和
66 行删除
+152
-66
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+8
-14
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+6
-2
CustomerReferralDTO.java
...m/yaoyaozw/customer/dto/customer/CustomerReferralDTO.java
+3
-0
CustomerGraphicsDelayMapper.java
...yaoyaozw/customer/mapper/CustomerGraphicsDelayMapper.java
+8
-0
ReferralEntityMapper.java
...va/com/yaoyaozw/customer/mapper/ReferralEntityMapper.java
+11
-2
ReferralEntityService.java
.../com/yaoyaozw/customer/service/ReferralEntityService.java
+8
-0
CustomerDelayTextServiceImpl.java
...w/customer/service/impl/CustomerDelayTextServiceImpl.java
+20
-17
CustomerGraphicsDelayServiceImpl.java
...stomer/service/impl/CustomerGraphicsDelayServiceImpl.java
+25
-10
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+1
-19
CustomerGraphicsTextServiceImpl.java
...ustomer/service/impl/CustomerGraphicsTextServiceImpl.java
+2
-2
ReferralEntityServiceImpl.java
...aozw/customer/service/impl/ReferralEntityServiceImpl.java
+13
-0
CustomerContentVO.java
.../com/yaoyaozw/customer/vo/customer/CustomerContentVO.java
+13
-0
CustomerDelayGraphicsDetailVO.java
...w/customer/vo/customer/CustomerDelayGraphicsDetailVO.java
+3
-0
CustomerDelayTextDetailVO.java
...yaozw/customer/vo/customer/CustomerDelayTextDetailVO.java
+4
-0
CustomerGraphicsDelayMapper.xml
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
+15
-0
ReferralEntityMapper.xml
src/main/resources/mapper/ReferralEntityMapper.xml
+12
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
6e87f898
...
...
@@ -10,9 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.alibaba.fastjson.TypeReference
;
import
com.yaoyaozw.customer.common.R
;
import
com.yaoyaozw.customer.constants.ApiResultConstant
;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.entity.*
;
import
com.yaoyaozw.customer.enums.CustomerStoreTemplateEnum
;
import
com.yaoyaozw.customer.feigns.ReferralFeignClient
;
...
...
@@ -21,7 +19,6 @@ 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.CustomerGraphicsDelayService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.service.RegisterUserEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
...
...
@@ -35,7 +32,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
java.math.RoundingMode
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -149,7 +145,7 @@ public class CustomerServiceCommonAsyncComponent {
for
(
ReferralEntity
referralEntity
:
referralEntityList
)
{
// 获取链接
if
(
CustomerCommonConstant
.
RE
PLAC
E_LINK_NEWS_TYPE_LIST
.
contains
(
referralEntity
.
getNewsType
()))
{
if
(
CustomerCommonConstant
.
RE
MOT
E_LINK_NEWS_TYPE_LIST
.
contains
(
referralEntity
.
getNewsType
()))
{
LOCAL_LOG
.
info
(
"异步获取图文客服链接"
);
getMessageAuthListLink
(
storeGroupMap
,
customerGraphics
,
referralEntity
);
}
else
{
...
...
@@ -157,7 +153,7 @@ public class CustomerServiceCommonAsyncComponent {
}
}
// 处理完之后将状态改为待发送
customerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_
LINK_FINISH
);
customerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_
ACTIVE
);
customerGraphicsMapper
.
updateById
(
customerGraphics
);
}
...
...
@@ -355,7 +351,6 @@ public class CustomerServiceCommonAsyncComponent {
// 构造h5
StringBuilder
h5Context
=
new
StringBuilder
();
Integer
postSort
=
sourceGraphics
.
getPostSort
();
// 遍历处理客服链接
int
idx
=
1
;
for
(
ReferralEntity
sourceReferralEntity
:
sourceReferralList
)
{
...
...
@@ -369,11 +364,8 @@ public class CustomerServiceCommonAsyncComponent {
targetReferralEntity
.
setStoreTypeName
(
targetAuthInfo
.
getStoreTypeName
());
String
name
=
CustomerCommonConstant
.
getLinkNameModel
(
targetReferralEntity
.
getNewsType
());
if
(
StringUtils
.
isNotBlank
(
name
))
{
name
=
name
+
"-"
+
postSort
;
if
(
ObjectUtil
.
isNotNull
(
targetReferralEntity
.
getSort
()))
{
name
=
name
+
"-"
+
targetReferralEntity
.
getSort
();
}
if
(
StringUtils
.
isNotBlank
(
name
)
&&
!
CustomerCommonConstant
.
USUAL_LINK_NEWS_TYPE
.
equals
(
targetReferralEntity
.
getNewsType
()))
{
name
=
name
+
"-"
+
System
.
currentTimeMillis
()
%
10000
;
targetReferralEntity
.
setName
(
name
);
}
...
...
@@ -398,7 +390,7 @@ public class CustomerServiceCommonAsyncComponent {
if
(
type
.
equals
(
CustomerCommonConstant
.
CUSTOMER_TYPE_VALUE_TEXT
))
{
// 文本类型替换h5链接
String
context
=
null
;
if
(
CustomerCommonConstant
.
LINK_NEWS_TYPE_LIST
.
contains
(
newsType
))
{
if
(
CustomerCommonConstant
.
REPLACE_
LINK_NEWS_TYPE_LIST
.
contains
(
newsType
))
{
context
=
CustomerCommonConstant
.
CUSTOMER_TEXT_LINK_TEMPLATE
.
replace
(
CustomerCommonConstant
.
CUSTOMER_TEXT_CONTENT_PLACEHOLDER
,
targetReferralEntity
.
getTextContent
());
}
else
if
(
CustomerCommonConstant
.
COMMON_NEWS_TYPE_LIST
.
contains
(
newsType
)){
context
=
targetReferralEntity
.
getTextContent
();
...
...
@@ -415,7 +407,7 @@ public class CustomerServiceCommonAsyncComponent {
}
}
targetCustomerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_
LINK_FINISH
);
targetCustomerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_
ACTIVE
);
if
(
StringUtils
.
isNotBlank
(
h5Context
))
{
targetCustomerGraphics
.
setContent
(
h5Context
.
toString
());
}
...
...
@@ -516,6 +508,8 @@ public class CustomerServiceCommonAsyncComponent {
}
else
if
(
newsType
.
equals
(
CustomerCommonConstant
.
ACTIVITY_NEWS_TYPE
))
{
// 系统-客服-{newsType}-{accountNickName}-{storeType}-{currentDate}-充{recharge}送{gift}
name
=
name
.
replace
(
"{recharge}"
,
referralEntity
.
getRechargeAmount
().
stripTrailingZeros
().
toPlainString
()).
replace
(
"{gift}"
,
referralEntity
.
getGiftAmount
().
toString
());
String
tempId
=
CustomerStoreTemplateEnum
.
getTempId
(
referralEntity
.
getStoreType
());
referralEntity
.
setTemplateId
(
tempId
);
}
referralEntity
.
setName
(
name
);
}
...
...
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
6e87f898
...
...
@@ -20,12 +20,14 @@ public class CustomerCommonConstant {
public
final
static
String
ERROR_LABEL
=
"error"
;
public
final
static
List
<
Integer
>
LINK_NEWS_TYPE_LIST
=
Arrays
.
asList
(
1
,
2
,
3
,
-
1
);
public
final
static
List
<
Integer
>
REPLACE_
LINK_NEWS_TYPE_LIST
=
Arrays
.
asList
(
1
,
2
,
3
,
-
1
);
public
final
static
List
<
Integer
>
RE
PLAC
E_LINK_NEWS_TYPE_LIST
=
Arrays
.
asList
(
1
,
2
,
3
);
public
final
static
List
<
Integer
>
RE
MOT
E_LINK_NEWS_TYPE_LIST
=
Arrays
.
asList
(
1
,
2
,
3
);
public
final
static
List
<
Integer
>
COMMON_NEWS_TYPE_LIST
=
Collections
.
singletonList
(
4
);
public
final
static
String
YW_LINK_LIMIT_REDIS_KEY
=
"YW_REFERRAL"
;
public
final
static
Integer
BOOK_NEWS_TYPE
=
1
;
public
final
static
String
BOOK_NEWS_TYPE_NAME
=
"推广"
;
...
...
@@ -58,6 +60,8 @@ public class CustomerCommonConstant {
public
final
static
Integer
SEND_STATUS_LINK_FINISH
=
2
;
public
final
static
Integer
SEND_STATUS_ACTIVE
=
9
;
public
final
static
Integer
SEND_STATUS_SENT_SUCCESS
=
3
;
public
final
static
Integer
SEND_STATUS_SENT_FAIL
=
4
;
...
...
src/main/java/com/yaoyaozw/customer/dto/customer/CustomerReferralDTO.java
浏览文件 @
6e87f898
...
...
@@ -39,6 +39,9 @@ public class CustomerReferralDTO implements Serializable {
@ApiModelProperty
(
"链接类型"
)
private
Integer
newsType
;
@ApiModelProperty
(
"链接名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"序号"
)
private
Integer
sort
;
...
...
src/main/java/com/yaoyaozw/customer/mapper/CustomerGraphicsDelayMapper.java
浏览文件 @
6e87f898
...
...
@@ -62,4 +62,11 @@ public interface CustomerGraphicsDelayMapper extends BaseMapper<CustomerGraphics
*/
List
<
CommonOptionResponseVO
>
getTimeIntervalList
();
/**
* 获取延时客服主体的公众号
* @param customerId 延时客服主键
* @return 公众号
*/
AuthInfoVO
getCustomerDelayAuthInfo
(
@Param
(
"customerId"
)
Long
customerId
);
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/mapper/ReferralEntityMapper.java
浏览文件 @
6e87f898
...
...
@@ -21,11 +21,19 @@ public interface ReferralEntityMapper extends BaseMapper<ReferralEntity> {
/**
* 物理删除素材元素
*
* @param sourceId 素材主体ID
* @param sourceId
素材主体ID
* @param extraCondition 特殊条件表达式
*/
void
ultimateDeleteReferrals
(
@Param
(
"sourceId"
)
Long
sourceId
,
@Param
(
"extraCondition"
)
String
extraCondition
);
List
<
ReferralEntityVo
>
findByMaterialGraphicsId
(
@Param
(
"graphicsId"
)
Long
graphicsId
);
List
<
ReferralEntityVo
>
findByMaterialGraphicsId
(
@Param
(
"graphicsId"
)
Long
graphicsId
);
/**
* 物理删除素材元素
*
* @param sourceIdList 素材主体ID
* @param extraCondition 特殊条件表达式
*/
void
ultimateDeleteReferralsBatch
(
@Param
(
"sourceIdList"
)
List
<
Long
>
sourceIdList
,
@Param
(
"extraCondition"
)
String
extraCondition
);
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/service/ReferralEntityService.java
浏览文件 @
6e87f898
...
...
@@ -22,6 +22,14 @@ public interface ReferralEntityService extends IService<ReferralEntity> {
void
ultimateDeleteReferrals
(
Long
sourceId
,
String
extraCondition
);
/**
* 物理删除素材元素
*
* @param sourceIdList 素材主体ID
* @param extraCondition 特殊条件表达式
*/
void
ultimateDeleteReferralsBatch
(
List
<
Long
>
sourceIdList
,
String
extraCondition
);
/**
* 根据客服id找链接
* @param graphicsId 客服主体id
* @return
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerDelayTextServiceImpl.java
浏览文件 @
6e87f898
...
...
@@ -27,8 +27,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.text.SimpleDateFormat
;
...
...
@@ -89,6 +89,14 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
String
storeTypeName
=
kanbanCommonMapper
.
getStoreTypeNameByAppId
(
referralDto
.
getAppId
());
referralEntity
.
setStoreTypeName
(
storeTypeName
);
// 获取链接
// 日期
String
format
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
).
format
(
new
Date
());
// 公众号
AuthInfoVO
authInfoVO
=
super
.
baseMapper
.
getCustomerDelayAuthInfo
(
referralDto
.
getMaterialGraphicsId
());
if
(
CustomerCommonConstant
.
REMOTE_LINK_NEWS_TYPE_LIST
.
contains
(
referralEntity
.
getNewsType
()))
{
commonAsyncComponent
.
getCopyReferral
(
format
,
authInfoVO
,
referralEntity
);
}
// 保存链接数据
referralEntityService
.
saveOrUpdate
(
referralEntity
);
...
...
@@ -100,41 +108,32 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
// 查询主体数据
CustomerGraphicsDelay
customerGraphicsDelay
=
super
.
getById
(
id
);
if
(
ObjectUtil
.
isNull
(
customerGraphicsDelay
))
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
new
GenericsResult
<>(
false
,
"找不到主体数据"
);
}
// 赋值主体数据
CustomerDelayTextDetailVO
detailVO
=
new
CustomerDelayTextDetailVO
();
BeanUtil
.
copyProperties
(
customerGraphicsDelay
,
detailVO
);
// 合并链接中的h5代码
List
<
ReferralEntity
>
referralEntityList
=
referralEntityService
.
list
(
new
QueryWrapper
<
ReferralEntity
>().
eq
(
"material_graphics_id"
,
id
).
isNull
(
"account_id"
).
orderByAsc
(
"gmt_create"
));
// 查询所有的链接信息
List
<
ReferralEntity
>
referralEntityList
=
referralEntityService
.
list
(
new
QueryWrapper
<
ReferralEntity
>().
eq
(
"material_graphics_id"
,
id
).
orderByAsc
(
"gmt_create"
).
orderByAsc
(
"sort"
));
List
<
CustomerContentVO
>
contentList
=
new
ArrayList
<>();
// 位置计数器
StringBuilder
mainH5Content
=
new
StringBuilder
();
// 日期
String
format
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
).
format
(
new
Date
());
// 公众号
AuthorizerInfo
authorizerInfo
=
authorizerInfoService
.
getOne
(
new
QueryWrapper
<
AuthorizerInfo
>().
eq
(
"appid"
,
customerGraphicsDelay
.
getAppId
()));
AuthInfoVO
authInfoVO
=
new
AuthInfoVO
();
authInfoVO
.
putPropertyValue
(
authorizerInfo
);
localLog
.
info
(
"根据链接重新生成H5"
);
// 位置计数器
int
idx
=
1
;
for
(
ReferralEntity
item
:
referralEntityList
)
{
item
.
setSort
(
idx
);
CustomerContentVO
customerContentVO
=
new
CustomerContentVO
();
// 设置主键id和h5代码段
customerContentVO
.
setId
(
item
.
getId
());
// 获取链接
commonAsyncComponent
.
getCopyReferral
(
format
,
authInfoVO
,
item
);
Integer
newsType
=
item
.
getNewsType
();
// 处理h5文本
String
context
=
null
;
if
(
CustomerCommonConstant
.
LINK_NEWS_TYPE_LIST
.
contains
(
item
.
getNewsType
()
))
{
if
(
CustomerCommonConstant
.
REPLACE_LINK_NEWS_TYPE_LIST
.
contains
(
newsType
))
{
context
=
CustomerCommonConstant
.
CUSTOMER_TEXT_LINK_TEMPLATE
.
replace
(
CustomerCommonConstant
.
CUSTOMER_TEXT_CONTENT_PLACEHOLDER
,
item
.
getTextContent
());
}
else
if
(
CustomerCommonConstant
.
COMMON_NEWS_TYPE_LIST
.
contains
(
item
.
getNewsType
()
)){
}
else
if
(
CustomerCommonConstant
.
COMMON_NEWS_TYPE_LIST
.
contains
(
newsType
)){
context
=
item
.
getTextContent
();
}
if
(
ObjectUtil
.
isNotNull
(
context
))
{
...
...
@@ -158,6 +157,10 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
}
customerGraphicsDelay
.
setContent
(
mainH5Content
.
toString
().
replace
(
CustomerCommonConstant
.
H5_STYLE_CODE
,
""
));
detailVO
.
setContentList
(
contentList
);
// 公众号
AuthInfoVO
authInfoVO
=
super
.
baseMapper
.
getCustomerDelayAuthInfo
(
id
);
detailVO
.
setAuthInfoVo
(
authInfoVO
);
// 更新连接表
localLog
.
info
(
"更新连接表"
);
if
(
CollectionUtil
.
isNotEmpty
(
referralEntityList
))
{
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsDelayServiceImpl.java
浏览文件 @
6e87f898
...
...
@@ -29,6 +29,7 @@ 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.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -81,31 +82,33 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
@Override
public
BaseResult
insertCustomerDelay
(
CustomerDelaySaveDTO
saveDto
)
{
boolean
isCreate
=
false
;
CustomerGraphicsDelay
customerGraphicsDelay
=
new
CustomerGraphicsDelay
();
BeanUtil
.
copyProperties
(
saveDto
,
customerGraphicsDelay
);
// 初始化操作信息
customerGraphicsDelay
.
initOperateInfo
(
tokenManager
.
getUserIdFromToken
(),
ObjectUtil
.
isNull
(
saveDto
.
getId
()));
if
(
ObjectUtil
.
isNull
(
customerGraphicsDelay
.
getId
()))
{
isCreate
=
true
;
long
id
=
snowflakeComponent
.
snowflakeId
();
localLog
.
info
(
"是新增, 新生成ID: {}"
,
id
);
customerGraphicsDelay
.
setId
(
id
);
}
customerGraphicsDelay
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_LINK_GETTING
);
localLog
.
info
(
"生成referral数据"
);
ReferralEntity
referralEntity
=
new
ReferralEntity
();
BeanUtil
.
copyProperties
(
saveDto
.
getCustomerReferralDto
(),
referralEntity
);
referralEntity
.
setMaterialGraphicsId
(
customerGraphicsDelay
.
getId
());
// 非自定义获取链接
if
(!
referralEntity
.
getNewsType
().
equals
(-
1
))
{
if
(
isCreate
&&
!
referralEntity
.
getNewsType
().
equals
(-
1
))
{
try
{
customerGraphicsDelay
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_LINK_GETTING
);
localLog
.
info
(
"准备获取链接"
);
String
linkNameModel
=
CustomerCommonConstant
.
getLinkNameModel
(
referralEntity
.
getNewsType
());
localLog
.
info
(
"获取链接name模板: {}"
,
linkNameModel
);
referralEntity
.
setName
(
linkNameModel
);
if
(
StringUtils
.
isNotBlank
(
linkNameModel
))
{
localLog
.
info
(
"获取链接name模板: {}"
,
linkNameModel
);
referralEntity
.
setName
(
linkNameModel
);
}
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
);
String
dateStr
=
dateFormat
.
format
(
new
Date
());
...
...
@@ -113,7 +116,7 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
AuthInfoVO
authInfoVO
=
new
AuthInfoVO
();
authInfoVO
.
putPropertyValue
(
authorizerInfo
);
commonAsyncComponent
.
getCopyReferral
(
dateStr
,
authInfoVO
,
referralEntity
);
customerGraphicsDelay
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_
LINK_FINISH
);
customerGraphicsDelay
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_
ACTIVE
);
localLog
.
info
(
"链接获取完成"
);
}
catch
(
Exception
e
)
{
localLog
.
info
(
"获取链接异常"
);
...
...
@@ -154,6 +157,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
BeanUtil
.
copyProperties
(
referralEntity
,
customerReferralDto
);
customerDelayGraphicsDetailVO
.
setCustomerReferralDto
(
customerReferralDto
);
AuthInfoVO
authInfoVO
=
super
.
baseMapper
.
getCustomerDelayAuthInfo
(
id
);
customerDelayGraphicsDetailVO
.
setAuthInfoVo
(
authInfoVO
);
return
new
GenericsResult
<>(
customerDelayGraphicsDetailVO
);
}
...
...
@@ -175,12 +180,22 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
@Override
public
BaseResult
removeCustomerDelay
(
Long
id
)
{
return
null
;
boolean
result
=
super
.
removeById
(
id
);
if
(
result
)
{
return
new
BaseResult
().
success
();
}
referralEntityService
.
ultimateDeleteReferrals
(
id
,
null
);
return
new
BaseResult
().
error
(
"弃用失败"
);
}
@Override
public
BaseResult
removeBatch
(
List
<
Long
>
idList
)
{
return
null
;
boolean
result
=
super
.
removeByIds
(
idList
);
if
(
result
)
{
return
new
BaseResult
().
success
();
}
referralEntityService
.
ultimateDeleteReferralsBatch
(
idList
,
null
);
return
new
BaseResult
().
error
(
"删除失败"
);
}
@Override
...
...
@@ -199,7 +214,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
));
List
<
ReferralEntity
>
referralEntityList
=
referralEntityService
.
list
(
new
QueryWrapper
<
ReferralEntity
>().
in
(
"material_graphics_id"
,
sourceMainIdList
)
.
orderByAsc
(
"gmt_create"
).
orderByAsc
(
"sort"
)
);
Map
<
Long
,
List
<
ReferralEntity
>>
referralGroupMap
=
referralEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ReferralEntity:
:
getMaterialGraphicsId
));
// 遍历处理
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
6e87f898
...
...
@@ -2,24 +2,14 @@ package com.yaoyaozw.customer.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.sun.xml.internal.bind.v2.TODO
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.common.R
;
import
com.yaoyaozw.customer.components.CustomerServiceCommonAsyncComponent
;
import
com.yaoyaozw.customer.components.SnowflakeComponent
;
import
com.yaoyaozw.customer.components.TokenManager
;
import
com.yaoyaozw.customer.constants.ApiResultConstant
;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
...
...
@@ -30,15 +20,10 @@ import com.yaoyaozw.customer.dto.customer.CustomerReferralDTO;
import
com.yaoyaozw.customer.entity.CrowdPackageCondition
;
import
com.yaoyaozw.customer.entity.CrowdPackageConditionMatch
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.enums.CustomerStoreTemplateEnum
;
import
com.yaoyaozw.customer.feigns.ReferralFeignClient
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionMatchService
;
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.*
;
import
com.yaoyaozw.customer.service.*
;
import
com.yaoyaozw.customer.service.wechat.service.WeChatService
;
...
...
@@ -54,9 +39,6 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
...
...
@@ -111,7 +93,7 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
customerGraphics
.
setId
(
id
);
}
// 设置链接数
if
(
CustomerCommonConstant
.
RE
PLAC
E_LINK_NEWS_TYPE_LIST
.
contains
(
saveDto
.
getCustomerReferralDto
().
getNewsType
()))
{
if
(
CustomerCommonConstant
.
RE
MOT
E_LINK_NEWS_TYPE_LIST
.
contains
(
saveDto
.
getCustomerReferralDto
().
getNewsType
()))
{
customerGraphics
.
setReferralSize
(
1
);
}
super
.
saveOrUpdate
(
customerGraphics
);
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsTextServiceImpl.java
浏览文件 @
6e87f898
...
...
@@ -109,7 +109,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
// 设置主键id和h5代码段
customerContentVO
.
setId
(
item
.
getId
());
String
context
=
null
;
if
(
CustomerCommonConstant
.
LINK_NEWS_TYPE_LIST
.
contains
(
item
.
getNewsType
()))
{
if
(
CustomerCommonConstant
.
REPLACE_
LINK_NEWS_TYPE_LIST
.
contains
(
item
.
getNewsType
()))
{
context
=
CustomerCommonConstant
.
CUSTOMER_TEXT_LINK_TEMPLATE
.
replace
(
CustomerCommonConstant
.
CUSTOMER_TEXT_CONTENT_PLACEHOLDER
,
item
.
getTextContent
())
.
replace
(
CustomerCommonConstant
.
CUSTOMER_TEXT_URL_PLACEHOLDER
,
CustomerCommonConstant
.
CUSTOMER_TEXT_URL_PLACEHOLDER
+
idx
);
...
...
@@ -133,7 +133,7 @@ public class CustomerGraphicsTextServiceImpl extends ServiceImpl<CustomerGraphic
contentList
.
add
(
customerContentVO
);
// 统计referralSize
if
(
CustomerCommonConstant
.
RE
PLAC
E_LINK_NEWS_TYPE_LIST
.
contains
(
item
.
getNewsType
()))
{
if
(
CustomerCommonConstant
.
RE
MOT
E_LINK_NEWS_TYPE_LIST
.
contains
(
item
.
getNewsType
()))
{
replaceLinkTypeNum
+=
1
;
}
idx
+=
1
;
...
...
src/main/java/com/yaoyaozw/customer/service/impl/ReferralEntityServiceImpl.java
浏览文件 @
6e87f898
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.ReferralEntityMapper
;
...
...
@@ -18,10 +20,21 @@ public class ReferralEntityServiceImpl extends ServiceImpl<ReferralEntityMapper,
@Override
public
void
ultimateDeleteReferrals
(
Long
materialId
,
String
extraCondition
)
{
if
(
ObjectUtil
.
isNull
(
materialId
))
{
return
;
}
super
.
baseMapper
.
ultimateDeleteReferrals
(
materialId
,
extraCondition
);
}
@Override
public
void
ultimateDeleteReferralsBatch
(
List
<
Long
>
sourceIdList
,
String
extraCondition
)
{
if
(
CollectionUtil
.
isEmpty
(
sourceIdList
))
{
return
;
}
super
.
baseMapper
.
ultimateDeleteReferralsBatch
(
sourceIdList
,
extraCondition
);
}
@Override
public
List
<
ReferralEntityVo
>
findReferralByCustomerGraphicsId
(
Long
graphicsId
)
{
return
baseMapper
.
findByMaterialGraphicsId
(
graphicsId
);
}
...
...
src/main/java/com/yaoyaozw/customer/vo/customer/CustomerContentVO.java
浏览文件 @
6e87f898
package
com
.
yaoyaozw
.
customer
.
vo
.
customer
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.Serializable
;
...
...
@@ -25,4 +28,14 @@ public class CustomerContentVO implements Serializable {
@ApiModelProperty
(
"链接相关内容"
)
private
CustomerReferralDTO
customerReferralDto
;
@ApiModelProperty
(
"是否可编辑"
)
private
Boolean
editable
;
public
Boolean
getEditable
()
{
if
(
ObjectUtil
.
isNull
(
this
.
customerReferralDto
))
{
return
true
;
}
// 如果是需要远程获取链接的,并且链接已经生成的,则不能再进行编辑
return
!(
CustomerCommonConstant
.
REMOTE_LINK_NEWS_TYPE_LIST
.
contains
(
this
.
customerReferralDto
.
getNewsType
())
&&
StringUtils
.
isNotBlank
(
this
.
customerReferralDto
.
getReferral
()));
}
}
src/main/java/com/yaoyaozw/customer/vo/customer/CustomerDelayGraphicsDetailVO.java
浏览文件 @
6e87f898
...
...
@@ -3,6 +3,7 @@ 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
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -51,4 +52,6 @@ public class CustomerDelayGraphicsDetailVO implements Serializable {
@ApiModelProperty
(
"链接相关内容"
)
private
CustomerReferralDTO
customerReferralDto
;
private
AuthInfoVO
authInfoVo
;
}
src/main/java/com/yaoyaozw/customer/vo/customer/CustomerDelayTextDetailVO.java
浏览文件 @
6e87f898
...
...
@@ -2,6 +2,7 @@ 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.vo.AuthInfoVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -38,10 +39,13 @@ public class CustomerDelayTextDetailVO implements Serializable {
private
Long
timeInterval
;
@ApiModelProperty
(
"已支付、未支付"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Integer
isPay
;
@ApiModelProperty
(
"appId"
)
private
String
appId
;
private
AuthInfoVO
authInfoVo
;
}
src/main/resources/mapper/CustomerGraphicsDelayMapper.xml
浏览文件 @
6e87f898
...
...
@@ -122,4 +122,18 @@
</if>
</where>
</select>
<select
id=
"getCustomerDelayAuthInfo"
resultType=
"com.yaoyaozw.customer.vo.AuthInfoVO"
>
select
ai.id,
ai.account_id as accountId,
ai.appid as appId,
ai.nick_name as accountName,
ai.store_type as storeType
from customer_graphics_delay cgd
left join authorizer_info ai
on cgd.app_id = ai.appid
where cgd.id = #{customerId}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/ReferralEntityMapper.xml
浏览文件 @
6e87f898
...
...
@@ -48,4 +48,15 @@
</select>
<delete
id=
"ultimateDeleteReferralsBatch"
>
delete from referral_entity
where material_graphics_id in
<foreach
collection=
"sourceIdList"
item=
"sourceId"
separator=
","
open=
"("
close=
")"
>
#{sourceId}
</foreach>
<if
test=
"extraCondition != null and extraCondition != ''"
>
${extraCondition}
</if>
</delete>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论