Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
82b59943
Commit
82b59943
authored
Dec 08, 2020
by
chongfu.liang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/2.0.9-购物车检查券是否可用'
parents
30238d5b
88b0ef45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
+15
-2
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
View file @
82b59943
...
@@ -531,8 +531,10 @@ public class CheckOrder {
...
@@ -531,8 +531,10 @@ public class CheckOrder {
}
}
private
void
checkCouonRedeemTime
(
List
<
GetCouponDetailResponseDto
.
ActiveRedeemTimeInterval
>
activeRedeemTimeIntervalList
)
{
private
void
checkCouonRedeemTime
(
List
<
GetCouponDetailResponseDto
.
ActiveRedeemTimeInterval
>
activeRedeemTimeIntervalList
)
{
boolean
verificationPassed
=
false
;
if
(
CollectionUtils
.
isNotEmpty
(
activeRedeemTimeIntervalList
)){
if
(
CollectionUtils
.
isNotEmpty
(
activeRedeemTimeIntervalList
)){
for
(
GetCouponDetailResponseDto
.
ActiveRedeemTimeInterval
dateLimit
:
activeRedeemTimeIntervalList
){
for
(
GetCouponDetailResponseDto
.
ActiveRedeemTimeInterval
dateLimit
:
activeRedeemTimeIntervalList
){
boolean
dayCheck
=
true
;
String
weekday
=
dateLimit
.
getWeekday
();
// 日期限制 0011100 周日开始,0表示不可用
String
weekday
=
dateLimit
.
getWeekday
();
// 日期限制 0011100 周日开始,0表示不可用
if
(
StringUtils
.
isNotBlank
(
weekday
)){
// 存在校验周几
if
(
StringUtils
.
isNotBlank
(
weekday
)){
// 存在校验周几
char
[]
chars
=
weekday
.
toCharArray
();
char
[]
chars
=
weekday
.
toCharArray
();
...
@@ -541,9 +543,10 @@ public class CheckOrder {
...
@@ -541,9 +543,10 @@ public class CheckOrder {
dayOfWeek
=
0
;
dayOfWeek
=
0
;
}
}
if
(
Integer
.
parseInt
(
String
.
valueOf
(
chars
[
dayOfWeek
]))
==
0
){
//限制
if
(
Integer
.
parseInt
(
String
.
valueOf
(
chars
[
dayOfWeek
]))
==
0
){
//限制
throw
new
ServiceException
(
ResponseResult
.
COUPON_DATETIME_INVAILD
)
;
dayCheck
=
false
;
}
}
}
}
boolean
timeCheck
=
true
;
String
begintime
=
dateLimit
.
getBegintime
();
// 开始时间 00:00:00
String
begintime
=
dateLimit
.
getBegintime
();
// 开始时间 00:00:00
String
endtime
=
dateLimit
.
getEndtime
();
// 结束时间 12:59:59
String
endtime
=
dateLimit
.
getEndtime
();
// 结束时间 12:59:59
if
(
StringUtils
.
isNotBlank
(
begintime
)
&&
StringUtils
.
isNotBlank
(
endtime
)){
// 存在校验时段
if
(
StringUtils
.
isNotBlank
(
begintime
)
&&
StringUtils
.
isNotBlank
(
endtime
)){
// 存在校验时段
...
@@ -553,11 +556,21 @@ public class CheckOrder {
...
@@ -553,11 +556,21 @@ public class CheckOrder {
LocalTime
endLocalTime
=
LocalTime
.
of
(
Integer
.
valueOf
(
endTimeArr
[
0
]),
Integer
.
valueOf
(
endTimeArr
[
1
]),
Integer
.
valueOf
(
endTimeArr
[
2
]));
LocalTime
endLocalTime
=
LocalTime
.
of
(
Integer
.
valueOf
(
endTimeArr
[
0
]),
Integer
.
valueOf
(
endTimeArr
[
1
]),
Integer
.
valueOf
(
endTimeArr
[
2
]));
LocalTime
now
=
LocalTime
.
now
();
LocalTime
now
=
LocalTime
.
now
();
if
(
now
.
isBefore
(
beginLocalTime
)
||
now
.
isAfter
(
endLocalTime
)){
if
(
now
.
isBefore
(
beginLocalTime
)
||
now
.
isAfter
(
endLocalTime
)){
throw
new
ServiceException
(
ResponseResult
.
COUPON_DATETIME_INVAILD
);
timeCheck
=
false
;
}
}
if
(
dayCheck
&&
timeCheck
){
verificationPassed
=
true
;
break
;
}
}
}
}
}
else
{
verificationPassed
=
true
;
}
}
if
(!
verificationPassed
){
throw
new
ServiceException
(
ResponseResult
.
COUPON_DATETIME_INVAILD
);
}
}
}
}
/**
/**
...
...
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