记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
董敬伟
liquidnet-bus-v1
Commits
05acfaad
Commit
05acfaad
authored
Jul 17, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
order:优惠金额计算
parent
5ff77e13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+17
-8
No files found.
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
05acfaad
...
...
@@ -533,20 +533,26 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
boolean
isGroupBuy
=
groupBuyOrderHelper
.
isGroupBuyOrder
(
payOrderParam
);
BigDecimal
groupUnitPrice
=
groupBuyOrderHelper
.
resolveUnitPrice
(
payOrderParam
,
ticketData
.
getPrice
());
BigDecimal
expressAmount
=
payOrderParam
.
getIsExpress
()
==
1
?
priceExpress
:
BigDecimal
.
valueOf
(
0
);
if
(
isGroupBuy
)
{
if
(
groupUnitPrice
==
null
)
{
throw
new
Exception
(
"拼团价计算失败"
);
}
orderTickets
.
setPriceTotal
(
groupUnitPrice
.
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
()))
.
add
(
payOrderParam
.
getIsExpress
()
==
1
?
priceExpress
:
BigDecimal
.
valueOf
(
0
)));
// 拼团单:应付=原价×数量;实付=拼团价×数量(直接算);优惠=应付-实付
BigDecimal
originalTotal
=
ticketData
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
())).
add
(
expressAmount
);
BigDecimal
groupActual
=
groupUnitPrice
.
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
())).
add
(
expressAmount
);
orderTickets
.
setPriceTotal
(
originalTotal
);
orderTickets
.
setPriceActual
(
groupActual
);
orderTickets
.
setPriceVoucher
(
originalTotal
.
subtract
(
groupActual
).
max
(
BigDecimal
.
ZERO
));
}
else
if
(
isMember
)
{
orderTickets
.
setPriceTotal
(
ticketData
.
getMemberPrice
().
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
())).
add
(
payOrderParam
.
getIsExpress
()
==
1
?
priceExpress
:
BigDecimal
.
valueOf
(
0
)));
orderTickets
.
setPriceTotal
(
ticketData
.
getMemberPrice
().
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
())).
add
(
expressAmount
));
orderTickets
.
setPriceVoucher
(
BigDecimal
.
ZERO
);
}
else
{
orderTickets
.
setPriceTotal
(
ticketData
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
())).
add
(
payOrderParam
.
getIsExpress
()
==
1
?
priceExpress
:
BigDecimal
.
valueOf
(
0
)));
orderTickets
.
setPriceTotal
(
ticketData
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
payOrderParam
.
getNumber
())).
add
(
expressAmount
));
orderTickets
.
setPriceVoucher
(
BigDecimal
.
ZERO
);
}
orderTickets
.
setPriceVoucher
(
BigDecimal
.
ZERO
);
//券的使用逻辑(拼团禁券)
//券的使用逻辑(拼团禁券,价格已在上方直接赋值)
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_coupon.add"
));
LinkedList
<
Object
[]>
sqlsDataE
=
ObjectUtil
.
cloneLinkedListObj
();
ArrayList
<
KylinOrderCoupons
>
couponsList
=
new
ArrayList
();
...
...
@@ -591,8 +597,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
dataUtils
.
setOrderCoupon
(
orderTicketId
,
couponsList
);
}
BigDecimal
finalPrice
=
orderTickets
.
getPriceTotal
().
subtract
(
orderTickets
.
getPriceVoucher
());
orderTickets
.
setPriceActual
(
finalPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
?
BigDecimal
.
ZERO
:
finalPrice
);
// 普通单:实付=应付-优惠;拼团单实付已在上方直接赋值,不再重算
if
(!
isGroupBuy
)
{
BigDecimal
finalPrice
=
orderTickets
.
getPriceTotal
().
subtract
(
orderTickets
.
getPriceVoucher
());
orderTickets
.
setPriceActual
(
finalPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
?
BigDecimal
.
ZERO
:
finalPrice
);
}
orderTickets
.
setPriceExpress
(
priceExpress
);
orderTickets
.
setPriceRefund
(
BigDecimal
.
valueOf
(
0.0
));
orderTickets
.
setRefundNumber
(
0
);
...
...
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