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
83933bf7
Commit
83933bf7
authored
Dec 10, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改客户新增/编辑/详情,客户主营类别/主营产品的传参与返参数据结构
parent
11d33ceb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
8 deletions
+60
-8
CustomerBaseVO.java
.../yudao/module/customer/vo/customer/vo/CustomerBaseVO.java
+3
-1
CustomerDetailRespVO.java
.../module/customer/vo/customer/vo/CustomerDetailRespVO.java
+3
-0
CustomerProductTypeGroupVO.java
...e/customer/vo/customer/vo/CustomerProductTypeGroupVO.java
+18
-0
CustomerController.java
...ustomer/controller/admin/customer/CustomerController.java
+36
-7
No files found.
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/vo/customer/vo/CustomerBaseVO.java
View file @
83933bf7
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
/**
* 客户 Base VO,提供给添加、修改、详细的子 VO 使用
...
...
@@ -117,7 +118,8 @@ public class CustomerBaseVO {
@ApiModelProperty
(
value
=
"付款人姓名"
)
private
String
payerName
;
@ApiModelProperty
(
value
=
"主营产品类别分组"
)
private
List
<
CustomerProductTypeGroupVO
>
products
;
}
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/vo/customer/vo/CustomerDetailRespVO.java
View file @
83933bf7
...
...
@@ -309,6 +309,9 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty
(
value
=
"选中的主营产品类型"
)
private
List
<
ProductTypeRespVO
>
productTypeList
;
@ApiModelProperty
(
value
=
"主营产品类别分组"
)
private
List
<
CustomerProductTypeGroupVO
>
products
;
@ApiModelProperty
(
value
=
"付款人姓名"
)
private
String
payerName
;
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/vo/customer/vo/CustomerProductTypeGroupVO.java
0 → 100644
View file @
83933bf7
package
cn
.
iocoder
.
yudao
.
module
.
customer
.
vo
.
customer
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
"客户主营商品类型分组"
)
public
class
CustomerProductTypeGroupVO
{
@ApiModelProperty
(
"主营类别id"
)
private
Long
typeId
;
@ApiModelProperty
(
"主营产品ids"
)
private
List
<
Long
>
productIds
;
}
yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerController.java
View file @
83933bf7
...
...
@@ -43,6 +43,7 @@ import cn.iocoder.yudao.module.customer.vo.customer.vo.*;
import
cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankBackVO
;
import
cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankQueryVO
;
import
cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi
;
import
cn.iocoder.yudao.module.ecw.controller.admin.region.vo.RegionRespVO
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerContactsDefaultEnum
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerCreateFromEnum
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum
;
...
...
@@ -55,6 +56,7 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
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.sale.dal.dataobject.offer.OfferDO
;
import
cn.iocoder.yudao.module.sale.dal.mysql.offer.OfferMapper
;
import
cn.iocoder.yudao.module.system.api.file.FileMakeApi
;
...
...
@@ -166,7 +168,11 @@ public class CustomerController {
createReqVO
.
setIsPotential
(
true
);
createReqVO
.
setCustomerOperateLogRemark
(
"新增潜在客户"
);
if
(
CollectionUtil
.
isNotEmpty
(
createReqVO
.
getProducts
())){
createReqVO
.
setProductTypes
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
createReqVO
.
setProductIds
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
}
return
createCustomerPrivate
(
createReqVO
);
}
...
...
@@ -178,6 +184,11 @@ public class CustomerController {
@Valid
@RequestBody
CustomerCreateReqVO
createReqVO
,
HttpServletRequest
request
)
{
createReqVO
.
setCustomerOperateLogRemark
(
"管理端页面新建客户"
);
if
(
CollectionUtil
.
isNotEmpty
(
createReqVO
.
getProducts
())){
createReqVO
.
setProductTypes
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
createReqVO
.
setProductIds
(
createReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
}
return
createCustomerPrivate
(
createReqVO
);
}
...
...
@@ -249,6 +260,11 @@ public class CustomerController {
//SELECT arrival_confirm from ecw_customer 到仓确认
List
<
CustomerContactsUpdateReqVO
>
customerContacts
=
updateReqVO
.
getCustomerContacts
();
if
(
CollectionUtil
.
isNotEmpty
(
updateReqVO
.
getProducts
())){
updateReqVO
.
setProductTypes
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
updateReqVO
.
setProductIds
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
}
if
(!
CollectionUtils
.
isEmpty
(
customerContacts
))
{
long
count
=
customerContacts
.
stream
().
filter
(
t
->
CustomerContactsDefaultEnum
.
IS_DEFAULT
.
getValue
().
equals
(
t
.
getIsDefault
())).
count
();
if
(
count
<=
0
)
{
...
...
@@ -264,7 +280,7 @@ public class CustomerController {
if
(
userid
!=
null
&&
userid
!=
0
)
{
//老数据导入过来后部分userid=0
count
=
customerContactsService
.
count
(
new
LambdaQueryWrapperX
<
CustomerContactsDO
>().
eq
(
CustomerContactsDO:
:
getUserid
,
userid
)
.
ne
(
CustomerContactsDO:
:
getCustomerId
,
updateReqVO
.
getId
()).
eq
(
BaseDO:
:
getDeleted
,
0
));
.
ne
(
CustomerContactsDO:
:
getCustomerId
,
updateReqVO
.
getId
()).
eq
(
BaseDO:
:
getDeleted
,
0
));
if
(
count
>
0
)
{
UserRespDTO
user
=
memberUserApi
.
getUser
(
userid
);
throw
exception
(
ErrorCodeConstants
.
CUSTOMER_CONTACTS_USERID_ALREADY_BIND
,
user
!=
null
?
user
.
getNickname
()
:
""
,
user
!=
null
?
user
.
getMobile
()
:
""
);
...
...
@@ -337,7 +353,11 @@ public class CustomerController {
//完善信息要确认接收
updateReqVO
.
setIsCustomerServiceConfirmed
(
true
);
if
(
CollectionUtil
.
isNotEmpty
(
updateReqVO
.
getProducts
())){
updateReqVO
.
setProductTypes
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getTypeId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
updateReqVO
.
setProductIds
(
updateReqVO
.
getProducts
().
stream
().
map
(
CustomerProductTypeGroupVO:
:
getProductIds
)
.
flatMap
(
Collection:
:
stream
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
)));
}
//完善客户信息确认接收时要计算客户的业绩类型
return
this
.
updateCustomer
(
updateReqVO
);
}
...
...
@@ -373,7 +393,7 @@ public class CustomerController {
if
(
customerDODeleted
==
null
)
{
throw
exception
(
ErrorCodeConstants
.
CUSTOMER_DELETED_NOT_EXISTS
);
}
if
(!
Objects
.
equals
(
customerDOSaved
.
getCustomerService
(),
customerDODeleted
.
getCustomerService
())
&&
!
customerDOSaved
.
getIsInOpenSea
()
&&
!
customerDODeleted
.
getIsInOpenSea
())
{
if
(!
Objects
.
equals
(
customerDOSaved
.
getCustomerService
(),
customerDODeleted
.
getCustomerService
())
&&
!
customerDOSaved
.
getIsInOpenSea
()
&&
!
customerDODeleted
.
getIsInOpenSea
())
{
throw
exception
(
ErrorCodeConstants
.
CUSTOMER_MERGE_CUSTOMER_SERVICE_NOT_SAME
);
}
...
...
@@ -417,6 +437,17 @@ public class CustomerController {
respVO
.
setPromoterName
(
customer1
.
getName
());
}
}
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getProductList
()))
{
// 对商品数据进行分组返回
Map
<
Long
,
List
<
ProductRespVO
>>
productRespVOMap
=
respVO
.
getProductList
().
stream
().
collect
(
Collectors
.
groupingBy
(
ProductRespVO:
:
getTypeId
));
List
<
CustomerProductTypeGroupVO
>
products
=
productRespVOMap
.
entrySet
().
stream
().
map
(
entry
->
{
CustomerProductTypeGroupVO
productTypeGroupVO
=
new
CustomerProductTypeGroupVO
();
productTypeGroupVO
.
setTypeId
(
entry
.
getKey
());
productTypeGroupVO
.
setProductIds
(
entry
.
getValue
().
stream
().
map
(
ProductRespVO:
:
getId
).
collect
(
Collectors
.
toList
()));
return
productTypeGroupVO
;
}).
collect
(
Collectors
.
toList
());
respVO
.
setProducts
(
products
);
}
//设置银行账号
CustomerBankQueryVO
customerBankQueryVO
=
new
CustomerBankQueryVO
();
...
...
@@ -488,13 +519,12 @@ public class CustomerController {
.
stream
().
sorted
(
Comparator
.
comparing
(
CustomerBankBackVO:
:
getId
)).
collect
(
Collectors
.
toList
());
respVO
.
setCustomerBankBackVOList
(
customerBankBackVOS
);
String
sR
=
getContactStr
(
id
);
String
sR
=
getContactStr
(
id
);
respVO
.
setContactstr
(
sR
);
return
success
(
respVO
);
}
@GetMapping
(
"/list"
)
@ApiOperation
(
"根据客户id集合获得客户详情列表"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
...
...
@@ -1112,7 +1142,6 @@ public class CustomerController {
}
@PutMapping
(
"/recycle-unconfirmed-customer"
)
@ApiOperation
(
"回收已分配未接收的客户"
)
// @PreAuthorize("@ss.hasPermission('ecw:customer:recycle:unconfirmed')")
...
...
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