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
07225660
Commit
07225660
authored
Nov 04, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改订单计算价格
parent
697eaeaa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
19 deletions
+52
-19
ConsumerMonthlyCardServiceImpl.java
...e/system/service/impl/ConsumerMonthlyCardServiceImpl.java
+4
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+48
-18
No files found.
share-system/src/main/java/share/system/service/impl/ConsumerMonthlyCardServiceImpl.java
View file @
07225660
...
@@ -37,6 +37,8 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
...
@@ -37,6 +37,8 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
@Autowired
@Autowired
private
RoomLabelService
roomLabelService
;
private
RoomLabelService
roomLabelService
;
@Autowired
@Autowired
private
LabelService
labelService
;
@Autowired
private
IPackService
packService
;
private
IPackService
packService
;
@Autowired
@Autowired
private
ISRoomService
roomService
;
private
ISRoomService
roomService
;
...
@@ -134,9 +136,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
...
@@ -134,9 +136,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
consumerSecondaryCard
=
consumerSecondaryCardService
.
list
(
new
LambdaQueryWrapper
<
ConsumerSecondaryCard
>().
eq
(
ConsumerSecondaryCard:
:
getConsumerId
,
user
.
getId
()).
orderByAsc
(
ConsumerSecondaryCard:
:
getNumber
));
consumerSecondaryCard
=
consumerSecondaryCardService
.
list
(
new
LambdaQueryWrapper
<
ConsumerSecondaryCard
>().
eq
(
ConsumerSecondaryCard:
:
getConsumerId
,
user
.
getId
()).
orderByAsc
(
ConsumerSecondaryCard:
:
getNumber
));
if
(!
ObjectUtils
.
isEmpty
(
monthlyCardRequest
.
getRoomLabelId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
monthlyCardRequest
.
getRoomLabelId
()))
{
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
monthlyCardRequest
.
getRoomLabelId
());
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
monthlyCardRequest
.
getRoomLabelId
());
Label
label
=
labelService
.
getById
(
roomLabel
.
getLabelId
());
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
//标签没绑定套餐
//标签没绑定套餐
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
)
&&
new
BigDecimal
(
label
.
getDuration
()).
compareTo
(
BigDecimal
.
ONE
)
>=
0
)
{
consumerMonthlyCardList
.
add
(
consumerMonthlyCard
.
getId
());
consumerMonthlyCardList
.
add
(
consumerMonthlyCard
.
getId
());
map
.
put
(
"consumerMonthlyCard"
,
consumerMonthlyCardList
);
map
.
put
(
"consumerMonthlyCard"
,
consumerMonthlyCardList
);
}
}
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
07225660
...
@@ -3155,34 +3155,64 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -3155,34 +3155,64 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
consumerMonthlyCard
.
getFreeDuration
().
compareTo
(
timeLong
)
>=
0
)
{
if
(
consumerMonthlyCard
.
getFreeDuration
().
compareTo
(
timeLong
)
>=
0
)
{
priceResponse
.
setDuration
(
timeLong
);
priceResponse
.
setDuration
(
timeLong
);
priceResponse
.
setRemainingDuration
(
consumerMonthlyCard
.
getFreeDuration
().
subtract
(
timeLong
));
priceResponse
.
setRemainingDuration
(
consumerMonthlyCard
.
getFreeDuration
().
subtract
(
timeLong
));
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
totalFee
=
new
BigDecimal
(
0
);
totalFee
=
new
BigDecimal
(
0
);
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
priceResponse
.
setMemberDiscount
(
new
BigDecimal
(
0.00
));
priceResponse
.
setMemberDiscount
(
new
BigDecimal
(
0.00
));
// priceResponse.setTotalFeeNow(priceResponse.getTotalFee());
priceResponse
.
setTotalFeeNow
(
priceResponse
.
getTotalFee
());
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
priceResponse
.
setMonthlyCardId
(
consumerMonthlyCard
.
getId
());
}
else
if
(
consumerMonthlyCard
.
getFreeDuration
().
compareTo
(
timeLong
)
<
0
)
{
}
else
if
(
consumerMonthlyCard
.
getFreeDuration
().
compareTo
(
timeLong
)
<
0
)
{
priceResponse
.
setDuration
(
consumerMonthlyCard
.
getFreeDuration
());
priceResponse
.
setDuration
(
consumerMonthlyCard
.
getFreeDuration
());
priceResponse
.
setRemainingDuration
(
new
BigDecimal
(
0
));
priceResponse
.
setRemainingDuration
(
new
BigDecimal
(
0
));
//时长的金额
BigDecimal
remainingBalance
=
consumerMonthlyCard
.
getFreeDuration
().
multiply
(
room
.
getPrice
());
BigDecimal
remainingBalance
=
consumerMonthlyCard
.
getFreeDuration
().
multiply
(
room
.
getPrice
());
//恢复原价
// totalFee = totalFee.divide(memberConfig.getDiscountRatio(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
//原价减时长
remainingBalance
=
totalFee
.
subtract
(
remainingBalance
);
remainingBalance
=
totalFee
.
subtract
(
remainingBalance
);
priceResponse
.
setTotalFeeNow
(
remainingBalance
);
BigDecimal
divide
=
remainingBalance
;
priceResponse
.
setMemberDiscount
(
totalFee
.
subtract
(
remainingBalance
));
divide
=
divide
.
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
totalFee
=
remainingBalance
.
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
priceResponse
.
setTotalFeeNow
(
divide
);
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
remainingBalance
.
subtract
(
divide
));
priceResponse
.
setPayFee
(
remainingBalance
);
if
(
consumerWallet
.
getBalance
().
compareTo
(
divide
)
>=
0
)
{
priceResponse
.
setMonthlyCardId
(
consumerMonthlyCard
.
getId
());
priceResponse
.
setBalance
(
divide
);
priceResponse
.
setMemberDiscount
(
remainingBalance
.
subtract
(
totalFee
));
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
divide
));
}
if
(
consumerWallet
.
getBalance
().
compareTo
(
priceResponse
.
getTotalFeeNow
())
>=
0
)
{
priceResponse
.
setBalance
(
priceResponse
.
getTotalFeeNow
());
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
priceResponse
.
getTotalFeeNow
()));
totalFee
=
new
BigDecimal
(
0
);
totalFee
=
new
BigDecimal
(
0
);
}
else
if
(
consumerWallet
.
getBalance
().
compareTo
(
priceResponse
.
getTotalFeeNow
()
)
<
0
)
{
}
else
if
(
consumerWallet
.
getBalance
().
compareTo
(
divide
)
<
0
)
{
priceResponse
.
setBalance
(
consumerWallet
.
getBalance
());
priceResponse
.
setBalance
(
consumerWallet
.
getBalance
());
priceResponse
.
setRemainingBalance
(
new
BigDecimal
(
0
));
priceResponse
.
setRemainingBalance
(
BigDecimal
.
ZERO
);
totalFee
=
priceResponse
.
getTotalFeeNow
().
subtract
(
consumerWallet
.
getBalance
());
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
;
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