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 f2df0a7d
authored
Jun 25, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:代码优化
1 parent
6e61f0e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
View file @
f2df0a7
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
import
cn.com.glsx.dj.smartcarlife.dto.Customer
Profi
leInfoDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.Customer
Simp
leInfoDTO
;
import
cn.com.glsx.dj.smartcarlife.remote.CustomerInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.CustomerInfoRemote
;
import
cn.com.glsx.dj.strategy.dto.CarSeriesDetailDTO
;
import
cn.com.glsx.dj.strategy.dto.CarSeriesDetailDTO
;
import
cn.com.glsx.dj.strategy.dto.CustomerProfileRespDTO
;
import
cn.com.glsx.dj.strategy.dto.CustomerProfileRespDTO
;
...
@@ -201,7 +201,7 @@ public class CustomerTagProfileService {
...
@@ -201,7 +201,7 @@ public class CustomerTagProfileService {
while
(
hasMore
)
{
while
(
hasMore
)
{
try
{
try
{
// 分页查询客户画像信息
// 分页查询客户画像信息
RpcPagination
<
Customer
Profi
leInfoDTO
>
pagination
=
queryCustomerProfileInfo
(
pageNum
);
RpcPagination
<
Customer
Simp
leInfoDTO
>
pagination
=
queryCustomerProfileInfo
(
pageNum
);
if
(
pagination
==
null
||
CollectionUtils
.
isEmpty
(
pagination
.
getList
()))
{
if
(
pagination
==
null
||
CollectionUtils
.
isEmpty
(
pagination
.
getList
()))
{
hasMore
=
false
;
hasMore
=
false
;
break
;
break
;
...
@@ -323,16 +323,12 @@ public class CustomerTagProfileService {
...
@@ -323,16 +323,12 @@ public class CustomerTagProfileService {
* @param pageNum 页码
* @param pageNum 页码
* @return 分页结果
* @return 分页结果
*/
*/
private
RpcPagination
<
CustomerProfileInfoDTO
>
queryCustomerProfileInfo
(
int
pageNum
)
{
private
RpcPagination
<
CustomerSimpleInfoDTO
>
queryCustomerProfileInfo
(
int
pageNum
)
{
CustomerProfileInfoDTO
queryDTO
=
new
CustomerProfileInfoDTO
();
RpcPagination
<
CustomerSimpleInfoDTO
>
pagination
=
new
RpcPagination
<>();
queryDTO
.
setPageNum
(
pageNum
);
queryDTO
.
setPageSize
(
PAGE_SIZE
);
RpcPagination
<
CustomerProfileInfoDTO
>
pagination
=
new
RpcPagination
<>();
pagination
.
setList
(
new
ArrayList
<>());
pagination
.
setList
(
new
ArrayList
<>());
pagination
.
setPageSize
(
PAGE_SIZE
);
pagination
.
setPageSize
(
PAGE_SIZE
);
pagination
.
setPageNum
(
pageNum
);
pagination
.
setPageNum
(
pageNum
);
RpcResponse
<
RpcPagination
<
Customer
Profi
leInfoDTO
>>
response
=
customerInfoRemote
.
pageCustomerProfileInfo
(
pagination
);
RpcResponse
<
RpcPagination
<
Customer
Simp
leInfoDTO
>>
response
=
customerInfoRemote
.
pageCustomerProfileInfo
(
pagination
);
if
(
response
.
isFailed
())
{
if
(
response
.
isFailed
())
{
log
.
error
(
"查询客户画像信息失败: {}"
,
response
.
getMessage
());
log
.
error
(
"查询客户画像信息失败: {}"
,
response
.
getMessage
());
throw
new
RpcServiceException
(
response
.
getError
(),
response
.
getMessage
());
throw
new
RpcServiceException
(
response
.
getError
(),
response
.
getMessage
());
...
@@ -346,12 +342,12 @@ public class CustomerTagProfileService {
...
@@ -346,12 +342,12 @@ public class CustomerTagProfileService {
* @param dtoList 客户画像信息列表
* @param dtoList 客户画像信息列表
* @param result 同步结果统计
* @param result 同步结果统计
*/
*/
private
void
processBatch
(
List
<
Customer
Profi
leInfoDTO
>
dtoList
,
SyncResult
result
)
{
private
void
processBatch
(
List
<
Customer
Simp
leInfoDTO
>
dtoList
,
SyncResult
result
)
{
// 收集有效的标签画像
// 收集有效的标签画像
List
<
CustomerTagProfile
>
profileList
=
new
ArrayList
<>();
List
<
CustomerTagProfile
>
profileList
=
new
ArrayList
<>();
List
<
String
>
phoneList
=
new
ArrayList
<>();
List
<
String
>
phoneList
=
new
ArrayList
<>();
for
(
Customer
Profi
leInfoDTO
dto
:
dtoList
)
{
for
(
Customer
Simp
leInfoDTO
dto
:
dtoList
)
{
CustomerTagProfile
profile
=
buildCustomerTagProfile
(
dto
,
result
);
CustomerTagProfile
profile
=
buildCustomerTagProfile
(
dto
,
result
);
if
(
profile
!=
null
)
{
if
(
profile
!=
null
)
{
profileList
.
add
(
profile
);
profileList
.
add
(
profile
);
...
@@ -386,7 +382,7 @@ public class CustomerTagProfileService {
...
@@ -386,7 +382,7 @@ public class CustomerTagProfileService {
* @param result 同步结果统计
* @param result 同步结果统计
* @return 标签画像实体,校验不通过返回 null
* @return 标签画像实体,校验不通过返回 null
*/
*/
private
CustomerTagProfile
buildCustomerTagProfile
(
Customer
Profi
leInfoDTO
dto
,
SyncResult
result
)
{
private
CustomerTagProfile
buildCustomerTagProfile
(
Customer
Simp
leInfoDTO
dto
,
SyncResult
result
)
{
String
phone
=
dto
.
getCustomerPhone
();
String
phone
=
dto
.
getCustomerPhone
();
Integer
carSeriesId
=
dto
.
getCarSeriesId
();
Integer
carSeriesId
=
dto
.
getCarSeriesId
();
...
...
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