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
4529299b
Commit
4529299b
authored
May 28, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的客户列表支持多选
parent
bdef71b4
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
495 additions
and
69 deletions
+495
-69
CustomerMapper.java
...ao/module/customer/dal/mysql/customer/CustomerMapper.java
+15
-0
CustomerExportReqDTO.java
...coder/yudao/module/customer/dto/CustomerExportReqDTO.java
+1
-1
CustomerPageReqDTO.java
...iocoder/yudao/module/customer/dto/CustomerPageReqDTO.java
+1
-1
CustomerService.java
...dao/module/customer/service/customer/CustomerService.java
+18
-0
CustomerServiceImpl.java
...module/customer/service/customer/CustomerServiceImpl.java
+24
-0
CustomerMapper.xml
...ore/src/main/resources/mapper/customer/CustomerMapper.xml
+336
-7
CustomerController.java
...ustomer/controller/admin/customer/CustomerController.java
+45
-13
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+47
-43
CustomerExcelExportListener.java
...dao/module/sale/listener/CustomerExcelExportListener.java
+8
-4
No files found.
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/dal/mysql/customer/CustomerMapper.java
View file @
4529299b
...
...
@@ -29,6 +29,21 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
List
<
CustomerDO
>
getMyPage
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
CustomerPageReqDTO
customerPageReqDTO
);
List
<
CustomerDO
>
getWaitToAssignedCustomerPageReq
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
CustomerPageReqDTO
customerPageReqDTO
);
/**
* 分页列表统计total
* @param pageReqVO
* @return
*/
long
getWaitToAssignedCustomerPageReqCount
(
@Param
(
"query"
)
CustomerPageReqDTO
pageReqVO
);
/**
* 待分配客户列表导出, 用于 Excel 导出 支持多筛选
* @param
* @return
*/
List
<
CustomerDO
>
getWaitToAssignedCustomerListReq
(
@Param
(
"query"
)
CustomerExportReqDTO
customerPageReqDTO
);
long
getMyPageCount
(
@Param
(
"query"
)
CustomerPageReqDTO
pageReqVO
);
List
<
CustomerDO
>
getCustomerExcelVoList
(
@Param
(
Constants
.
WRAPPER
)
Wrapper
<
CustomerDO
>
queryWrapper
);
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/dto/CustomerExportReqDTO.java
View file @
4529299b
...
...
@@ -37,7 +37,7 @@ public class CustomerExportReqDTO {
private
List
<
Integer
>
resourceType
;
@ApiModelProperty
(
value
=
"跟进客服"
)
private
L
ong
customerService
;
private
L
ist
<
Long
>
customerService
;
@ApiModelProperty
(
value
=
"客户状态"
)
private
List
<
Integer
>
status
;
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/dto/CustomerPageReqDTO.java
View file @
4529299b
...
...
@@ -46,7 +46,7 @@ public class CustomerPageReqDTO extends PageParam {
@ApiModelProperty
(
value
=
"跟进客服"
)
private
L
ong
customerService
;
private
L
ist
<
Long
>
customerService
;
@ApiModelProperty
(
value
=
"客户状态"
)
private
List
<
Integer
>
status
;
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customer/CustomerService.java
View file @
4529299b
...
...
@@ -99,6 +99,12 @@ public interface CustomerService extends IService<CustomerDO> {
*/
PageResult
<
CustomerDO
>
getCustomerPage
(
CustomerPageReqVO
pageReqVO
);
/**
* 获取我的客户分页 ,入参支持多选
* @param pageReqVO
* @param page
* @return
*/
PageResult
<
CustomerDO
>
getMyCustomerPage
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
);
/**
...
...
@@ -142,6 +148,12 @@ public interface CustomerService extends IService<CustomerDO> {
*/
PageResult
<
CustomerDO
>
getWaitToAssignedCustomerPage
(
CustomerPageReqVO
pageReqVO
);
/**
* 获得待分配客户分页 支持多选
* @param pageReqVO
* @return
*/
PageResult
<
CustomerDO
>
getWaitToAssignedCustomerPageReq
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
);
/**
* 待分配客户列表导出, 用于 Excel 导出
...
...
@@ -151,6 +163,12 @@ public interface CustomerService extends IService<CustomerDO> {
*/
List
<
CustomerDO
>
getWaitToAssignedCustomerExcelVoList
(
CustomerExportReqVO
exportReqVO
);
/**
* 待分配客户列表导出, 用于 Excel 导出 支持多筛选
* @param exportReqVO
* @return
*/
List
<
CustomerDO
>
getWaitToAssignedCustomerExcelVoListReq
(
CustomerExportReqDTO
exportReqVO
);
/**
* 获得公海池客户分页
*
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customer/CustomerServiceImpl.java
View file @
4529299b
...
...
@@ -1286,6 +1286,26 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return
new
PageResult
<>(
mpPage
.
getRecords
(),
mpPage
.
getTotal
());
}
/**
* 获得待分配客户列表 支持多个筛选
* @param pageReqVO
* @param page
* @return
*/
@Override
public
PageResult
<
CustomerDO
>
getWaitToAssignedCustomerPageReq
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
)
{
pageReqVO
.
setIsInOpenSea
(
false
)
;
pageReqVO
.
setIsCustomerServiceConfirmed
(
false
)
;
pageReqVO
.
setCustomerService
(
null
)
;
IPage
<
CustomerDO
>
mpPage
=
MyBatisUtils
.
buildPage
(
page
);
log
.
warn
(
I18nMessage
.
getLang
().
toString
());
int
start
=
(
page
.
getPage
()
-
1
)
*
page
.
getRows
();
int
size
=
page
.
getRows
();
List
<
CustomerDO
>
list
=
customerMapper
.
getWaitToAssignedCustomerPageReq
(
start
,
size
,
pageReqVO
);
long
total
=
customerMapper
.
getWaitToAssignedCustomerPageReqCount
(
pageReqVO
)
;
return
new
PageResult
<>(
list
,
total
,
mpPage
.
getSize
(),
page
.
getPage
(),
(
total
+
mpPage
.
getSize
()
-
1
)
/
mpPage
.
getSize
());
}
@Override
public
List
<
CustomerDO
>
getWaitToAssignedCustomerExcelVoList
(
CustomerExportReqVO
exportReqVO
)
{
LambdaQueryWrapper
<
CustomerDO
>
customerDOLambdaQueryWrapperX
=
new
LambdaQueryWrapperX
<
CustomerDO
>()
...
...
@@ -1333,6 +1353,10 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return
customerMapper
.
getCustomerExcelVoList
(
customerDOLambdaQueryWrapperX
);
}
@Override
public
List
<
CustomerDO
>
getWaitToAssignedCustomerExcelVoListReq
(
CustomerExportReqDTO
exportReqVO
)
{
return
customerMapper
.
getWaitToAssignedCustomerListReq
(
exportReqVO
)
;
}
@Override
public
PageResult
<
CustomerDO
>
getWaitToConfirmCustomerPage
(
CustomerPageReqVO
pageReqVO
)
{
...
...
yudao-module-customer/yudao-module-customer-core/src/main/resources/mapper/customer/CustomerMapper.xml
View file @
4529299b
This diff is collapsed.
Click to expand it.
yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerController.java
View file @
4529299b
...
...
@@ -21,6 +21,7 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customer.commission.Custo
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerBank.CustomerBankDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerHandoverApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerPageReqDTO
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
...
...
@@ -379,7 +380,7 @@ public class CustomerController {
@GetMapping
(
"/get-potential"
)
@ApiOperation
(
"获得潜在客户列表"
)
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getPotentialList
(
@Valid
CustomerPageReq
VO
pageVO
)
{
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getPotentialList
(
@Valid
CustomerPageReq
DTO
pageVO
,
PageVO
page
)
{
// 20230331 全部客户列表,当客户经理不是空时,排除公海客户
if
(
pageVO
.
getCustomerService
()
!=
null
)
{
...
...
@@ -389,16 +390,17 @@ public class CustomerController {
//设置潜在客户标识
pageVO
.
setIsPotential
(
true
);
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getCustomerPage
(
pageVO
);
//PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO);
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getMyCustomerPage
(
pageVO
,
page
);
return
success
(
CustomerConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
@GetMapping
(
"/get-wait-for-distribution"
)
@ApiOperation
(
"获得待分配客户列表"
)
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getWaitForDistributionList
(
@Valid
CustomerPageReq
VO
customerPageReqVO
)
{
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getWaitForDistributionList
(
@Valid
CustomerPageReq
DTO
customerPageReqVO
,
PageVO
page
)
{
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getWaitToAssignedCustomerPage
(
customerPageReqVO
);
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getWaitToAssignedCustomerPage
Req
(
customerPageReqVO
,
page
);
return
success
(
CustomerConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
...
...
@@ -497,7 +499,10 @@ public class CustomerController {
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getMine
(
@Valid
CustomerPageReqDTO
customerPageReqVO
,
PageVO
page
)
{
customerPageReqVO
.
setCustomerService
(
WebFrameworkUtils
.
getLoginUserId
());
//customerPageReqVO.setCustomerService(WebFrameworkUtils.getLoginUserId());
List
<
Long
>
setCustomerService
=
new
ArrayList
<>();
setCustomerService
.
add
(
WebFrameworkUtils
.
getLoginUserId
())
;
customerPageReqVO
.
setCustomerService
(
setCustomerService
)
;
//未被接收
customerPageReqVO
.
setIsCustomerServiceConfirmed
(
true
);
...
...
@@ -576,13 +581,14 @@ public class CustomerController {
@GetMapping
(
"/page"
)
@ApiOperation
(
"获得客户分页"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:customer:query')"
)
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getCustomerPage
(
@Valid
CustomerPageReq
VO
pageVO
)
{
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getCustomerPage
(
@Valid
CustomerPageReq
DTO
pageVO
,
PageVO
page
)
{
// 20230331 全部客户列表,当客户经理不是空时,排除公海客户
if
(
pageVO
.
getCustomerService
()
!=
null
)
{
pageVO
.
setIsInOpenSea
(
false
);
}
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getCustomerPage
(
pageVO
);
//PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO);
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getMyCustomerPage
(
pageVO
,
page
);
return
success
(
CustomerConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
...
...
@@ -603,7 +609,30 @@ public class CustomerController {
return
success
(
CustomerConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
/**
* 支持多选
* @param exportReqVO
* @param downloadTypeEnum
* @param fileName
*/
private
void
sendFileMake
(
CustomerExportReqDTO
exportReqVO
,
DownloadTypeEnum
downloadTypeEnum
,
String
fileName
)
{
FileMakeReqDTO
reqDTO
=
new
FileMakeReqDTO
();
reqDTO
.
setType
(
downloadTypeEnum
.
getType
());
reqDTO
.
setName
(
fileName
);
reqDTO
.
setFileSuffix
(
"xlsx"
);
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
exportReqVO
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
}
/**
* 单选
* @param exportReqVO
* @param downloadTypeEnum
* @param fileName
*/
private
void
sendFileMake
(
CustomerExportReqVO
exportReqVO
,
DownloadTypeEnum
downloadTypeEnum
,
String
fileName
)
{
FileMakeReqDTO
reqDTO
=
new
FileMakeReqDTO
();
reqDTO
.
setType
(
downloadTypeEnum
.
getType
());
...
...
@@ -619,7 +648,7 @@ public class CustomerController {
@GetMapping
(
"/export-excel"
)
@ApiOperation
(
"全部客户导出"
)
@OperateLog
(
type
=
EXPORT
)
public
CommonResult
<
Boolean
>
exportCustomerExcel
(
@Valid
CustomerExportReq
V
O
exportReqVO
,
public
CommonResult
<
Boolean
>
exportCustomerExcel
(
@Valid
CustomerExportReq
DT
O
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
sendFileMake
(
exportReqVO
,
DownloadTypeEnum
.
CUSTOMER_EXCEL_EXPORT
,
"客户导出Excel"
);
return
success
(
true
);
...
...
@@ -628,13 +657,16 @@ public class CustomerController {
@GetMapping
(
"/mine-export-excel"
)
@ApiOperation
(
"我的客户列表导出"
)
@OperateLog
(
type
=
EXPORT
)
public
CommonResult
<
Boolean
>
exportMyCustomerExcel
(
@Valid
CustomerExportReq
V
O
exportReqVO
,
public
CommonResult
<
Boolean
>
exportMyCustomerExcel
(
@Valid
CustomerExportReq
DT
O
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
exportReqVO
.
setCustomerService
(
WebFrameworkUtils
.
getLoginUserId
());
//
exportReqVO.setCustomerService(WebFrameworkUtils.getLoginUserId());
//未被接收
exportReqVO
.
setIsCustomerServiceConfirmed
(
true
);
// customerPageReqVO.setFlag4QueryCondition("Y");
List
<
Long
>
setCustomerService
=
new
ArrayList
<>();
setCustomerService
.
add
(
WebFrameworkUtils
.
getLoginUserId
())
;
exportReqVO
.
setCustomerService
(
setCustomerService
)
;
sendFileMake
(
exportReqVO
,
DownloadTypeEnum
.
CUSTOMER_MINE_EXCEL_EXPORT
,
"我的客户导出Excel"
);
return
success
(
true
);
...
...
@@ -663,7 +695,7 @@ public class CustomerController {
@GetMapping
(
"/wait-distribution-export-excel"
)
@ApiOperation
(
"待分配客户列表导出"
)
@OperateLog
(
type
=
EXPORT
)
public
CommonResult
<
Boolean
>
exportWaitDistributionCustomerExcel
(
@Valid
CustomerExportReq
V
O
exportReqVO
,
public
CommonResult
<
Boolean
>
exportWaitDistributionCustomerExcel
(
@Valid
CustomerExportReq
DT
O
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
sendFileMake
(
exportReqVO
,
DownloadTypeEnum
.
CUSTOMER_WAIT_DISTRIBUTION_PUBLIC_EXCEL_EXPORT
,
"待分配客户导出Excel"
);
return
success
(
true
);
...
...
@@ -672,9 +704,9 @@ public class CustomerController {
@GetMapping
(
"/potential-export-excel"
)
@ApiOperation
(
"潜在客户列表导出"
)
@OperateLog
(
type
=
EXPORT
)
public
CommonResult
<
Boolean
>
exportPotentialCustomerExcel
(
@Valid
CustomerExportReq
V
O
exportReqVO
,
public
CommonResult
<
Boolean
>
exportPotentialCustomerExcel
(
@Valid
CustomerExportReq
DT
O
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
if
(
exportReqVO
.
getCustomerService
()
!=
null
)
{
if
(
CollectionUtil
.
isNotEmpty
(
exportReqVO
.
getCustomerService
())
)
{
exportReqVO
.
setIsInOpenSea
(
false
);
}
//设置潜在客户标识
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
4529299b
...
...
@@ -912,58 +912,62 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
{
// 非控货订单 + 付款人为发货人 归属发货人, 其他归属收货人
if
(
order
.
getDrawee
()
==
1
)
{
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
{
customerType
=
2
;
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
}
}
// if (order.getDrawee() == 1) {
// order.setCustomerId(orderConsignorDO.getCustomerId());
// } else {
// customerType = 2;
// order.setCustomerId(orderConsigneeDO.getCustomerId());
// }
// 补充业绩规则判断
if
(!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
&&
createReqVO
.
getOfferId
()
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
// 补充业绩规则判断
if
(!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
}
else
if
(
order
.
getDrawee
()
==
3
)
{
//自定义付款
List
<
CustomDraweeVO
>
list
=
JSONObject
.
parseArray
(
order
.
getCustomDrawee
(),
CustomDraweeVO
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
}
else
{
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
&&
createReqVO
.
getOfferId
()
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
}
else
if
(
order
.
getDrawee
()
==
3
)
{
//自定义付款
List
<
CustomDraweeVO
>
list
=
JSONObject
.
parseArray
(
order
.
getCustomDrawee
(),
CustomDraweeVO
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
List
<
CustomDraweeVO
>
freightList
=
list
.
stream
().
filter
(
s
->
s
.
getName
().
equals
(
"freight"
)).
collect
(
Collectors
.
toList
());
List
<
CustomDraweeVO
>
clearanceFeeList
=
list
.
stream
().
filter
(
s
->
s
.
getName
().
equals
(
"clearanceFee"
)).
collect
(
Collectors
.
toList
());
int
freight
=
freightList
.
get
(
0
).
getValue
();
//运费
int
clearanceFee
=
clearanceFeeList
.
get
(
0
).
getValue
();
//清关费
if
(
createReqVO
.
getOfferId
()
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
createReqVO
.
getOfferId
()
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(!
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
2
)
||
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
2
))
{
//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
orderConsigneeDO
.
getCustomerId
());
List
<
CustomDraweeVO
>
freightList
=
list
.
stream
().
filter
(
s
->
s
.
getName
().
equals
(
"freight"
)).
collect
(
Collectors
.
toList
());
List
<
CustomDraweeVO
>
clearanceFeeList
=
list
.
stream
().
filter
(
s
->
s
.
getName
().
equals
(
"clearanceFee"
)).
collect
(
Collectors
.
toList
());
int
freight
=
freightList
.
get
(
0
).
getValue
();
//运费
int
clearanceFee
=
clearanceFeeList
.
get
(
0
).
getValue
();
//清关费
}
if
(
createReqVO
.
getOfferId
()
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
createReqVO
.
getOfferId
()
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
if
(!
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
2
)
||
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
2
))
{
//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
orderConsigneeDO
.
getCustomerId
());
}
}
else
{
//业绩归属公司
order
.
setCustomerId
(
0L
);
order
.
setSalesmanId
(
0L
);
}
}
}
else
{
//业绩归属公司
order
.
setCustomerId
(
0L
);
order
.
setSalesmanId
(
0L
);
//end
}
//end
// if(createReqVO.getOfferId()!=null && order.getDrawee()==1){//订单关联报价单 && 发货人付款
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/listener/CustomerExcelExportListener.java
View file @
4529299b
...
...
@@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import
cn.iocoder.yudao.module.customer.convert.customer.CustomerConvert
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerPageReqDTO
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.customer.service.indirectCustomer.IndirectCustomerService
;
import
cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerExcelVO
;
...
...
@@ -56,8 +57,8 @@ public class CustomerExcelExportListener {
@EventListener
(
CustomerExcelExportPushEvent
.
class
)
public
void
customerExcelExportPushEvent
(
CustomerExcelExportPushEvent
event
)
{
CustomerExportReq
VO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqV
O
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
getCustomerExcelVoList
(
exportReqVO
);
CustomerExportReq
DTO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqDT
O
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
get
My
CustomerExcelVoList
(
exportReqVO
);
makeExcelUpload
(
event
,
list
);
}
...
...
@@ -108,8 +109,11 @@ public class CustomerExcelExportListener {
*/
@EventListener
(
CustomerWaitDistributionExcelExportPushEvent
.
class
)
public
void
customerWaitDistributionExcelExportPushEvent
(
CustomerWaitDistributionExcelExportPushEvent
event
)
{
CustomerExportReqVO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqVO
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
getWaitToAssignedCustomerExcelVoList
(
exportReqVO
);
CustomerExportReqDTO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqDTO
.
class
);
exportReqVO
.
setIsInOpenSea
(
false
)
;
exportReqVO
.
setIsCustomerServiceConfirmed
(
false
)
;
exportReqVO
.
setCustomerService
(
null
)
;
List
<
CustomerDO
>
list
=
customerService
.
getWaitToAssignedCustomerExcelVoListReq
(
exportReqVO
);
makeExcelUpload
(
event
,
list
);
}
...
...
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