Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
ea246c31
提交
ea246c31
authored
3月 15, 2023
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
关回接口(对接调整)
上级
473af6da
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
157 行增加
和
10 行删除
+157
-10
FollowReplyComponent.java
...om/yaoyaozw/customer/components/FollowReplyComponent.java
+6
-4
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+20
-0
FollowReplyCommonConstant.java
...aoyaozw/customer/constants/FollowReplyCommonConstant.java
+17
-0
FollowReplyController.java
...m/yaoyaozw/customer/controller/FollowReplyController.java
+2
-1
FollowReplySaveDTO.java
.../com/yaoyaozw/customer/dto/follow/FollowReplySaveDTO.java
+6
-1
CommonReferralBody.java
...java/com/yaoyaozw/customer/entity/CommonReferralBody.java
+8
-0
CustomerFollowReply.java
...ava/com/yaoyaozw/customer/entity/CustomerFollowReply.java
+2
-2
ReferralEntity.java
...ain/java/com/yaoyaozw/customer/entity/ReferralEntity.java
+3
-0
CustomerFollowReplyMapper.java
...m/yaoyaozw/customer/mapper/CustomerFollowReplyMapper.java
+14
-0
CustomerFollowReplyServiceImpl.java
...customer/service/impl/CustomerFollowReplyServiceImpl.java
+28
-2
CustomerGraphicsDelayServiceImpl.java
...stomer/service/impl/CustomerGraphicsDelayServiceImpl.java
+16
-0
FollowReplyListVO.java
...va/com/yaoyaozw/customer/vo/follow/FollowReplyListVO.java
+11
-0
CustomerFollowReplyMapper.xml
src/main/resources/mapper/CustomerFollowReplyMapper.xml
+24
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/FollowReplyComponent.java
浏览文件 @
ea246c31
...
...
@@ -73,8 +73,7 @@ public class FollowReplyComponent {
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
);
String
dateStr
=
format
.
format
(
new
Date
());
AuthorizerInfo
authorizerInfo
=
authorizerInfoService
.
getById
(
referralBody
.
getInfoId
());
handleReferralName
(
dateStr
,
authorizerInfo
.
getNickName
(),
referralEntity
);
handleReferralName
(
dateStr
,
referralBody
.
getAccountName
(),
referralEntity
);
}
// 获取链接
...
...
@@ -264,7 +263,7 @@ public class FollowReplyComponent {
private
void
handleReferralName
(
String
dateStr
,
String
accountName
,
ReferralEntity
referral
)
{
Integer
newsType
=
referral
.
getNewsType
();
// 书籍、活动 类型, 重新构造name
String
name
=
CustomerCommonConstant
.
getLinkNameModel
(
newsType
);
String
name
=
CustomerCommonConstant
.
getLinkNameModel
(
newsType
,
referral
.
getConfigName
()
);
String
newsTypeName
=
CustomerCommonConstant
.
getNewsTypeName
(
newsType
);
name
=
name
.
replace
(
"{newsType}"
,
newsTypeName
).
replace
(
"{accountNickName}"
,
accountName
)
.
replace
(
"{storeType}"
,
referral
.
getStoreTypeName
()).
replace
(
"{currentDate}"
,
dateStr
);
...
...
@@ -274,8 +273,11 @@ public class FollowReplyComponent {
}
else
if
(
newsType
.
equals
(
CustomerCommonConstant
.
ACTIVITY_NEWS_TYPE
))
{
// 系统-客服-{newsType}-{accountNickName}-{storeType}-{currentDate}-充{recharge}送{gift}
name
=
name
.
replace
(
"{recharge}"
,
referral
.
getRechargeAmount
().
stripTrailingZeros
().
toPlainString
()).
replace
(
"{gift}"
,
referral
.
getGiftAmount
().
toString
());
if
(
StringUtils
.
isNotEmpty
(
referral
.
getConfigName
()))
{
name
=
name
.
replace
(
"{configName}"
,
referral
.
getConfigName
());
}
}
name
=
name
.
replace
(
"客服"
,
"关回"
);
referral
.
setName
(
name
+
"-"
+
System
.
currentTimeMillis
()
%
100000
);
}
...
...
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
ea246c31
package
com
.
yaoyaozw
.
customer
.
constants
;
import
cn.hutool.core.util.ObjectUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
...
...
@@ -43,6 +44,7 @@ public class CustomerCommonConstant {
public
final
static
Integer
ACTIVITY_NEWS_TYPE
=
2
;
public
final
static
String
ACTIVITY_NEWS_TYPE_NAME
=
"活动"
;
public
final
static
String
ACTIVITY_NEWS_TYPE_NAME_MODEL
=
"系统-客服-{newsType}-{accountNickName}-{storeType}-{currentDate}-充{recharge}送{gift}"
;
public
final
static
String
ACTIVITY_NEWS_TYPE_NAME_CONFIG_NAME_MODEL
=
"系统-客服-{newsType}-{accountNickName}-{storeType}-{currentDate}-{configName}"
;
public
final
static
String
CUSTOMER_TEXT_LINK_TEMPLATE
=
"<a href=\"{url}-\" style='color: blue'>{content}</a>"
;
...
...
@@ -117,4 +119,22 @@ public class CustomerCommonConstant {
return
""
;
}
public
static
String
getLinkNameModel
(
Integer
code
,
String
configName
)
{
if
(
ObjectUtil
.
isNull
(
code
))
{
return
""
;
}
if
(
code
.
equals
(
BOOK_NEWS_TYPE
))
{
return
BOOK_NEWS_TYPE_NAME_MODEL
;
}
if
(
code
.
equals
(
ACTIVITY_NEWS_TYPE
))
{
if
(
StringUtils
.
isEmpty
(
configName
))
{
return
ACTIVITY_NEWS_TYPE_NAME_MODEL
;
}
else
{
return
ACTIVITY_NEWS_TYPE_NAME_CONFIG_NAME_MODEL
;
}
}
return
""
;
}
}
src/main/java/com/yaoyaozw/customer/constants/FollowReplyCommonConstant.java
浏览文件 @
ea246c31
package
com
.
yaoyaozw
.
customer
.
constants
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -23,5 +25,20 @@ public class FollowReplyCommonConstant {
return
TENCENT_MEDIA_TYPE_NEWS
.
equals
(
type
)
||
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
type
);
}
public
static
String
getTypeDesc
(
String
type
)
{
if
(
TENCENT_MEDIA_TYPE_PIC
.
equals
(
type
))
{
return
"图片"
;
}
else
if
(
TENCENT_MEDIA_TYPE_VOICE
.
equals
(
type
))
{
return
"语音"
;
}
else
if
(
TENCENT_MEDIA_TYPE_NEWS
.
equals
(
type
))
{
return
"图文"
;
}
else
if
(
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
type
))
{
return
"文本"
;
}
return
""
;
}
}
src/main/java/com/yaoyaozw/customer/controller/FollowReplyController.java
浏览文件 @
ea246c31
...
...
@@ -10,6 +10,7 @@ import com.yaoyaozw.customer.service.CustomerFollowReplyService;
import
com.yaoyaozw.customer.vo.follow.FollowReplyInfoVO
;
import
com.yaoyaozw.customer.vo.follow.FollowReplyListVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -32,7 +33,7 @@ public class FollowReplyController {
}
@PostMapping
(
"/create"
)
public
GenericsResult
<
String
>
create
(
@RequestBody
FollowReplySaveDTO
saveDto
)
{
public
GenericsResult
<
String
>
create
(
@RequestBody
@Validated
FollowReplySaveDTO
saveDto
)
{
return
followReplyService
.
create
(
saveDto
);
}
...
...
src/main/java/com/yaoyaozw/customer/dto/follow/FollowReplySaveDTO.java
浏览文件 @
ea246c31
...
...
@@ -5,6 +5,8 @@ import com.yaoyaozw.customer.entity.CommonReferralBody;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
...
...
@@ -16,11 +18,13 @@ public class FollowReplySaveDTO implements Serializable {
private
Long
id
;
@NotEmpty
(
message
=
"appid不能为空"
)
private
String
appid
;
@NotEmpty
(
message
=
"素材名称不能为空"
)
private
String
name
;
@NotEmpty
(
message
=
"素材类型不能为空"
)
private
String
type
;
private
String
originMediaUrl
;
...
...
@@ -29,6 +33,7 @@ public class FollowReplySaveDTO implements Serializable {
private
String
extendDesc
;
@NotNull
(
message
=
"素材排序不能为空"
)
private
Integer
sort
;
private
CommonReferralBody
referralBody
;
...
...
src/main/java/com/yaoyaozw/customer/entity/CommonReferralBody.java
浏览文件 @
ea246c31
...
...
@@ -47,6 +47,11 @@ public class CommonReferralBody implements Serializable {
@ApiModelProperty
(
value
=
"序号"
)
private
Integer
sort
;
private
String
accountName
;
@ApiModelProperty
(
value
=
"渠道号"
)
private
String
accountId
;
@ApiModelProperty
(
"书城"
)
private
String
storeType
;
...
...
@@ -89,6 +94,9 @@ public class CommonReferralBody implements Serializable {
@ApiModelProperty
(
value
=
"赠送数量"
)
private
Integer
giftAmount
;
@ApiModelProperty
(
value
=
"模板Id"
)
private
String
templateId
;
public
Date
getStartTime
()
{
if
(
ObjectUtil
.
isNull
(
this
.
startTime
)
&&
CollectionUtil
.
isNotEmpty
(
this
.
dateList
))
{
return
dateList
.
get
(
0
);
...
...
src/main/java/com/yaoyaozw/customer/entity/CustomerFollowReply.java
浏览文件 @
ea246c31
...
...
@@ -106,7 +106,7 @@ public class CustomerFollowReply implements Serializable {
/**
* 创建人
*/
@TableField
(
value
=
"
gmt_create
"
,
fill
=
FieldFill
.
INSERT
)
@TableField
(
value
=
"
create_user
"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createUser
;
/**
...
...
@@ -118,7 +118,7 @@ public class CustomerFollowReply implements Serializable {
/**
* 更新人
*/
@TableField
(
value
=
"
gmt_modified
"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
value
=
"
modified_user
"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Long
modifiedUser
;
/**
...
...
src/main/java/com/yaoyaozw/customer/entity/ReferralEntity.java
浏览文件 @
ea246c31
...
...
@@ -208,6 +208,9 @@ public class ReferralEntity implements Serializable {
@ApiModelProperty
(
value
=
"infoId"
)
private
Long
infoId
;
@TableField
(
exist
=
false
)
private
String
accountName
;
public
static
final
String
COL_ID
=
"id"
;
public
static
final
String
COL_ACCOUNT_ID
=
"account_id"
;
...
...
src/main/java/com/yaoyaozw/customer/mapper/CustomerFollowReplyMapper.java
浏览文件 @
ea246c31
package
com
.
yaoyaozw
.
customer
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yaoyaozw.customer.dto.follow.FollowReplyQueryDTO
;
import
com.yaoyaozw.customer.entity.CustomerFollowReply
;
import
com.yaoyaozw.customer.vo.follow.FollowReplyListVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author darker
* @date 2023/3/14 11:14
*/
@Repository
public
interface
CustomerFollowReplyMapper
extends
BaseMapper
<
CustomerFollowReply
>
{
/**
* 得到列表
*
* @param queryDto 查询dto
* @return {@link List}<{@link FollowReplyListVO}>
*/
List
<
FollowReplyListVO
>
getList
(
@Param
(
"queryDto"
)
FollowReplyQueryDTO
queryDto
);
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerFollowReplyServiceImpl.java
浏览文件 @
ea246c31
...
...
@@ -59,16 +59,28 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
@Override
public
GenericsResult
<
List
<
FollowReplyListVO
>>
list
(
FollowReplyQueryDTO
queryDto
)
{
return
null
;
List
<
FollowReplyListVO
>
list
=
this
.
baseMapper
.
getList
(
queryDto
);
return
new
GenericsResult
<>(
list
);
}
@Override
public
GenericsResult
<
String
>
create
(
FollowReplySaveDTO
saveDto
)
{
String
result
=
checkNecessary
(
saveDto
);
if
(
StringUtils
.
isNotEmpty
(
result
))
{
return
new
GenericsResult
<>(
false
,
result
);
}
CustomerFollowReply
entity
=
new
CustomerFollowReply
();
BeanUtil
.
copyProperties
(
saveDto
,
entity
);
CustomerFollowReply
sourceEntity
=
this
.
getById
(
entity
.
getId
())
;
CustomerFollowReply
sourceEntity
=
null
;
boolean
isCreate
=
ObjectUtil
.
isNull
(
entity
.
getId
());
if
(!
isCreate
)
{
sourceEntity
=
this
.
getById
(
entity
.
getId
());
if
(
ObjectUtil
.
isNull
(
sourceEntity
))
{
return
new
GenericsResult
<>(
false
,
""
);
}
}
if
(
isCreate
)
{
// 新增的id
entity
.
setId
(
snowflakeComponent
.
snowflakeId
());
...
...
@@ -77,6 +89,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
referralEntityService
.
remove
(
new
QueryWrapper
<
ReferralEntity
>().
eq
(
ReferralEntity
.
COL_MATERIAL_GRAPHICS_ID
,
sourceEntity
.
getId
()));
}
entity
.
setStatus
(
1
);
// 判断是否需要上传文件(图片、语音)
if
(
FollowReplyCommonConstant
.
needUpload
(
entity
.
getType
()))
{
// 编辑的时候,删除原来的media
...
...
@@ -105,6 +118,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
throw
new
RuntimeException
(
"获取链接异常: "
+
e
.
getMessage
());
}
referralEntity
.
setMaterialGraphicsId
(
entity
.
getId
());
entity
.
setSourceUrl
(
referralEntity
.
getReferral
());
// 保存链接数据
if
(
ObjectUtil
.
isNull
(
referralEntity
.
getId
()))
{
referralEntityService
.
save
(
referralEntity
);
...
...
@@ -312,4 +326,16 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
}
private
String
checkNecessary
(
FollowReplySaveDTO
saveDto
)
{
if
(!
FollowReplyCommonConstant
.
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
saveDto
.
getType
()))
{
// 非文本类型的都需要文件
if
(
StringUtils
.
isEmpty
(
saveDto
.
getOriginMediaUrl
()))
{
return
"请选择素材文件"
;
}
}
return
null
;
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsDelayServiceImpl.java
浏览文件 @
ea246c31
...
...
@@ -35,6 +35,7 @@ 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
;
...
...
@@ -55,6 +56,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
private
final
static
String
EMPTY_STR
=
" "
;
private
final
static
String
STORE_NAME_REDIS_KEY
=
"STORE_NAME_MAP"
;
@Autowired
private
TokenManager
tokenManager
;
@Autowired
...
...
@@ -69,6 +72,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
private
CustomerServiceCommonAsyncComponent
commonAsyncComponent
;
@Autowired
private
MaterialCommonMapper
materialCommonMapper
;
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Override
...
...
@@ -310,6 +315,17 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
}
List
<
AuthInfoVO
>
authList
=
super
.
baseMapper
.
getAuthList
(
keyword
,
keywordList
,
storeType
,
appId
);
Map
<
Object
,
Object
>
entries
=
redisTemplate
.
opsForHash
().
entries
(
STORE_NAME_REDIS_KEY
);
if
(
CollectionUtil
.
isNotEmpty
(
entries
))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>(
entries
.
size
());
entries
.
forEach
((
key
,
value
)
->
{
map
.
put
(
key
.
toString
(),
value
.
toString
());
});
authList
.
forEach
(
item
->
item
.
setStoreTypeName
(
map
.
get
(
item
.
getStoreType
())));
}
return
new
GenericsResult
<>(
authList
);
}
...
...
src/main/java/com/yaoyaozw/customer/vo/follow/FollowReplyListVO.java
浏览文件 @
ea246c31
...
...
@@ -2,7 +2,9 @@ package com.yaoyaozw.customer.vo.follow;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yaoyaozw.customer.constants.FollowReplyCommonConstant
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.Serializable
;
...
...
@@ -16,10 +18,19 @@ public class FollowReplyListVO implements Serializable {
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
private
String
name
;
private
String
authName
;
private
String
typeDesc
;
private
String
statusDesc
;
private
String
type
;
private
Integer
sort
;
public
String
getTypeDesc
()
{
return
FollowReplyCommonConstant
.
getTypeDesc
(
this
.
type
);
}
}
src/main/resources/mapper/CustomerFollowReplyMapper.xml
0 → 100644
浏览文件 @
ea246c31
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yaoyaozw.customer.mapper.CustomerFollowReplyMapper"
>
<select
id=
"getList"
resultType=
"com.yaoyaozw.customer.vo.follow.FollowReplyListVO"
>
select
rep.id,
rep.name,
rep.type,
rep.sort,
ai.nick_name as authName,
if(rep.status = 1, '正常', '异常') as statusDesc
from customer_follow_reply rep
left join authorizer_info ai
on rep.appid = ai.appid
where rep.is_deleted = 0
and rep.appid = #{queryDto.appId}
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论