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
7d0976b0
Commit
7d0976b0
authored
Apr 30, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改可以优惠券查询
parent
70868f48
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
CouponRequest.java
...tem/src/main/java/share/system/request/CouponRequest.java
+3
-4
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+18
-2
No files found.
share-system/src/main/java/share/system/request/CouponRequest.java
View file @
7d0976b0
...
...
@@ -6,10 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
share.common.annotation.Excel
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
...
...
@@ -27,7 +24,6 @@ public class CouponRequest {
private
Long
roomId
;
@ApiModelProperty
(
value
=
"下单模式(1:小时模式,2:套餐模式)"
,
required
=
true
)
@NotNull
(
message
=
"下单模式不能为空"
)
private
Integer
orderMode
;
@ApiModelProperty
(
value
=
"下单类型(1:预定,2:续单)"
,
required
=
true
)
...
...
@@ -37,6 +33,9 @@ public class CouponRequest {
@ApiModelProperty
(
value
=
"套餐ID"
)
private
Long
packageId
;
@ApiModelProperty
(
value
=
"标签id"
)
private
Long
roomLabelId
;
/**
* 预约开始时间
*/
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
7d0976b0
...
...
@@ -20,6 +20,7 @@ import share.system.mapper.SConsumerCouponMapper;
import
share.system.request.CouponRequest
;
import
share.system.service.*
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -48,6 +49,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
@Autowired
private
SConsumerService
sConsumerService
;
@Resource
private
RoomLabelService
roomLabelService
;
private
static
final
Integer
ZERO
=
0
;
...
...
@@ -206,11 +210,23 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
queryWrapper
.
orderByDesc
(
SConsumerCoupon:
:
getOriginalPrice
);
//查询用户未使用的优惠券
List
<
SConsumerCoupon
>
sConsumerCoupons
=
baseMapper
.
selectList
(
queryWrapper
);
//计算时长
BigDecimal
timeLong
=
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
());
if
(
CollectionUtils
.
isEmpty
(
sConsumerCoupons
))
{
return
new
ArrayList
<>();
}
//计算时长
BigDecimal
timeLong
=
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
());
if
(!
ObjectUtils
.
isEmpty
(
couponRequest
.
getRoomLabelId
()))
{
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
couponRequest
.
getRoomLabelId
());
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
couponRequest
.
setOrderMode
(
BuyTypeEnum
.
TIME
.
getCode
());
}
else
{
couponRequest
.
setOrderMode
(
BuyTypeEnum
.
PACK
.
getCode
());
}
}
else
if
(!
ObjectUtils
.
isEmpty
(
couponRequest
.
getPackageId
()))
{
couponRequest
.
setOrderMode
(
BuyTypeEnum
.
PACK
.
getCode
());
}
else
{
throw
new
RuntimeException
(
"参数异常"
);
}
List
<
SConsumerCouponVo
>
voList
=
new
ArrayList
<>();
//查询所有门店
List
<
SStore
>
sStores
=
sStoreService
.
list
();
...
...
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