记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
94185669
Commit
94185669
authored
Sep 18, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
领取券+同步coupon_code逻辑;
parent
dbe0f00e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+10
-3
sqlmap.properties
...t-service-candy-impl/src/main/resources/sqlmap.properties
+1
-0
No files found.
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
94185669
...
@@ -386,6 +386,8 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -386,6 +386,8 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
@Override
@Override
public
ResponseDto
<
String
>
receiveCoupon
(
String
ccode
)
{
public
ResponseDto
<
String
>
receiveCoupon
(
String
ccode
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
mobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
...
@@ -404,11 +406,16 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -404,11 +406,16 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
//添加baseDto -> baseDtoList
//添加baseDto -> baseDtoList
redisDataUtils
.
addCouponByUid
(
uid
,
baseDto
);
redisDataUtils
.
addCouponByUid
(
uid
,
baseDto
);
//入库
//入库
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
objsUserCoupon
=
CollectionUtil
.
linkedListObjectArr
(),
objsCouponCode
=
CollectionUtil
.
linkedListObjectArr
();
toMqSqls
.
add
(
SqlMapping
.
get
(
"candy_coupon.receive"
));
objsUserCoupon
.
add
(
new
Object
[]{
uCouponId
,
uid
,
1
,
infoDto
.
getCouponId
(),
ccode
,
now
,
now
,
infoDto
.
getExpireAt
()});
toMqSqls
.
add
(
SqlMapping
.
get
(
"candy_coupon_code.receive"
));
objsCouponCode
.
add
(
new
Object
[]{
uid
,
mobile
,
now
,
now
,
dto
.
getCouponId
(),
ccode
});
queueUtils
.
sendMsgByRedis
(
queueUtils
.
sendMsgByRedis
(
MQConst
.
CandyQueue
.
COUPON_RECEIVE
.
getKey
(),
MQConst
.
CandyQueue
.
COUPON_RECEIVE
.
getKey
(),
SqlMapping
.
get
(
"candy_coupon.receive"
,
SqlMapping
.
gets
(
toMqSqls
,
objsUserCoupon
,
objsCouponCode
)
uCouponId
,
uid
,
1
,
infoDto
.
getCouponId
(),
ccode
,
now
,
now
,
infoDto
.
getExpireAt
()
)
);
);
return
ResponseDto
.
success
(
uCouponId
);
return
ResponseDto
.
success
(
uCouponId
);
}
else
if
(
dto
.
getState
().
equals
(
1
)){
}
else
if
(
dto
.
getState
().
equals
(
1
)){
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/resources/sqlmap.properties
View file @
94185669
...
@@ -6,3 +6,4 @@ candy_coupon.use_insert=INSERT INTO candy_user_coupon (ucoupon_id , uid , state
...
@@ -6,3 +6,4 @@ candy_coupon.use_insert=INSERT INTO candy_user_coupon (ucoupon_id , uid , state
candy_coupon.back
=
UPDATE candy_user_coupon SET state = 1 WHERE uid = ? AND ucoupon_id = ?
candy_coupon.back
=
UPDATE candy_user_coupon SET state = 1 WHERE uid = ? AND ucoupon_id = ?
# -- 领取券 --
# -- 领取券 --
candy_coupon.receive
=
INSERT INTO candy_user_coupon (ucoupon_id , uid , state , coupon_id , ccode , bind_at , bind_at, dued_at) VALUE ( ? , ? , ? , ? , ? , ? , ? , ?)
candy_coupon.receive
=
INSERT INTO candy_user_coupon (ucoupon_id , uid , state , coupon_id , ccode , bind_at , bind_at, dued_at) VALUE ( ? , ? , ? , ? , ? , ? , ? , ?)
candy_coupon_code.receive
=
UPDATE candy_coupon_code SET redeem_uid=?,redeem_mobile=?,redeem_at=?,updated_at=? WHERE coupon_id=? AND ccode=?
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