Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
cffdb210
提交
cffdb210
authored
4月 25, 2025
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
复用时替换获客链接的查询接口
上级
46ff7f38
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
88 行增加
和
0 行删除
+88
-0
MaterialCommonMapper.java
...va/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
+17
-0
CompanyAcquisitionLinkService.java
...yaozw/customer/service/CompanyAcquisitionLinkService.java
+14
-0
CompanyAcquisitionLinkServiceImpl.java
...tomer/service/impl/CompanyAcquisitionLinkServiceImpl.java
+33
-0
MaterialCommonMapper.xml
src/main/resources/mapper/MaterialCommonMapper.xml
+24
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
浏览文件 @
cffdb210
...
@@ -63,4 +63,21 @@ public interface MaterialCommonMapper {
...
@@ -63,4 +63,21 @@ public interface MaterialCommonMapper {
*/
*/
String
getStoreTypeNameByAppId
(
@Param
(
"appId"
)
String
appId
);
String
getStoreTypeNameByAppId
(
@Param
(
"appId"
)
String
appId
);
/**
* 获取指定公众号的指定获客链接数量
* @param appointAuthId 指定公众号Id
* @param appointReferral 指定获客链接
* @return 数量
*/
Integer
getAppointAuthIdAndAppointReferralCount
(
@Param
(
"appointAuthId"
)
Long
appointAuthId
,
@Param
(
"appointReferral"
)
String
appointReferral
);
/**
* 获取指定公众号的获客链接列表
* @param targetAuthId 指定公众号
* @return 获客链接列表
*/
List
<
String
>
getAcquisitionLinkList
(
@Param
(
"targetAuthId"
)
Long
targetAuthId
);
}
}
src/main/java/com/yaoyaozw/customer/service/CompanyAcquisitionLinkService.java
0 → 100644
浏览文件 @
cffdb210
package
com
.
yaoyaozw
.
customer
.
service
;
public
interface
CompanyAcquisitionLinkService
{
/**
* 校验链接是否是源公众号的获客链接,如果是的,查找目标公众号的链接,并返回(如果不是获客链接,则会返回原链接,如果是,但找不到目标公众号的获客链接,则返回空)
* @param sourceReferral 原链接
* @param sourceAuthId 原公众号
* @param targetAuthId 目标公众号
* @return 链接
*/
String
checkAndSearchTargetReferral
(
String
sourceReferral
,
Long
sourceAuthId
,
Long
targetAuthId
);
}
src/main/java/com/yaoyaozw/customer/service/impl/CompanyAcquisitionLinkServiceImpl.java
0 → 100644
浏览文件 @
cffdb210
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
import
com.yaoyaozw.customer.service.CompanyAcquisitionLinkService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Slf4j
@Service
public
class
CompanyAcquisitionLinkServiceImpl
implements
CompanyAcquisitionLinkService
{
@Resource
private
MaterialCommonMapper
materialCommonMapper
;
@Override
public
String
checkAndSearchTargetReferral
(
String
sourceReferral
,
Long
sourceAuthId
,
Long
targetAuthId
)
{
// 查询 sourceReferral 这个链接是不是获客链接,如果不是,直接返回原链接
Integer
count
=
materialCommonMapper
.
getAppointAuthIdAndAppointReferralCount
(
sourceAuthId
,
sourceReferral
);
if
(
count
==
null
||
count
==
0
)
{
return
sourceReferral
;
}
// 原链接是获客链接,查询目标公众号的获客链接
List
<
String
>
acquisitionLinkList
=
materialCommonMapper
.
getAcquisitionLinkList
(
targetAuthId
);
if
(
CollectionUtil
.
isEmpty
(
acquisitionLinkList
)
||
acquisitionLinkList
.
size
()
>
1
)
{
return
null
;
}
return
acquisitionLinkList
.
get
(
0
);
}
}
src/main/resources/mapper/MaterialCommonMapper.xml
浏览文件 @
cffdb210
...
@@ -63,4 +63,27 @@
...
@@ -63,4 +63,27 @@
where a.appid = #{appId}
where a.appid = #{appId}
limit 1
limit 1
</select>
</select>
<select
id=
"getAcquisitionLinkList"
resultType=
"java.lang.String"
>
SELECT
DISTINCT a.link_url
FROM company_acquisition_link a
LEFT JOIN authorizer_info ai ON ai.appid = a.auth_app_id
WHERE ai.id = #{targetAuthId}
AND a.`status` = 1
AND a.is_deleted = 0
</select>
<select
id=
"getAppointAuthIdAndAppointReferralCount"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM company_acquisition_link a
LEFT JOIN authorizer_info ai ON a.auth_app_id = ai.appid
WHERE a.link_url = #{appointReferral} AND ai.id = #{appointAuthId}
</select>
</mapper>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论