Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
5b590907
Commit
5b590907
authored
Dec 11, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
允许选择了主营类别,但是该主营类别下面没有对应的商品,并保存时对数据进行去重
parent
4950d20a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
CustomerController.java
...ustomer/controller/admin/customer/CustomerController.java
+31
-8
No files found.
yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerController.java
View file @
5b590907
...
...
@@ -57,6 +57,7 @@ import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.dal.mysql.order.OrderMapper
;
import
cn.iocoder.yudao.module.product.vo.product.ProductRespVO
;
import
cn.iocoder.yudao.module.product.vo.product.ProductTypeRespVO
;
import
cn.iocoder.yudao.module.sale.dal.dataobject.offer.OfferDO
;
import
cn.iocoder.yudao.module.sale.dal.mysql.offer.OfferMapper
;
import
cn.iocoder.yudao.module.system.api.file.FileMakeApi
;
...
...
@@ -169,9 +170,9 @@ public class CustomerController {
createReqVO
.
setIsPotential
(
true
);
createReqVO
.
setCustomerOperateLogRemark
(
"新增潜在客户"
);
if
(
CollectionUtil
.
isNotEmpty
(
createReqVO
.
getProducts
())){
createReqVO
.
setProductTypes
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
createReqVO
.
setProductTypes
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
distinct
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
createReqVO
.
setProductIds
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
distinct
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
return
createCustomerPrivate
(
createReqVO
);
}
...
...
@@ -185,9 +186,9 @@ public class CustomerController {
HttpServletRequest
request
)
{
createReqVO
.
setCustomerOperateLogRemark
(
"管理端页面新建客户"
);
if
(
CollectionUtil
.
isNotEmpty
(
createReqVO
.
getProducts
())){
createReqVO
.
setProductTypes
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
createReqVO
.
setProductTypes
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
distinct
(
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
createReqVO
.
setProductIds
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
distinct
(
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
return
createCustomerPrivate
(
createReqVO
);
}
...
...
@@ -261,9 +262,9 @@ public class CustomerController {
List
<
CustomerContactsUpdateReqVO
>
customerContacts
=
updateReqVO
.
getCustomerContacts
();
if
(
CollectionUtil
.
isNotEmpty
(
updateReqVO
.
getProducts
())){
updateReqVO
.
setProductTypes
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
updateReqVO
.
setProductTypes
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
distinct
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
updateReqVO
.
setProductIds
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
distinct
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
if
(!
CollectionUtils
.
isEmpty
(
customerContacts
))
{
long
count
=
customerContacts
.
stream
().
filter
(
t
->
CustomerContactsDefaultEnum
.
IS_DEFAULT
.
getValue
().
equals
(
t
.
getIsDefault
())).
count
();
...
...
@@ -354,9 +355,9 @@ public class CustomerController {
//完善信息要确认接收
updateReqVO
.
setIsCustomerServiceConfirmed
(
true
);
if
(
CollectionUtil
.
isNotEmpty
(
updateReqVO
.
getProducts
())){
updateReqVO
.
setProductTypes
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
updateReqVO
.
setProductTypes
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
distinct
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
updateReqVO
.
setProductIds
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
distinct
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
//完善客户信息确认接收时要计算客户的业绩类型
return
this
.
updateCustomer
(
updateReqVO
);
...
...
@@ -446,6 +447,17 @@ public class CustomerController {
productTypeGroupVO
.
setProductIds
(
entry
.
getValue
().
stream
().
map
(
ProductRespVO:
:
getId
).
collect
(
Collectors
.
toList
()));
return
productTypeGroupVO
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getProductTypeList
())){
// 允许选择了主营类别,但是该主营类别下面没有对应的商品
for
(
ProductTypeRespVO
typeRespVO
:
respVO
.
getProductTypeList
())
{
if
(!
productRespVOMap
.
containsKey
(
typeRespVO
.
getId
()))
{
CustomerProductTypeGroupVO
productTypeGroupVO
=
new
CustomerProductTypeGroupVO
();
productTypeGroupVO
.
setTypeId
(
typeRespVO
.
getId
());
productTypeGroupVO
.
setProductIds
(
new
ArrayList
<>());
products
.
add
(
productTypeGroupVO
);
}
}
}
respVO
.
setProducts
(
products
);
}
...
...
@@ -498,6 +510,17 @@ public class CustomerController {
productTypeGroupVO
.
setProductIds
(
entry
.
getValue
().
stream
().
map
(
ProductRespVO:
:
getId
).
collect
(
Collectors
.
toList
()));
return
productTypeGroupVO
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getProductTypeList
())){
// 允许选择了主营类别,但是该主营类别下面没有对应的商品
for
(
ProductTypeRespVO
typeRespVO
:
respVO
.
getProductTypeList
())
{
if
(!
productRespVOMap
.
containsKey
(
typeRespVO
.
getId
()))
{
CustomerProductTypeGroupVO
productTypeGroupVO
=
new
CustomerProductTypeGroupVO
();
productTypeGroupVO
.
setTypeId
(
typeRespVO
.
getId
());
productTypeGroupVO
.
setProductIds
(
new
ArrayList
<>());
products
.
add
(
productTypeGroupVO
);
}
}
}
respVO
.
setProducts
(
products
);
}
Long
founder
=
respVO
.
getFounder
();
...
...
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