Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
ad3dc645
提交
ad3dc645
authored
11月 18, 2025
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客服消息预览接口
上级
3b5d3d83
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
92 行增加
和
2 行删除
+92
-2
CustomerMessageGraphicsController.java
...ustomer/controller/CustomerMessageGraphicsController.java
+7
-2
CustomerGraphicsPreviewDTO.java
...ozw/customer/dto/customer/CustomerGraphicsPreviewDTO.java
+34
-0
CustomerGraphicsService.java
...om/yaoyaozw/customer/service/CustomerGraphicsService.java
+8
-0
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+43
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/controller/CustomerMessageGraphicsController.java
浏览文件 @
ad3dc645
...
@@ -5,10 +5,10 @@ import com.yaoyaozw.customer.annotations.OperateLog;
...
@@ -5,10 +5,10 @@ import com.yaoyaozw.customer.annotations.OperateLog;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerBatchSetPackDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerBatchSetPackDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerGraphicsPreviewDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.service.CustomerGraphicsService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsService
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayListVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageDetailVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageDetailVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageListVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerMessageListVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -16,7 +16,6 @@ import io.swagger.annotations.ApiOperation;
...
@@ -16,7 +16,6 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -74,4 +73,10 @@ public class CustomerMessageGraphicsController {
...
@@ -74,4 +73,10 @@ public class CustomerMessageGraphicsController {
return
new
BaseResult
().
success
(
"批量生成中,请稍后查看"
);
return
new
BaseResult
().
success
(
"批量生成中,请稍后查看"
);
}
}
@ApiOperation
(
"预览发文"
)
@PostMapping
(
"/previewGraphics"
)
public
BaseResult
previewGraphics
(
@RequestBody
CustomerGraphicsPreviewDTO
previewDTO
)
{
return
customerGraphicsService
.
previewGraphics
(
previewDTO
);
}
}
}
src/main/java/com/yaoyaozw/customer/dto/customer/CustomerGraphicsPreviewDTO.java
0 → 100644
浏览文件 @
ad3dc645
package
com
.
yaoyaozw
.
customer
.
dto
.
customer
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 预览图文DTO
* @author system
* @date 2024/01/01
*/
@Data
@ApiModel
(
"预览图文DTO"
)
public
class
CustomerGraphicsPreviewDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"客服消息ID"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
@ApiModelProperty
(
"授权方ID"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
authId
;
@ApiModelProperty
(
"用户OpenId"
)
private
String
userOpenId
;
}
src/main/java/com/yaoyaozw/customer/service/CustomerGraphicsService.java
浏览文件 @
ad3dc645
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.service;
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.service;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.customer.CustomerGraphicsPreviewDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
...
@@ -80,5 +81,12 @@ public interface CustomerGraphicsService extends IService<CustomerGraphics> {
...
@@ -80,5 +81,12 @@ public interface CustomerGraphicsService extends IService<CustomerGraphics> {
*/
*/
void
sendCustomerMessage
(
IntegrationRequestDTO
integrationRequestDTO
);
void
sendCustomerMessage
(
IntegrationRequestDTO
integrationRequestDTO
);
/**
* 预览图文
* @param previewDTO 预览参数DTO
* @return {@link BaseResult}
*/
BaseResult
previewGraphics
(
CustomerGraphicsPreviewDTO
previewDTO
);
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
ad3dc645
...
@@ -16,6 +16,7 @@ import com.yaoyaozw.customer.components.TokenManager;
...
@@ -16,6 +16,7 @@ import com.yaoyaozw.customer.components.TokenManager;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.customer.CustomerBatchSetPackDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerBatchSetPackDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerGraphicsPreviewDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
...
@@ -85,6 +86,9 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
...
@@ -85,6 +86,9 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
@Autowired
@Autowired
private
CrowdPackageService
crowdPackageService
;
private
CrowdPackageService
crowdPackageService
;
@Autowired
private
AuthorizerInfoService
authorizerInfoService
;
@Override
@Override
public
BaseResult
insertCustomerMessage
(
CustomerMessageSaveDTO
saveDto
)
{
public
BaseResult
insertCustomerMessage
(
CustomerMessageSaveDTO
saveDto
)
{
...
@@ -372,6 +376,45 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
...
@@ -372,6 +376,45 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
}
}
}
}
@Override
public
BaseResult
previewGraphics
(
CustomerGraphicsPreviewDTO
previewDTO
)
{
// 用id查询 customer_graphics 表,获取主体类
CustomerGraphics
customerGraphics
=
super
.
getById
(
previewDTO
.
getId
());
if
(
ObjectUtil
.
isNull
(
customerGraphics
))
{
return
new
BaseResult
().
error
(
"找不到客服消息主体数据"
);
}
// 用 authId 查询 authorizer_info 表
AuthorizerInfo
authorizerInfo
=
authorizerInfoService
.
getById
(
previewDTO
.
getAuthId
());
if
(
ObjectUtil
.
isNull
(
authorizerInfo
))
{
return
new
BaseResult
().
error
(
"找不到授权方信息"
);
}
// 调用 referralEntityService.findReferralByCustomerGraphicsId 传入 id,查询referral 列表
List
<
ReferralEntityVo
>
referralList
=
referralEntityService
.
findReferralByCustomerGraphicsId
(
previewDTO
.
getId
());
// 筛选 account_id = authorizer_info.account_id 的记录
List
<
ReferralEntityVo
>
filteredReferralList
=
referralList
.
stream
()
.
filter
(
referral
->
Objects
.
equals
(
referral
.
getAccountId
(),
authorizerInfo
.
getAccountId
()))
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isEmpty
(
filteredReferralList
))
{
return
new
BaseResult
().
error
(
"找不到公众号:"
+
authorizerInfo
.
getNickName
()
+
" 对应的推广内容,请确保公众号在生成范围内,或联系技术进行查看"
);
}
// 构造 CrowdPackageUserVO 列表(只有一个用户,openId = userOpenId)
CrowdPackageUserVO
userVO
=
new
CrowdPackageUserVO
();
userVO
.
setOpenId
(
previewDTO
.
getUserOpenId
());
userVO
.
setAppId
(
authorizerInfo
.
getAppid
());
userVO
.
setAccountId
(
authorizerInfo
.
getAccountId
());
List
<
CrowdPackageUserVO
>
openidList
=
CollectionUtil
.
newArrayList
(
userVO
);
// 调用 weChatService.sendCustomerMessage 进行处理
weChatService
.
sendCustomerMessage
(
authorizerInfo
.
getAppid
(),
customerGraphics
,
openidList
,
filteredReferralList
);
return
new
BaseResult
().
success
(
"预览消息已发起,请稍后查看"
);
}
private
BaseResult
checkExtendBook
(
String
storeType
,
CrowdPackageConditionMatch
storeConditionMatch
)
{
private
BaseResult
checkExtendBook
(
String
storeType
,
CrowdPackageConditionMatch
storeConditionMatch
)
{
// 判断有没有选书城条件
// 判断有没有选书城条件
if
(
ObjectUtil
.
isNull
(
storeConditionMatch
))
{
if
(
ObjectUtil
.
isNull
(
storeConditionMatch
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论