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
fd125fae
Commit
fd125fae
authored
Apr 24, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改可用优惠券顺序
parent
d2ba1ef1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+11
-4
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+2
-2
RoomLabelMapper.xml
...stem/src/main/resources/mapper/system/RoomLabelMapper.xml
+1
-1
No files found.
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
fd125fae
...
...
@@ -193,12 +193,19 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
@Override
public
List
<
SConsumerCouponVo
>
availableCouponList
(
CouponRequest
couponRequest
)
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sConsumerCoupon
.
setUseStatus
(
ConsumerCouponUseStatusEnum
.
WAIT_USE
.
getCode
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
LambdaQueryWrapper
<
SConsumerCoupon
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SConsumerCoupon:
:
getConsumerId
,
user
.
getId
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
ConsumerCouponUseStatusEnum
.
WAIT_USE
.
getCode
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
queryWrapper
.
ge
(
SConsumerCoupon:
:
getEndDate
,
new
Date
());
if
(
couponRequest
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
queryWrapper
.
orderByDesc
(
SConsumerCoupon:
:
getOrderType
);
}
queryWrapper
.
orderByAsc
(
SConsumerCoupon:
:
getEndDate
,
SConsumerCoupon:
:
getCouponType
);
queryWrapper
.
orderByDesc
(
SConsumerCoupon:
:
getSubPrice
);
//查询用户未使用的优惠券
List
<
SConsumerCoupon
>
sConsumerCoupons
=
baseMapper
.
querySConsumerCouponList
(
sConsumerCoupon
);
List
<
SConsumerCoupon
>
sConsumerCoupons
=
baseMapper
.
selectList
(
queryWrapper
);
//计算时长
BigDecimal
timeLong
=
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
());
if
(
CollectionUtils
.
isEmpty
(
sConsumerCoupons
))
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
fd125fae
...
...
@@ -1820,8 +1820,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
request
.
getRoomLabelId
());
//(促销价-优惠券促销价)+((时长-促销时长)*单价)
SRoom
room
=
roomService
.
getById
(
request
.
getRoomId
());
BigDecimal
subtract
=
roomLabel
.
getPromotionAmount
().
subtract
(
consumerCoupon
.
getPromotionPrice
(
)).
add
((
DateUtils
.
differentHour
(
request
.
getPreStartDate
(),
request
.
getPreEndDate
()).
subtract
(
new
BigDecimal
(
roomLabel
.
getPromotionDuration
()))).
multiply
(
room
.
getPrice
(
)));
BigDecimal
subtract
=
(
roomLabel
.
getPromotionAmount
().
subtract
(
consumerCoupon
.
getPromotionPrice
()
)).
add
((
(
DateUtils
.
differentHour
(
request
.
getPreStartDate
(),
request
.
getPreEndDate
()).
subtract
(
new
BigDecimal
(
roomLabel
.
getPromotionDuration
()))).
multiply
(
room
.
getPrice
()
)));
//判断是否为负数
if
(
subtract
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
...
...
share-system/src/main/resources/mapper/system/RoomLabelMapper.xml
View file @
fd125fae
...
...
@@ -119,7 +119,7 @@
<if
test=
"labelId != ''"
>
label_id = #{labelId},
</if>
<if
test=
"packId != ''"
>
pack_id = #{packId},
</if>
<if
test=
"promotionDuration != ''"
>
promotion_duration = #{promotionDuration},
</if>
<if
test=
"promotionAmount != ''"
>
promotion_amount = #{promotionAmount},
</if>
<if
test=
"promotionAmount != ''
or promotionAmount==0
"
>
promotion_amount = #{promotionAmount},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
...
...
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