Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d2889756
authored
Jun 24, 2026
by
潘诗林
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:查询昨日有变动的客户标签
1 parent
087aebde
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
0 deletions
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemote.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/CustomerTagProfileMapper.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemoteImpl.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
rpc-dj-strategy/src/main/resources/META-INF/orm/CustomerTagProfileMapper.xml
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemote.java
View file @
d288975
...
@@ -44,4 +44,28 @@ public interface CustomerTagProfileRemote {
...
@@ -44,4 +44,28 @@ public interface CustomerTagProfileRemote {
@ApiParam
(
name
=
"request"
,
notes
=
"请求对象,包含手机号列表"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiParam
(
name
=
"request"
,
notes
=
"请求对象,包含手机号列表"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"客户画像列表"
)
@ApiResponse
(
"客户画像列表"
)
RpcResponse
<
List
<
CustomerProfileRespDTO
>>
queryCustomerProfileByPhones
(
ProfileQueryReqDTO
request
);
RpcResponse
<
List
<
CustomerProfileRespDTO
>>
queryCustomerProfileByPhones
(
ProfileQueryReqDTO
request
);
/**
* 查询昨天有变动的标签画像的手机号列表
* <p>
* 扫描 dj_car_life_customer_tag_profile 表,找出昨天(yyyy-MM-dd)有 update_time 记录的
* 去重手机号,用于定时任务触发客户分类重算
*
* @return 昨天有变动的手机号列表
*/
@ApiMethod
(
"查询昨天变动的标签画像手机号"
)
@ApiResponse
(
"昨天有变动的手机号列表"
)
RpcResponse
<
List
<
String
>>
queryYesterdayChangedPhones
();
/**
* 查询昨天有变动的标签画像(合并手机号+画像查询)
* <p>
* 直接返回昨天有 update_time 的标签画像完整数据(含名称),一次 RPC 完成。
* 用于定时任务触发客户分类重算。
*
* @return 昨天有变动的客户画像列表
*/
@ApiMethod
(
"查询昨天变动的标签画像(含名称)"
)
@ApiResponse
(
"昨天有变动的客户画像列表"
)
RpcResponse
<
List
<
CustomerProfileRespDTO
>>
queryYesterdayChangedProfiles
();
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/CustomerTagProfileMapper.java
View file @
d288975
...
@@ -72,4 +72,9 @@ public interface CustomerTagProfileMapper extends OreMapper<CustomerTagProfile>
...
@@ -72,4 +72,9 @@ public interface CustomerTagProfileMapper extends OreMapper<CustomerTagProfile>
* @return 插入数量
* @return 插入数量
*/
*/
int
batchInsert
(
@Param
(
"list"
)
List
<
CustomerTagProfile
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
CustomerTagProfile
>
list
);
/**
* 查询昨天有变动的去重手机号列表
*/
List
<
String
>
selectYesterdayChangedPhones
();
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemoteImpl.java
View file @
d288975
...
@@ -83,4 +83,34 @@ public class CustomerTagProfileRemoteImpl implements CustomerTagProfileRemote {
...
@@ -83,4 +83,34 @@ public class CustomerTagProfileRemoteImpl implements CustomerTagProfileRemote {
return
RpcResponse
.
error
(
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
@Override
public
RpcResponse
<
List
<
String
>>
queryYesterdayChangedPhones
()
{
try
{
log
.
info
(
"查询昨天变动的标签画像手机号开始"
);
List
<
String
>
phones
=
customerTagProfileService
.
queryYesterdayChangedPhones
();
log
.
info
(
"查询昨天变动的标签画像手机号完成:size={}"
,
phones
!=
null
?
phones
.
size
()
:
0
);
return
RpcResponse
.
success
(
phones
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"查询昨天变动手机号 occur RpcServiceException"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"查询昨天变动手机号 occur Exception"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
@Override
public
RpcResponse
<
List
<
CustomerProfileRespDTO
>>
queryYesterdayChangedProfiles
()
{
try
{
List
<
CustomerProfileRespDTO
>
profiles
=
customerTagProfileService
.
queryYesterdayChangedProfiles
();
return
RpcResponse
.
success
(
profiles
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"查询昨天变动画像 occur RpcServiceException"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"查询昨天变动画像 occur Exception"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
View file @
d288975
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -102,6 +103,24 @@ public class CustomerTagProfileService {
...
@@ -102,6 +103,24 @@ public class CustomerTagProfileService {
}
}
/**
/**
* 查询昨天有变动的去重手机号列表
*/
public
List
<
String
>
queryYesterdayChangedPhones
()
{
return
customerTagProfileMapper
.
selectYesterdayChangedPhones
();
}
/**
* 查询昨天有变动的标签画像(含名称,合并查询)
*/
public
List
<
CustomerProfileRespDTO
>
queryYesterdayChangedProfiles
()
{
List
<
String
>
phoneList
=
customerTagProfileMapper
.
selectYesterdayChangedPhones
();
if
(
CollectionUtils
.
isEmpty
(
phoneList
)){
return
new
ArrayList
<>();
}
return
customerTagProfileMapper
.
selectByPhoneList
(
phoneList
);
}
/**
* 计算平均价格
* 计算平均价格
*
*
* @param carSeriesDetail 车系详情
* @param carSeriesDetail 车系详情
...
...
rpc-dj-strategy/src/main/resources/META-INF/orm/CustomerTagProfileMapper.xml
View file @
d288975
...
@@ -82,6 +82,12 @@
...
@@ -82,6 +82,12 @@
</foreach>
</foreach>
</delete>
</delete>
<!-- 查询昨天有变动的去重手机号列表 -->
<select
id=
"selectYesterdayChangedPhones"
resultType=
"java.lang.String"
>
SELECT DISTINCT phone
FROM dj_car_life_customer_tag_profile
WHERE DATE(update_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
</select>
<!-- 批量插入标签画像 -->
<!-- 批量插入标签画像 -->
<insert
id=
"batchInsert"
>
<insert
id=
"batchInsert"
>
INSERT INTO dj_car_life_customer_tag_profile
INSERT INTO dj_car_life_customer_tag_profile
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment