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
c718e3d1
Commit
c718e3d1
authored
May 23, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充业绩规则判断
parent
a8ce13fc
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
206 additions
and
69 deletions
+206
-69
TargetLogMapper.java
...dao/module/order/dal/mysql/targetLog/TargetLogMapper.java
+7
-0
OrderBackInfoDto.java
...a/cn/iocoder/yudao/module/order/dto/OrderBackInfoDto.java
+3
-0
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+109
-66
TargetLogServiceImpl.java
.../module/order/service/targetLog/TargetLogServiceImpl.java
+74
-3
TargetOfferBackVO.java
...er/yudao/module/order/vo/targetLog/TargetOfferBackVO.java
+13
-0
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/mysql/targetLog/TargetLogMapper.java
View file @
c718e3d1
...
...
@@ -62,4 +62,11 @@ public interface TargetLogMapper extends AbstractMapper<TargetLogDO> {
"</script>"
})
Date
selectCabinetLoadTime
(
@Param
(
"orderId"
)
Long
orderId
);
@Select
({
"<script>"
,
"select offer_id as offerId, order_id as orderId,order_no as orderNo from ecw_offer offe where deleted=0 and order_id=#{orderId} limit 1"
,
"</script>"
})
List
<
TargetOfferBackVO
>
getTargetOfferBackByOrerId
(
Long
orderId
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dto/OrderBackInfoDto.java
View file @
c718e3d1
...
...
@@ -524,6 +524,9 @@ public class OrderBackInfoDto {
@ApiModelProperty
(
value
=
"完成入仓的所有箱内总货物数量"
)
private
Integer
sumQuantityAllFinishedWarehouseIn
;
@ApiModelProperty
(
value
=
"是否有收货人,1-是,0-否"
)
private
Boolean
hasConsignee
=
true
;
public
void
setExceptionReason
(
String
exceptionReason
)
{
this
.
exceptionReason
=
exceptionReason
;
if
(
StringUtils
.
isNotBlank
(
exceptionReason
)
&&
Objects
.
nonNull
(
this
.
lang
))
{
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
c718e3d1
This diff is collapsed.
Click to expand it.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/targetLog/TargetLogServiceImpl.java
View file @
c718e3d1
package
cn
.
iocoder
.
yudao
.
module
.
order
.
service
.
targetLog
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO
;
import
cn.iocoder.yudao.module.order.dto.OrderBackInfoDto
;
import
cn.iocoder.yudao.module.order.service.order.OrderConsigneeService
;
import
cn.iocoder.yudao.module.order.service.order.OrderConsignorService
;
import
cn.iocoder.yudao.module.order.service.order.OrderQueryService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
cn.iocoder.yudao.module.order.enums.TargetLogEnum
;
import
cn.iocoder.yudao.module.order.vo.order.CustomDraweeVO
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -45,6 +55,12 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
@Resource
private
CustomerService
customerService
;
@Resource
private
OrderConsigneeService
orderConsigneeService
;
@Resource
private
OrderConsignorService
orderConsignorService
;
@Override
public
Long
createTargetLog
(
TargetLogCreateReqVO
createReqVO
)
{
...
...
@@ -156,10 +172,65 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
if
(
info
.
getIsCargoControl
())
{
//非海外控货归属发货人
customerId
=
info
.
getConsignorVO
().
getCustomerId
();
}
else
{
if
(
info
.
getDrawee
()
==
1
)
{
//非海外非控货 付款人为发货人 归属发货人
customerId
=
info
.
getConsignorVO
().
getCustomerId
();
}
else
{
//非海外非控货 付款人为其他 归属收货人
// if (info.getDrawee() == 1) {//非海外非控货 付款人为发货人 归属发货人
// customerId = info.getConsignorVO().getCustomerId();
// } else { //非海外非控货 付款人为其他 归属收货人
// customerId = info.getConsigneeVO().getCustomerId();
// }
CustomerDO
consignorDO
=
customerService
.
getCustomer
(
info
.
getConsignorVO
().
getCustomerId
());
CustomerDO
consigneeDO
=
customerService
.
getCustomer
(
info
.
getConsigneeVO
().
getCustomerId
());
//收货人
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsigneeDO
>().
eq
(
OrderConsigneeDO:
:
getOrderId
,
info
.
getOrderId
()).
orderByDesc
(
OrderConsigneeDO:
:
getId
).
last
(
"limit 1"
));
OrderConsignorDO
orderConsignorDO
=
orderConsignorService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsignorDO
>().
eq
(
OrderConsignorDO:
:
getOrderId
,
info
.
getOrderId
()).
orderByDesc
(
OrderConsignorDO:
:
getId
).
last
(
"limit 1"
));
if
(!
consignorDO
.
getNoConsignee
()
&&
!
info
.
getHasConsignee
()){
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if
(
consignorDO
!=
null
){
customerId
=
consignorDO
.
getId
();
}
}
List
<
TargetOfferBackVO
>
offerBackVOList
=
targetLogMapper
.
getTargetOfferBackByOrerId
(
orderId
)
;
if
(
info
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
info
.
getDrawee
()
==
1
&&
CollectionUtil
.
isNotEmpty
(
offerBackVOList
))
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
customerId
=
orderConsignorDO
.
getCustomerId
();
}
else
if
(
info
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
()
){
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
customerId
=
orderConsignorDO
.
getCustomerId
()
;
}
}
else
if
(
info
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
customerId
=
orderConsigneeDO
.
getCustomerId
()!=
null
?
orderConsigneeDO
.
getCustomerId
():
consigneeDO
.
getId
();
}
else
if
(
info
.
getDrawee
()
==
3
)
{
//自定义付款
List
<
CustomDraweeVO
>
list
=
JSONObject
.
parseArray
(
info
.
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
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
)
&&
(
info
.
getDrawee
()==
3
&&
freight
==
1
)){
//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
customerId
=
orderConsignorDO
.
getCustomerId
()
;
}
else
if
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
)
&&
(
info
.
getDrawee
()==
3
&&
clearanceFee
==
1
)){
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
customerId
=
orderConsignorDO
.
getCustomerId
()
;
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()==
3
&&
freight
==
1
)){
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
customerId
=
orderConsignorDO
.
getCustomerId
()
;
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()==
3
&&
clearanceFee
==
1
)){
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
customerId
=
orderConsignorDO
.
getCustomerId
()
;
}
else
if
(!
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()==
3
&&
freight
==
2
)
||
(
info
.
getDrawee
()==
3
&&
clearanceFee
==
2
)){
//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
customerId
=
orderConsigneeDO
.
getCustomerId
()
;
}
}
}
else
{
//业绩归属公司
customerId
=
info
.
getConsigneeVO
().
getCustomerId
();
}
}
}
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/targetLog/TargetOfferBackVO.java
0 → 100644
View file @
c718e3d1
package
cn
.
iocoder
.
yudao
.
module
.
order
.
vo
.
targetLog
;
import
lombok.Data
;
@Data
public
class
TargetOfferBackVO
{
private
Long
offerId
;
private
Long
orderId
;
private
String
orderNo
;
}
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