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
014d8b01
Commit
014d8b01
authored
May 17, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改最优优惠券排序
parent
f04ca35d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+10
-3
No files found.
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
014d8b01
...
@@ -220,13 +220,15 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -220,13 +220,15 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
BigDecimal
totalPrice
=
timeLong
.
multiply
(
room
.
getPrice
());
BigDecimal
totalPrice
=
timeLong
.
multiply
(
room
.
getPrice
());
BigDecimal
payPrice
=
new
BigDecimal
(
0
);
BigDecimal
payPrice
=
new
BigDecimal
(
0
);
RoomLabel
roomLabel
;
RoomLabel
roomLabel
;
SPack
byId
;
if
(!
ObjectUtils
.
isEmpty
(
couponRequest
.
getRoomLabelId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
couponRequest
.
getRoomLabelId
()))
{
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
couponRequest
.
getRoomLabelId
());
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
couponRequest
.
getRoomLabelId
());
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
byId
=
null
;
payPrice
=
totalPrice
;
payPrice
=
totalPrice
;
couponRequest
.
setOrderMode
(
BuyTypeEnum
.
TIME
.
getCode
());
couponRequest
.
setOrderMode
(
BuyTypeEnum
.
TIME
.
getCode
());
}
else
{
}
else
{
SPack
byId
=
packService
.
getById
(
roomLabel
.
getPackId
());
byId
=
packService
.
getById
(
roomLabel
.
getPackId
());
if
(!
ObjectUtils
.
isEmpty
(
byId
)
&&
byId
.
getIsOpen
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
if
(!
ObjectUtils
.
isEmpty
(
byId
)
&&
byId
.
getIsOpen
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
payPrice
=
computeTotalPrice
(
roomLabel
.
getPackId
(),
totalPrice
);
payPrice
=
computeTotalPrice
(
roomLabel
.
getPackId
(),
totalPrice
);
couponRequest
.
setPackageId
(
roomLabel
.
getPackId
());
couponRequest
.
setPackageId
(
roomLabel
.
getPackId
());
...
@@ -238,6 +240,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -238,6 +240,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
}
}
}
}
}
else
{
}
else
{
byId
=
null
;
roomLabel
=
null
;
roomLabel
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
couponRequest
.
getPackageId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
couponRequest
.
getPackageId
()))
{
payPrice
=
computeTotalPrice
(
couponRequest
.
getPackageId
(),
totalPrice
);
payPrice
=
computeTotalPrice
(
couponRequest
.
getPackageId
(),
totalPrice
);
...
@@ -268,8 +271,12 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -268,8 +271,12 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
}
}
//取绝对值
//取绝对值
if
(
vo
.
getIsAvailable
().
equals
(
AvailableEnum
.
AVAILABLE
.
getCode
()))
{
if
(
vo
.
getIsAvailable
().
equals
(
AvailableEnum
.
AVAILABLE
.
getCode
()))
{
vo
.
setBalance
((
roomLabel
.
getPromotionAmount
().
subtract
(
vo
.
getSalePrice
())).
if
(!
ObjectUtils
.
isEmpty
(
roomLabel
))
{
add
(((
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
()).
subtract
(
new
BigDecimal
(
roomLabel
.
getPromotionDuration
()))).
multiply
(
room
.
getPrice
()))).
abs
());
vo
.
setBalance
((
roomLabel
.
getPromotionAmount
().
subtract
(
vo
.
getSalePrice
())).
add
(((
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
()).
subtract
(
new
BigDecimal
(
roomLabel
.
getPromotionDuration
()))).
multiply
(
room
.
getPrice
()))).
abs
());
}
else
if
(!
ObjectUtils
.
isEmpty
(
byId
))
{
vo
.
setBalance
(
byId
.
getPrice
().
subtract
(
vo
.
getSalePrice
()));
}
}
else
{
}
else
{
vo
.
setBalance
(
new
BigDecimal
(
"999"
));
vo
.
setBalance
(
new
BigDecimal
(
"999"
));
}
}
...
...
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