Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
draw
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
draw
draw
Commits
c6f18e20
Commit
c6f18e20
authored
Jul 03, 2021
by
心月梦天
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本更新 更改抽奖配置和代码优化
parent
80816339
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
DrawManagerImpl.java
src/main/java/com/miya/draw/manager/DrawManagerImpl.java
+5
-2
No files found.
src/main/java/com/miya/draw/manager/DrawManagerImpl.java
View file @
c6f18e20
...
...
@@ -82,7 +82,7 @@ public class DrawManagerImpl implements IDrawManager {
}
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
start
=
LocalDateTimeUtil
.
beginOfDay
(
nowTime
);
LocalDateTime
start
=
nowTime
.
minusDays
(
3
);
LocalDateTime
end
=
LocalDateTimeUtil
.
endOfDay
(
nowTime
);
Integer
maxDrawCountLimit
=
businessConfig
.
getDrawMaxCount
();
Integer
alreadyDrawCount
=
accountPrizeService
.
gainAlreadyDrawCount
(
request
.
getPhone
(),
start
,
end
);
...
...
@@ -158,7 +158,7 @@ public class DrawManagerImpl implements IDrawManager {
lock
.
tryLock
(
5
,
10
,
TimeUnit
.
SECONDS
);
// 1 验证是否可以抽奖
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
start
=
LocalDateTime
.
now
()
.
minusDays
(
3
);
LocalDateTime
start
=
nowTime
.
minusDays
(
3
);
LocalDateTime
end
=
LocalDateTimeUtil
.
endOfDay
(
nowTime
);
List
<
SyncTrade
>
buyGoodList
=
syncTradeService
.
listCanDrawGoods
(
phone
,
start
,
end
,
activityStoreService
.
listAllActivityStoreId
(),
activityGoodsService
.
listAllActivityGoods
());
BigDecimal
buyTotal
=
gainBuyTotal
(
buyGoodList
);
...
...
@@ -174,6 +174,9 @@ public class DrawManagerImpl implements IDrawManager {
if
(
drawCountTotal
-
alreadyDrawCount
>
0
)
{
// 获得奖品
List
<
Prize
>
prizeList
=
prizeService
.
listAllPrizes
();
if
(
CollectionUtils
.
isEmpty
(
prizeList
))
{
throw
new
BusinessException
(
ErrorEnum
.
DRAW_CHECK_EXP
,
"活动已结束!"
);
}
// 抽奖
prize
=
selectCoupon
(
prizeList
);
// 乐观锁效验抽到的奖品它合不合规
...
...
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