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
ef761031
Commit
ef761031
authored
Aug 01, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-fix' into dev
parents
6ec72d2c
22b65ba4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
148 deletions
+12
-148
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+12
-148
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
ef761031
...
@@ -1186,30 +1186,30 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -1186,30 +1186,30 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
}
else
{
if
(
consignorDO
!=
null
&&
!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if
(
consignorDO
!=
null
&&
!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
}
else
{
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
&&
offerId
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
if
(
order
.
getDrawee
()
==
1
&&
offerId
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
consignorDO
.
getCustomerService
(
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
}
else
{
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
customerType
=
2
;
customerType
=
2
;
}
}
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
...
@@ -1217,7 +1217,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -1217,7 +1217,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
}
else
{
}
else
{
//没有收货人
//没有收货人
order
.
setCustomerId
(
0L
);
order
.
setCustomerId
(
0L
);
...
@@ -1236,29 +1236,29 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -1236,29 +1236,29 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
consignorDO
.
getCustomerService
(
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
offerId
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
}
else
if
(
offerId
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
consignorDO
.
getCustomerService
(
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
consignorDO
.
getCustomerService
(
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
consignorDO
.
getCustomerService
(
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
}
else
{
//去掉层级5、6 ,以上不符合的都归收货人
//去掉层级5、6 ,以上不符合的都归收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
customerType
=
2
;
customerType
=
2
;
}
}
}
}
...
@@ -1267,7 +1267,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -1267,7 +1267,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
customerType
=
2
;
customerType
=
2
;
}
}
}
}
...
@@ -1478,142 +1478,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -1478,142 +1478,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
}
}
private
void
setAddOrderCustomerServiceCustomerId
(
OrderCreateReqVO
createReqVO
,
OrderDO
order
,
CustomerDO
consignorDO
,
CustomerDO
consigneeDO
,
OrderConsignorDO
orderConsignorDO
,
OrderConsigneeDO
orderConsigneeDO
)
{
// 补充业绩规则判断
if
(
Objects
.
nonNull
(
order
.
getType
())
&&
order
.
getType
().
contains
(
"2"
))
{
//如果是海外仓
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
{
if
(!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
&&
createReqVO
.
getOfferId
()
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
}
else
if
(
order
.
getDrawee
()
==
2
&&
createReqVO
.
getOfferId
()
==
null
&&
!
consignorDO
.
getDefaultPay
())
{
//收货人付款 层级5 第一个
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
);
}
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
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
createReqVO
.
getOfferId
()
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(!
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
2
)
||
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
2
))
{
//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
);
}
}
}
else
{
//业绩归属公司
order
.
setSalesmanId
(
0L
);
}
}
}
private
void
setUpdateOrderCustomerServiceCustomerId
(
OrderUpdateReqVO
createReqVO
,
OrderDO
order
,
CustomerDO
consignorDO
,
CustomerDO
consigneeDO
,
OrderConsignorDO
orderConsignorDO
,
OrderConsigneeDO
orderConsigneeDO
)
{
// 补充业绩规则判断
if
(
Objects
.
nonNull
(
order
.
getType
())
&&
order
.
getType
().
contains
(
"2"
))
{
//如果是海外仓
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
{
if
(!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
&&
createReqVO
.
getOfferId
()
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
{
//业绩归收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
);
}
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
);
}
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
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
createReqVO
.
getOfferId
()
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setSalesmanId
(
consignorDO
.
getCustomerService
()
!=
null
?
consignorDO
.
getCustomerService
()
:
0
);
}
else
{
//去掉层级5、6 ,如果都不符合条件,归属收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setSalesmanId
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
);
}
// if(!consignorDO.getDefaultPay() && (order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
// order.setCustomerId(orderConsigneeDO.getCustomerId());
// order.setSalesmanId(consigneeDO.getCustomerService()!=null?consigneeDO.getCustomerService():0);
// }
}
}
else
{
//业绩归属收获人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setSalesmanId
(
consigneeDO
.
getCustomerService
()
!=
null
?
consigneeDO
.
getCustomerService
()
:
0
);
}
}
}
private
void
compareOrderCustomerService
(
OrderBackVO
vo
,
List
<
ApplyInfoVO
>
applyInfoList
,
int
customerType
)
{
private
void
compareOrderCustomerService
(
OrderBackVO
vo
,
List
<
ApplyInfoVO
>
applyInfoList
,
int
customerType
)
{
// TODO 判断该订单、该客户是否有未分配客户异常,如果有,则这个订单不计算业绩
// TODO 判断该订单、该客户是否有未分配客户异常,如果有,则这个订单不计算业绩
List
<
OrderExceptionDO
>
orderExceptionDOList
=
orderExceptionService
.
getOrderExceptionByCustomerId
(
vo
.
getCustomerId
());
List
<
OrderExceptionDO
>
orderExceptionDOList
=
orderExceptionService
.
getOrderExceptionByCustomerId
(
vo
.
getCustomerId
());
...
...
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