Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
5266853d
提交
5266853d
authored
11月 17, 2025
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客服消息适配”阅文1小程序“【未测试】
上级
6db036f6
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
39 行增加
和
2 行删除
+39
-2
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+33
-2
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+1
-0
ReferralEntity.java
...ain/java/com/yaoyaozw/customer/entity/ReferralEntity.java
+5
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
5266853d
...
@@ -713,6 +713,10 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -713,6 +713,10 @@ public class CustomerServiceCommonAsyncComponent {
referralEntity
.
setMediaSource
(
"2"
);
referralEntity
.
setMediaSource
(
"2"
);
}
}
}
}
referralEntity
.
setMiniProgramQuery
(
Boolean
.
TRUE
);
}
if
(
STORE_NAME_YUE_WEN_1
.
equals
(
authInfoVo
.
getStoreType
())
&&
CUSTOMER_TYPE_VALUE_MINI_PROGRAM
.
equals
(
referralEntity
.
getCustomerMsgType
()))
{
referralEntity
.
setMiniProgramQuery
(
Boolean
.
TRUE
);
}
}
// LOCAL_LOG.info("获取链接, 参数: {}", referralEntity);
// LOCAL_LOG.info("获取链接, 参数: {}", referralEntity);
R
r
=
referralFeignClient
.
productReferral
(
referralEntity
);
R
r
=
referralFeignClient
.
productReferral
(
referralEntity
);
...
@@ -732,13 +736,18 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -732,13 +736,18 @@ public class CustomerServiceCommonAsyncComponent {
String
referral
=
jsonObject1
.
getString
(
"referral"
);
String
referral
=
jsonObject1
.
getString
(
"referral"
);
referralEntity
.
setPromoteId
(
jsonObject1
.
getString
(
"promoteId"
));
referralEntity
.
setPromoteId
(
jsonObject1
.
getString
(
"promoteId"
));
referralEntity
.
setReferral
(
referral
);
referralEntity
.
setReferral
(
referral
);
if
(
CustomerCommonConstant
.
STORE_NAME_TOMATO
.
equals
(
authInfoVo
.
getStoreType
())
&&
CUSTOMER_TYPE_VALUE_MINI_PROGRAM
.
equals
(
referralEntity
.
getCustomerMsgType
()))
{
// 取链接成功之后,后置处理番茄小程序
// 取链接成功之后,后置处理番茄小程序
suffixHandleTomatoMiniProgram
(
authInfoVo
,
referralEntity
);
suffixHandleTomatoMiniProgram
(
authInfoVo
,
referralEntity
);
}
}
if
(
STORE_NAME_YUE_WEN_1
.
equals
(
authInfoVo
.
getStoreType
())
&&
CUSTOMER_TYPE_VALUE_MINI_PROGRAM
.
equals
(
referralEntity
.
getCustomerMsgType
()))
{
// 取链接成功之后,后置处理阅文1小程序
suffixHandleYwMiniProgram
(
authInfoVo
,
referralEntity
,
jsonObject1
);
}
}
private
void
suffixHandleTomatoMiniProgram
(
AuthInfoVO
authInfoVo
,
ReferralEntity
referralEntity
)
{
private
void
suffixHandleTomatoMiniProgram
(
AuthInfoVO
authInfoVo
,
ReferralEntity
referralEntity
)
{
if
(
CustomerCommonConstant
.
STORE_NAME_TOMATO
.
equals
(
authInfoVo
.
getStoreType
())
&&
CUSTOMER_TYPE_VALUE_MINI_PROGRAM
.
equals
(
referralEntity
.
getCustomerMsgType
()))
{
String
referral
=
referralEntity
.
getReferral
();
String
referral
=
referralEntity
.
getReferral
();
// 番茄小程序
// 番茄小程序
if
(
CustomerCommonConstant
.
ACTIVITY_NEWS_TYPE
.
equals
(
referralEntity
.
getNewsType
()))
{
if
(
CustomerCommonConstant
.
ACTIVITY_NEWS_TYPE
.
equals
(
referralEntity
.
getNewsType
()))
{
...
@@ -776,7 +785,29 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -776,7 +785,29 @@ public class CustomerServiceCommonAsyncComponent {
referralEntity
.
setMpPath
(
referral
);
referralEntity
.
setMpPath
(
referral
);
// 暂时将小程序地址也赋值到跳转链接地址上
// 暂时将小程序地址也赋值到跳转链接地址上
referralEntity
.
setReferral
(
referral
);
referralEntity
.
setReferral
(
referral
);
// 上传腾讯图片素材
TencentMediaResponseVO
uploadResult
=
tencentCustomerUtil
.
uploadTencentMedia
(
authInfoVo
.
getAppId
(),
referralEntity
.
getMediaOriginUrl
(),
referralEntity
.
getCustomerMsgType
());
if
(
StringUtils
.
isNotEmpty
(
uploadResult
.
getErrmsg
()))
{
LOCAL_LOG
.
warn
(
"公众号: {} 上传素材失败 {}"
,
authInfoVo
.
getAppId
(),
uploadResult
.
getErrmsg
());
}
referralEntity
.
setMediaId
(
uploadResult
.
getMedia_id
());
}
/**
* 阅文小程序链接后置处理
* @param referralEntity 链接
* @param responseJson 响应
*/
private
void
suffixHandleYwMiniProgram
(
AuthInfoVO
authInfoVo
,
ReferralEntity
referralEntity
,
JSONObject
responseJson
)
{
// 原始字段
referralEntity
.
setPromoteId
(
responseJson
.
getString
(
"promoteId"
));
String
referral
=
responseJson
.
getString
(
"referral"
);
referralEntity
.
setReferral
(
referral
);
// 小程序字段
String
mpPath
=
responseJson
.
getString
(
"mpPath"
);
referralEntity
.
setMpPath
(
StringUtils
.
isNotBlank
(
mpPath
)
?
mpPath
:
(
isMiniProgramPath
(
referral
)
?
referral
:
null
));
referralEntity
.
setMpAppId
(
responseJson
.
getString
(
"mpAppId"
));
// 上传腾讯图片素材
// 上传腾讯图片素材
TencentMediaResponseVO
uploadResult
=
tencentCustomerUtil
.
uploadTencentMedia
(
authInfoVo
.
getAppId
(),
referralEntity
.
getMediaOriginUrl
(),
referralEntity
.
getCustomerMsgType
());
TencentMediaResponseVO
uploadResult
=
tencentCustomerUtil
.
uploadTencentMedia
(
authInfoVo
.
getAppId
(),
referralEntity
.
getMediaOriginUrl
(),
referralEntity
.
getCustomerMsgType
());
...
@@ -785,7 +816,7 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -785,7 +816,7 @@ public class CustomerServiceCommonAsyncComponent {
}
}
referralEntity
.
setMediaId
(
uploadResult
.
getMedia_id
());
referralEntity
.
setMediaId
(
uploadResult
.
getMedia_id
());
}
}
}
private
Boolean
isMiniProgramPath
(
String
path
)
{
private
Boolean
isMiniProgramPath
(
String
path
)
{
return
StringUtils
.
isNotBlank
(
path
)
&&
(
path
.
startsWith
(
"page"
)
||
path
.
startsWith
(
"/page"
));
return
StringUtils
.
isNotBlank
(
path
)
&&
(
path
.
startsWith
(
"page"
)
||
path
.
startsWith
(
"/page"
));
}
}
...
...
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
5266853d
...
@@ -30,6 +30,7 @@ public class CustomerCommonConstant {
...
@@ -30,6 +30,7 @@ public class CustomerCommonConstant {
public
final
static
String
STORE_NAME_YANG_GUANG
=
"YANG_GUANG"
;
public
final
static
String
STORE_NAME_YANG_GUANG
=
"YANG_GUANG"
;
public
final
static
String
STORE_NAME_ZHANG_ZHONG_YUN
=
"ZHANG_ZHONG_YUN"
;
public
final
static
String
STORE_NAME_ZHANG_ZHONG_YUN
=
"ZHANG_ZHONG_YUN"
;
public
final
static
String
STORE_NAME_YUE_WEN
=
"YUE_WEN"
;
public
final
static
String
STORE_NAME_YUE_WEN
=
"YUE_WEN"
;
public
final
static
String
STORE_NAME_YUE_WEN_1
=
"YUE_WEN_1"
;
public
final
static
String
STORE_NAME_TOMATO
=
"TOMATO"
;
public
final
static
String
STORE_NAME_TOMATO
=
"TOMATO"
;
public
final
static
String
ERROR_LABEL
=
"error"
;
public
final
static
String
ERROR_LABEL
=
"error"
;
...
...
src/main/java/com/yaoyaozw/customer/entity/ReferralEntity.java
浏览文件 @
5266853d
...
@@ -246,6 +246,11 @@ public class ReferralEntity implements Serializable {
...
@@ -246,6 +246,11 @@ public class ReferralEntity implements Serializable {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
mediaSource
;
private
String
mediaSource
;
/**
* 是否小程序相关请求
*/
@TableField
(
exist
=
false
)
private
Boolean
miniProgramQuery
;
public
static
final
String
COL_ID
=
"id"
;
public
static
final
String
COL_ID
=
"id"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论