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
9ee905dc
Commit
9ee905dc
authored
Jan 16, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改优惠卷日志查询问题
parent
757cac98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
QPServiceImplAspect.java
...ain/java/share/framework/aspectj/QPServiceImplAspect.java
+5
-13
No files found.
share-framework/src/main/java/share/framework/aspectj/QPServiceImplAspect.java
View file @
9ee905dc
...
...
@@ -90,7 +90,7 @@ public class QPServiceImplAspect {
JSONObject
jsonObject
=
JSON
.
parseObject
(
params
);
//获得出参
String
outParams
=
JSON
.
toJSONString
(
result
);
saveLog
(
couponLog
,
jsonObject
);
saveLog
(
couponLog
,
jsonObject
,
UserStatusEnum
.
USED
.
getCode
()
);
couponLog
.
setStatus
(
YesNoEnum
.
yes
.
getDisplay_3
());
couponLog
.
setMessage
(
outParams
);
couponLog
.
setCreateTime
(
new
Date
());
...
...
@@ -128,7 +128,7 @@ public class QPServiceImplAspect {
String
params
=
argsArrayToString
(
paramNames
,
joinPoint
.
getArgs
());
//转JSON
JSONObject
jsonObject
=
JSON
.
parseObject
(
params
);
saveLog
(
couponLog
,
jsonObject
);
saveLog
(
couponLog
,
jsonObject
,
UserStatusEnum
.
UNUSED
.
getCode
()
);
couponLog
.
setStatus
(
YesNoEnum
.
no
.
getDisplay_3
());
couponLog
.
setNumber
(
TRY_NUMBER
);
couponLog
.
setCreateTime
(
new
Date
());
...
...
@@ -148,20 +148,12 @@ public class QPServiceImplAspect {
}
}
private
void
saveLog
(
CouponLog
couponLog
,
JSONObject
jsonObject
)
{
private
void
saveLog
(
CouponLog
couponLog
,
JSONObject
jsonObject
,
Integer
code
)
{
couponLog
.
setCode
(
jsonObject
.
getString
(
"code"
));
LambdaQueryWrapper
<
SConsumerCoupon
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponCode
,
couponLog
.
getCode
());
lambdaQueryWrapper
.
in
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
(),
UserStatusEnum
.
USED
.
getCode
());
List
<
SConsumerCoupon
>
list
=
sConsumerCouponService
.
list
(
lambdaQueryWrapper
);
//过滤只有已使用
SConsumerCoupon
one
=
null
;
//判断是否存在已使用的券
if
(
list
.
stream
().
anyMatch
(
sConsumerCoupon
->
sConsumerCoupon
.
getUseStatus
().
equals
(
UserStatusEnum
.
USED
.
getCode
())))
{
one
=
list
.
stream
().
filter
(
sConsumerCoupon
->
sConsumerCoupon
.
getUseStatus
().
equals
(
UserStatusEnum
.
USED
.
getCode
())).
findFirst
().
orElse
(
null
);
}
else
{
one
=
list
.
stream
().
filter
(
sConsumerCoupon
->
sConsumerCoupon
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
())).
findFirst
().
orElse
(
null
);
}
lambdaQueryWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
code
);
SConsumerCoupon
one
=
sConsumerCouponService
.
getOne
(
lambdaQueryWrapper
);
couponLog
.
setConsumerId
(
one
.
getConsumerId
());
couponLog
.
setCouponId
(
one
.
getId
());
LambdaQueryWrapper
<
SStore
>
sStoreLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
...
...
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