Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
8acace10
提交
8acace10
authored
8月 07, 2024
作者:
卢宇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
菜单资源配置小程序客服消息推送适配
上级
0d88aedd
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
232 行增加
和
5 行删除
+232
-5
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+11
-5
CustomerMessageMiniProgramController.java
...omer/controller/CustomerMessageMiniProgramController.java
+46
-0
CustomerMessageMiniProgramSaveDTO.java
...tomer/dto/customer/CustomerMessageMiniProgramSaveDTO.java
+39
-0
ReferralEntity.java
...ain/java/com/yaoyaozw/customer/entity/ReferralEntity.java
+12
-0
CustomerGraphicsMiniProgramService.java
.../customer/service/CustomerGraphicsMiniProgramService.java
+24
-0
CustomerGraphicsMiniProgramServiceImpl.java
.../service/impl/CustomerGraphicsMiniProgramServiceImpl.java
+98
-0
CustomerGraphicsMapper.xml
src/main/resources/mapper/CustomerGraphicsMapper.xml
+2
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
8acace10
...
@@ -59,10 +59,14 @@ public class CustomerCommonConstant {
...
@@ -59,10 +59,14 @@ public class CustomerCommonConstant {
public
final
static
String
CUSTOMER_TYPE_VALUE_TEXT
=
"text"
;
public
final
static
String
CUSTOMER_TYPE_VALUE_TEXT
=
"text"
;
public
final
static
String
CUSTOMER_TYPE_VALUE_MINI_PROGRAM
=
"miniProgram"
;
public
final
static
String
CUSTOMER_TYPE_NAME_GRAPHICS
=
"图文"
;
public
final
static
String
CUSTOMER_TYPE_NAME_GRAPHICS
=
"图文"
;
public
final
static
String
CUSTOMER_TYPE_NAME_TEXT
=
"文本"
;
public
final
static
String
CUSTOMER_TYPE_NAME_TEXT
=
"文本"
;
public
final
static
String
CUSTOMER_TYPE_NAME_MINI_PROGRAM
=
"小程序"
;
public
final
static
Integer
SEND_STATUS_WAITING
=
0
;
public
final
static
Integer
SEND_STATUS_WAITING
=
0
;
public
final
static
Integer
SEND_STATUS_LINK_GETTING
=
1
;
public
final
static
Integer
SEND_STATUS_LINK_GETTING
=
1
;
...
@@ -82,11 +86,13 @@ public class CustomerCommonConstant {
...
@@ -82,11 +86,13 @@ public class CustomerCommonConstant {
if
(
ObjectUtil
.
isNull
(
type
))
{
if
(
ObjectUtil
.
isNull
(
type
))
{
return
null
;
return
null
;
}
}
if
(
type
.
equals
(
CUSTOMER_TYPE_VALUE_GRAPHICS
))
{
switch
(
type
)
{
return
CUSTOMER_TYPE_NAME_GRAPHICS
;
case
CUSTOMER_TYPE_VALUE_GRAPHICS:
}
return
CUSTOMER_TYPE_NAME_GRAPHICS
;
if
(
type
.
equals
(
CUSTOMER_TYPE_VALUE_TEXT
))
{
case
CUSTOMER_TYPE_VALUE_TEXT:
return
CUSTOMER_TYPE_NAME_TEXT
;
return
CUSTOMER_TYPE_NAME_TEXT
;
case
CUSTOMER_TYPE_VALUE_MINI_PROGRAM:
return
CUSTOMER_TYPE_NAME_MINI_PROGRAM
;
}
}
return
type
;
return
type
;
}
}
...
...
src/main/java/com/yaoyaozw/customer/controller/CustomerMessageMiniProgramController.java
0 → 100644
浏览文件 @
8acace10
package
com
.
yaoyaozw
.
customer
.
controller
;
import
com.yaoyaozw.customer.annotations.OperateLog
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageMiniProgramSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageTextSaveDTO
;
import
com.yaoyaozw.customer.entity.CommonReferralBody
;
import
com.yaoyaozw.customer.service.CustomerGraphicsMiniProgramService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsTextService
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageTextDetailVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author Luy
* @date 2024/8/6 11:13
*/
@Api
(
tags
=
"客服消息接口-小程序"
)
@RestController
@RequestMapping
(
"/customer-service/message/miniProgram"
)
public
class
CustomerMessageMiniProgramController
{
@Autowired
private
CustomerGraphicsMiniProgramService
miniProgramService
;
@ApiOperation
(
"新增客服主体"
)
@PostMapping
(
"/insertCustomerMessage"
)
@OperateLog
(
module
=
"客服消息-小程序"
,
desc
=
"新增小程序客服消息"
)
public
BaseResult
insertCustomerMessage
(
@RequestBody
CustomerMessageMiniProgramSaveDTO
saveDto
)
{
return
miniProgramService
.
insertCustomerMessage
(
saveDto
);
}
@ApiOperation
(
"获取文本客服详情"
)
@GetMapping
(
"/detail/{id}"
)
public
GenericsResult
<
CustomerMessageMiniProgramSaveDTO
>
getCustomerTextDetail
(
@PathVariable
(
"id"
)
Long
id
)
{
return
miniProgramService
.
getCustomerTextDetail
(
id
);
}
}
src/main/java/com/yaoyaozw/customer/dto/customer/CustomerMessageMiniProgramSaveDTO.java
0 → 100644
浏览文件 @
8acace10
package
com
.
yaoyaozw
.
customer
.
dto
.
customer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author darker
* @date 2022/10/12 16:33
*/
@Data
@ApiModel
(
"小程序类型客服保存实体"
)
public
class
CustomerMessageMiniProgramSaveDTO
implements
Serializable
{
@ApiModelProperty
(
"客服消息id"
)
private
Long
id
;
@ApiModelProperty
(
"标题"
)
private
String
name
;
@ApiModelProperty
(
"消息发送时间"
)
private
String
postTime
;
@ApiModelProperty
(
"客服消息类型(图文,文本,小程序)"
)
private
String
type
;
@ApiModelProperty
(
"小程序标题"
)
private
String
mpTitle
;
@ApiModelProperty
(
"小程序appId"
)
private
String
mpAppId
;
@ApiModelProperty
(
"小程序跳转路径"
)
private
String
mpPath
;
}
src/main/java/com/yaoyaozw/customer/entity/ReferralEntity.java
浏览文件 @
8acace10
...
@@ -214,6 +214,18 @@ public class ReferralEntity implements Serializable {
...
@@ -214,6 +214,18 @@ public class ReferralEntity implements Serializable {
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
infoId
;
private
Long
infoId
;
@TableField
(
value
=
"mp_title"
)
@ApiModelProperty
(
"小程序标题"
)
private
String
mpTitle
;
@TableField
(
value
=
"mp_app_id"
)
@ApiModelProperty
(
"小程序appId"
)
private
String
mpAppId
;
@TableField
(
value
=
"mp_path"
)
@ApiModelProperty
(
"小程序跳转路径"
)
private
String
mpPath
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
h5Content
;
private
String
h5Content
;
...
...
src/main/java/com/yaoyaozw/customer/service/CustomerGraphicsMiniProgramService.java
0 → 100644
浏览文件 @
8acace10
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageMiniProgramSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageTextSaveDTO
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
public
interface
CustomerGraphicsMiniProgramService
extends
IService
<
CustomerGraphics
>
{
/**
* 新增小程序客服消息
* @param saveDto
* @return
*/
BaseResult
insertCustomerMessage
(
CustomerMessageMiniProgramSaveDTO
saveDto
);
/**
* 获取详情
* @param id
* @return
*/
GenericsResult
<
CustomerMessageMiniProgramSaveDTO
>
getCustomerTextDetail
(
Long
id
);
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsMiniProgramServiceImpl.java
0 → 100644
浏览文件 @
8acace10
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.CustomerMessageMiniProgramSaveDTO
;
import
com.yaoyaozw.customer.entity.CommonReferralBody
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsMapper
;
import
com.yaoyaozw.customer.service.CustomerGraphicsMiniProgramService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageDetailVO
;
import
org.apache.commons.lang3.StringUtils
;
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
;
@Service
public
class
CustomerGraphicsMiniProgramServiceImpl
extends
ServiceImpl
<
CustomerGraphicsMapper
,
CustomerGraphics
>
implements
CustomerGraphicsMiniProgramService
{
private
final
static
Logger
LOCAL_LOG
=
LoggerFactory
.
getLogger
(
CustomerGraphicsMiniProgramServiceImpl
.
class
);
@Autowired
private
TokenManager
tokenManager
;
@Autowired
private
SnowflakeComponent
snowflakeComponent
;
@Autowired
private
ReferralEntityService
referralEntityService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResult
insertCustomerMessage
(
CustomerMessageMiniProgramSaveDTO
saveDto
)
{
// 主体数据
LOCAL_LOG
.
info
(
"处理主体数据"
);
CustomerGraphics
customerGraphics
=
new
CustomerGraphics
();
BeanUtil
.
copyProperties
(
saveDto
,
customerGraphics
);
customerGraphics
.
initOperateInfo
(
tokenManager
.
getUserIdFromToken
(),
ObjectUtil
.
isNull
(
saveDto
.
getId
()));
if
(
ObjectUtil
.
isNull
(
customerGraphics
.
getId
()))
{
long
id
=
snowflakeComponent
.
snowflakeId
();
customerGraphics
.
setId
(
id
);
}
// // 设置链接数
// if (CustomerCommonConstant.REMOTE_LINK_NEWS_TYPE_LIST.contains(saveDto.getCustomerReferralDto().getNewsType())) {
// customerGraphics.setReferralSize(1);
// }
super
.
saveOrUpdate
(
customerGraphics
);
// 处理活动数据
ReferralEntity
referralEntity
=
new
ReferralEntity
();
BeanUtil
.
copyProperties
(
saveDto
,
referralEntity
);
referralEntity
.
setMaterialGraphicsId
(
customerGraphics
.
getId
());
// 获取name模板
String
nameModel
=
CustomerCommonConstant
.
getLinkNameModel
(
referralEntity
.
getNewsType
());
LOCAL_LOG
.
info
(
"获取name模板: {}"
,
nameModel
);
if
(
StringUtils
.
isNotBlank
(
nameModel
))
{
referralEntity
.
setName
(
nameModel
);
}
// 保存链接数据
referralEntityService
.
saveOrUpdate
(
referralEntity
);
return
new
BaseResult
().
success
();
}
@Override
public
GenericsResult
<
CustomerMessageMiniProgramSaveDTO
>
getCustomerTextDetail
(
Long
id
)
{
// 获取主体数据
CustomerGraphics
customerGraphics
=
super
.
getById
(
id
);
if
(
ObjectUtil
.
isNull
(
customerGraphics
))
{
return
new
GenericsResult
<>(
false
,
"找不到主体数据"
);
}
CustomerMessageMiniProgramSaveDTO
miniProgramDTO
=
new
CustomerMessageMiniProgramSaveDTO
();
BeanUtil
.
copyProperties
(
customerGraphics
,
miniProgramDTO
);
miniProgramDTO
.
setPostTime
(
customerGraphics
.
getPostTimeStr
());
// 获取链接数据
ReferralEntity
referralEntity
=
referralEntityService
.
getOne
(
new
QueryWrapper
<
ReferralEntity
>().
eq
(
"material_graphics_id"
,
id
).
isNull
(
"account_id"
));
if
(
ObjectUtil
.
isNull
(
referralEntity
))
{
return
new
GenericsResult
<>(
false
,
"找不到链接数据"
);
}
miniProgramDTO
.
setMpAppId
(
referralEntity
.
getMpAppId
());
miniProgramDTO
.
setMpTitle
(
referralEntity
.
getMpTitle
());
miniProgramDTO
.
setMpPath
(
referralEntity
.
getMpPath
());
return
new
GenericsResult
<>(
miniProgramDTO
);
}
}
src/main/resources/mapper/CustomerGraphicsMapper.xml
浏览文件 @
8acace10
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
and dic.level = 3
and dic.level = 3
where cg.is_deleted = 0
where cg.is_deleted = 0
order by cg.gmt_modified DESC
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论