Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
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
pseer
gxpt_ht
Commits
1002f040
Commit
1002f040
authored
Nov 04, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改订单计算价格
parent
07225660
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
31 deletions
+4
-31
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+4
-31
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
1002f040
...
...
@@ -3159,6 +3159,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
priceResponse
.
setMemberDiscount
(
new
BigDecimal
(
0.00
));
priceResponse
.
setTotalFeeNow
(
priceResponse
.
getTotalFee
());
priceResponse
.
setMonthlyCardId
(
consumerMonthlyCard
.
getId
());
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
}
else
if
(
consumerMonthlyCard
.
getFreeDuration
().
compareTo
(
timeLong
)
<
0
)
{
priceResponse
.
setDuration
(
consumerMonthlyCard
.
getFreeDuration
());
priceResponse
.
setRemainingDuration
(
new
BigDecimal
(
0
));
...
...
@@ -3171,6 +3173,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal
divide
=
remainingBalance
;
divide
=
divide
.
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
priceResponse
.
setTotalFeeNow
(
divide
);
priceResponse
.
setPayFee
(
remainingBalance
);
priceResponse
.
setMonthlyCardId
(
consumerMonthlyCard
.
getId
());
priceResponse
.
setMemberDiscount
(
remainingBalance
.
subtract
(
divide
));
if
(
consumerWallet
.
getBalance
().
compareTo
(
divide
)
>=
0
)
{
priceResponse
.
setBalance
(
divide
);
...
...
@@ -3182,37 +3186,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
totalFee
=
divide
.
subtract
(
consumerWallet
.
getBalance
());
}
}
// if (consumerMonthlyCard.getFreeDuration().compareTo(timeLong) >= 0) {
// priceResponse.setDuration(timeLong);
// priceResponse.setRemainingDuration(consumerMonthlyCard.getFreeDuration().subtract(timeLong));
// priceResponse.setDiscount(BigDecimal.ZERO);
// totalFee = new BigDecimal(0);
// priceResponse.setMemberDiscount(new BigDecimal(0.00));
//// priceResponse.setTotalFeeNow(priceResponse.getTotalFee());
// priceResponse.setPayFee(BigDecimal.ZERO);
// priceResponse.setMonthlyCardId(consumerMonthlyCard.getId());
// } else if (consumerMonthlyCard.getFreeDuration().compareTo(timeLong) < 0) {
// priceResponse.setDuration(consumerMonthlyCard.getFreeDuration());
// priceResponse.setRemainingDuration(new BigDecimal(0));
// BigDecimal remainingBalance = consumerMonthlyCard.getFreeDuration().multiply(room.getPrice());
// remainingBalance = totalFee.subtract(remainingBalance);
// priceResponse.setTotalFeeNow(remainingBalance);
// priceResponse.setMemberDiscount(totalFee.subtract(remainingBalance));
// totalFee = remainingBalance.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
// priceResponse.setTotalFeeNow(totalFee);
// priceResponse.setPayFee(remainingBalance);
// priceResponse.setMonthlyCardId(consumerMonthlyCard.getId());
// priceResponse.setMemberDiscount(remainingBalance.subtract(totalFee));
// }
// if (consumerWallet.getBalance().compareTo(BigDecimal.ZERO) > 0 && priceResponse.getTotalFeeNow().compareTo(BigDecimal.ZERO) > 0 &&consumerWallet.getBalance().compareTo(priceResponse.getTotalFeeNow()) >= 0) {
// priceResponse.setBalance(priceResponse.getTotalFeeNow());
// priceResponse.setRemainingBalance(consumerWallet.getBalance().subtract(priceResponse.getTotalFeeNow()));
// totalFee = new BigDecimal(0);
// } else if (consumerWallet.getBalance().compareTo(BigDecimal.ZERO) > 0 && priceResponse.getTotalFeeNow().compareTo(BigDecimal.ZERO) > 0 && consumerWallet.getBalance().compareTo(priceResponse.getTotalFeeNow()) < 0) {
// priceResponse.setBalance(consumerWallet.getBalance());
// priceResponse.setRemainingBalance(new BigDecimal(0));
// totalFee = priceResponse.getTotalFeeNow().subtract(consumerWallet.getBalance());
// }
return
totalFee
;
}
...
...
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