Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
1d32faf2
Commit
1d32faf2
authored
Sep 25, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fna接口53
parent
9d6dd326
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiCustomerController.java
+0
-7
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CustomerServiceImpl.java
+10
-7
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiCustomerController.java
View file @
1d32faf2
...
...
@@ -36,13 +36,6 @@ public class ApiCustomerController {
@Resource
private
CustomerService
customerService
;
@Resource
private
CustomerExpandService
customerExpandService
;
@Resource
private
ApiSysUserFeignClient
apiSysUserFeignClient
;
/**
* 创建客户
*
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CustomerServiceImpl.java
View file @
1d32faf2
...
...
@@ -109,16 +109,20 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
List
<
CustomerVO
>
customerVOList
=
customerList
.
stream
().
map
(
CustomerVO:
:
objToVo
).
collect
(
Collectors
.
toList
());
// 1. 关联查询扩展信息
Set
<
String
>
customerIdSet
=
customerList
.
stream
().
map
(
Customer:
:
getCustomerBizId
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
List
<
CustomerExpand
>>
customerBizIdCustomerExpandListMap
=
customerExpandService
.
listByIds
(
customerIdSet
).
stream
()
.
collect
(
Collectors
.
groupingBy
(
CustomerExpand:
:
getCustomerBizId
));
Set
<
String
>
customerBizIdSet
=
customerList
.
stream
().
map
(
Customer:
:
getCustomerBizId
).
collect
(
Collectors
.
toSet
());
QueryWrapper
<
CustomerExpand
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"customer_biz_id"
,
customerBizIdSet
);
List
<
CustomerExpand
>
customerExpandList
=
customerExpandService
.
list
(
queryWrapper
);
Map
<
String
,
CustomerExpand
>
customerBizIdCustomerExpandListMap
=
customerExpandList
.
stream
()
.
collect
(
Collectors
.
toMap
(
CustomerExpand:
:
getCustomerBizId
,
customerExpand
->
customerExpand
));
// 填充信息
customerVOList
.
forEach
(
customerVO
->
{
for
(
CustomerVO
customerVO
:
customerVOList
)
{
String
customerBizId
=
customerVO
.
getCustomerBizId
();
CustomerExpand
customerExpand
=
null
;
if
(
customerBizIdCustomerExpandListMap
.
containsKey
(
customerBizId
))
{
customerExpand
=
customerBizIdCustomerExpandListMap
.
get
(
customerBizId
)
.
get
(
0
)
;
customerExpand
=
customerBizIdCustomerExpandListMap
.
get
(
customerBizId
);
}
if
(
customerExpand
!=
null
)
{
BeanUtils
.
copyProperties
(
customerExpand
,
customerVO
);
...
...
@@ -129,8 +133,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
customerVO
.
setAddressList
(
addressList
);
}
}
});
// endregion
}
customerVOPage
.
setRecords
(
customerVOList
);
return
customerVOPage
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment