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
725c41cd
Commit
725c41cd
authored
Nov 16, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验劵一个劵码只能一个人用
parent
6ecd89ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+11
-8
No files found.
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
725c41cd
...
...
@@ -72,14 +72,17 @@ public class QPServiceImpl implements QPService {
LambdaQueryWrapper
<
SConsumerCoupon
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SConsumerCoupon:
:
getDealId
,
prepare
.
getDeal_id
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
);
queryWrapper
.
eq
(
SConsumerCoupon:
:
getConsumerId
,
user
.
getId
());
SConsumerCoupon
one
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
//判断是否领取过
if
(
ObjectUtils
.
isNotEmpty
(
one
))
{
//领取删除原来的
isConsumerCouponService
.
deleteSConsumerCouponById
(
one
.
getId
());
//删除redis
redisUtil
.
delete
(
ReceiptRdeisEnum
.
PREPARE
.
getValue
()
+
prepare
.
getReceipt_code
());
SConsumerCoupon
two
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
if
(
ObjectUtils
.
isNotEmpty
(
two
))
{
//判断是否本人领取过
if
(!
two
.
getConsumerId
().
equals
(
user
.
getId
()))
{
throw
new
RuntimeException
(
"该券码已被领取"
);
}
else
{
//领取删除原来的
isConsumerCouponService
.
deleteSConsumerCouponById
(
two
.
getId
());
//删除redis
redisUtil
.
delete
(
ReceiptRdeisEnum
.
PREPARE
.
getValue
()
+
prepare
.
getReceipt_code
());
}
}
//根据优惠卷名称查询优惠劵配置
SCoupon
sCoupon
=
isCouponService
.
selectSCouponByName
(
prepare
.
getDeal_title
());
...
...
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