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
975ae813
Commit
975ae813
authored
Aug 26, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单无收货人时的业务逻辑兼容性调整
parent
228c72ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
OrderBusinessServiceImpl.java
...le/order/service/order/impl/OrderBusinessServiceImpl.java
+24
-24
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
View file @
975ae813
...
...
@@ -470,9 +470,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 插入订单商品项
this
.
costCalculation
(
updater
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
type
);
}
...
...
@@ -513,9 +513,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 插入订单商品项
this
.
costCalculation
(
updater
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
type
);
}
...
...
@@ -568,8 +568,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
String
updater
=
String
.
valueOf
(
loginUser
!=
null
?
loginUser
.
getId
()
:
null
);
// 插入订单商品项
this
.
costCalculation
(
updater
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
type
);
this
.
costCalculation
(
updater
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
type
);
// orderMapper.updateById(orderDO);
}
...
...
@@ -827,9 +827,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 批量加价计价调整
this
.
costCalculation
(
updater
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
14
);
// 添加出货批量加价日志
...
...
@@ -862,9 +862,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
this
.
costCalculation
(
"0"
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
30
);
this
.
addOrderOperateLog
(
orderDO
.
getOrderId
(),
...
...
@@ -1865,8 +1865,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
OrderConsignorDO
orderConsignorDO
=
orderConsignorService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsignorDO
>().
eq
(
OrderConsignorDO:
:
getOrderId
,
orderDO
.
getOrderId
()).
orderByDesc
(
OrderConsignorDO:
:
getId
).
last
(
"limit 1"
));
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsigneeDO
>().
eq
(
OrderConsigneeDO:
:
getOrderId
,
orderDO
.
getOrderId
()).
orderByDesc
(
OrderConsigneeDO:
:
getId
).
last
(
"limit 1"
));
List
<
OrderItemDO
>
orderItemDOList
=
orderItemMapper
.
selectList
(
new
LambdaQueryWrapper
<
OrderItemDO
>().
eq
(
OrderItemDO:
:
getOrderId
,
orderDO
.
getOrderId
()));
this
.
costCalculation
(
userId
.
toString
(),
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
isResetPrice
?
20
:
8
);
this
.
costCalculation
(
userId
.
toString
(),
orderDO
,
orderConsignorDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
isResetPrice
?
20
:
8
);
// TODO 此处是否需要更新操作日志
}
// }
...
...
@@ -1974,8 +1974,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
}
CustomerContactsDO
consigneeContactsDO
=
customerContactsService
.
getCustomerContacts
(
orderConsigneeDO
.
getCustomerContactsId
());
if
(
Objects
.
isNull
(
consigneeContactsDO
))
{
CustomerContactsDO
consigneeContactsDO
=
customerContactsService
.
getCustomerContacts
(
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerContactsId
());
if
(
Objects
.
isNull
(
consigneeContactsDO
)
&&
Objects
.
nonNull
(
orderConsigneeDO
)
)
{
CustomerContactsDO
newConsigneeContactsDO
=
customerContactsService
.
getUniqueOneAndValidate
(
orderConsigneeDO
.
getCountryCode
(),
orderConsigneeDO
.
getPhone
(),
null
);
if
(
Objects
.
nonNull
(
newConsigneeContactsDO
))
{
consigneeDO
=
customerService
.
getCustomer
(
newConsigneeContactsDO
.
getCustomerId
());
...
...
@@ -2000,7 +2000,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
log
.
error
(
msg
);
}
}
else
{
if
(!
StringUtils
.
equals
(
consigneeContactsDO
.
getPhoneNew
(),
orderConsigneeDO
.
getPhone
()))
{
if
(
Objects
.
nonNull
(
orderConsigneeDO
)
&&
!
StringUtils
.
equals
(
consigneeContactsDO
.
getPhoneNew
(),
orderConsigneeDO
.
getPhone
()))
{
CustomerContactsDO
newConsigneeContactsDO
=
customerContactsService
.
getUniqueOneAndValidate
(
orderConsigneeDO
.
getCountryCode
(),
orderConsigneeDO
.
getPhone
(),
null
);
if
(
Objects
.
nonNull
(
newConsigneeContactsDO
))
{
consigneeDO
=
customerService
.
getCustomer
(
newConsigneeContactsDO
.
getCustomerId
());
...
...
@@ -2025,10 +2025,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
log
.
error
(
msg
);
}
}
else
{
if
(!
Objects
.
equals
(
consigneeContactsDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
()))
{
if
(
Objects
.
isNull
(
orderConsigneeDO
)
||
!
Objects
.
equals
(
consigneeContactsDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
()))
{
consigneeDO
=
customerService
.
getCustomer
(
consigneeContactsDO
.
getCustomerId
());
log
.
info
(
"订单【{}】,更新收货人客户id-[{}]->[{}]"
,
orderDO
.
getOrderNo
(),
orderConsigneeDO
.
getCustomerId
(),
consigneeContactsDO
.
getCustomerId
());
orderDO
.
getOrderNo
(),
Objects
.
isNull
(
orderConsigneeDO
)
?
0L
:
orderConsigneeDO
.
getCustomerId
(),
consigneeContactsDO
.
getCustomerId
());
if
(
Objects
.
nonNull
(
consigneeDO
))
{
orderConsigneeDO
.
setCompany
(
consigneeDO
.
getCompany
());
CountryDO
consigneeCountryDO
=
countryService
.
getById
(
consigneeDO
.
getCountry
());
...
...
@@ -2084,7 +2084,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
if
(
Objects
.
isNull
(
consignorDO
))
{
//发货人客户
consignorDO
=
customerService
.
getCustomer
(
orderConsignorDO
.
getCustomerId
());
}
if
(
Objects
.
isNull
(
consigneeDO
))
{
if
(
Objects
.
isNull
(
consigneeDO
)
&&
Objects
.
nonNull
(
orderConsigneeDO
)
)
{
consigneeDO
=
customerService
.
getCustomer
(
orderConsigneeDO
.
getCustomerId
());
//收货人客户
}
// 原客户经理
...
...
@@ -2104,7 +2104,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
{
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setCustomerId
(
Objects
.
nonNull
(
orderConsigneeDO
)
&&
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
customerType
=
2
;
}
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
...
...
@@ -2136,13 +2136,13 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
}
else
{
//去掉层级5、6 ,以上不符合的都归收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setCustomerId
(
Objects
.
nonNull
(
orderConsigneeDO
)
&&
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
customerType
=
2
;
}
}
}
else
{
//业绩归收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setCustomerId
(
Objects
.
nonNull
(
orderConsigneeDO
)
&&
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
customerType
=
2
;
}
}
...
...
@@ -2167,7 +2167,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
CustomerZhongPaoQueryVO
customerZhongPaoQueryVO
=
new
CustomerZhongPaoQueryVO
();
customerZhongPaoQueryVO
.
setConsignorId
(
orderConsignorDO
.
getCustomerId
());
customerZhongPaoQueryVO
.
setConsigneeId
(
orderConsigneeDO
.
getCustomerId
()
);
customerZhongPaoQueryVO
.
setConsigneeId
(
Objects
.
nonNull
(
orderConsigneeDO
)
?
orderConsigneeDO
.
getCustomerId
()
:
0L
);
customerZhongPaoQueryVO
.
setDepartureId
(
logisticsInfoDto
.
getStartCityId
());
customerZhongPaoQueryVO
.
setObjectiveId
(
logisticsInfoDto
.
getDestCityId
());
customerZhongPaoQueryVO
.
setStartWarehouseId
(
logisticsInfoDto
.
getStartWarehouseId
());
...
...
@@ -2291,9 +2291,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsigneeDO
>().
eq
(
OrderConsigneeDO:
:
getOrderId
,
orderDO
.
getOrderId
()).
orderByDesc
(
OrderConsigneeDO:
:
getId
).
last
(
"limit 1"
));
this
.
costCalculation
(
userId
,
orderDO
,
orderConsignorDO
.
getCustomerId
(),
orderConsigneeDO
.
getCustomerId
(),
Objects
.
isNull
(
orderConsigneeDO
)?
0L
:
orderConsigneeDO
.
getCustomerId
(),
orderConsignorDO
.
getCustomerContactsId
(),
orderConsigneeDO
.
getCustomerContactsId
(),
Objects
.
isNull
(
orderConsigneeDO
)?
0L
:
orderConsigneeDO
.
getCustomerContactsId
(),
orderItemDOList
,
50
);
this
.
addOrderOperateLog
(
orderDO
.
getOrderId
(),
"有活动更新订单计价"
,
null
);
...
...
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