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
79d5b30d
Commit
79d5b30d
authored
Apr 26, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改自动更新优惠券促销价
parent
e1fe8808
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
CouponRetryTask.java
...artz/src/main/java/share/quartz/task/CouponRetryTask.java
+18
-16
No files found.
share-quartz/src/main/java/share/quartz/task/CouponRetryTask.java
View file @
79d5b30d
...
...
@@ -2,6 +2,7 @@ package share.quartz.task;
import
cn.hutool.json.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.slf4j.Logger
;
...
...
@@ -23,6 +24,7 @@ import share.system.service.impl.QPServiceImpl;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Component
(
"couponRetryTask"
)
public
class
CouponRetryTask
{
@Autowired
...
...
@@ -149,25 +151,25 @@ public class CouponRetryTask {
public
void
AutoUpdateCouponPromotionPrice
()
{
try
{
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
consumerCouponWrapper
.
isNull
(
SConsumerCoupon:
:
getPromotionPrice
);
LambdaQueryWrapper
<
SCoupon
>
sCouponLambdaQueryWrapper
=
Wrappers
.
lambdaQuery
(
SCoupon
.
class
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
getPromotionPrice
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
getSubPrice
);
List
<
SCoupon
>
couponList
=
sCouponService
.
list
(
sCouponLambdaQueryWrapper
);
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
Wrappers
.
lambdaQuery
(
SConsumerCoupon
.
class
);
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
consumerCouponWrapper
.
in
(
SConsumerCoupon:
:
getCouponId
,
couponList
.
stream
().
map
(
SCoupon:
:
getId
).
collect
(
Collectors
.
toList
()));
consumerCouponWrapper
.
isNull
(
SConsumerCoupon:
:
getPromotionPrice
);
List
<
SConsumerCoupon
>
sConsumerCouponList
=
sConsumerCouponService
.
list
(
consumerCouponWrapper
);
List
<
SConsumerCoupon
>
sConsumerCouponList
=
sConsumerCouponService
.
list
(
consumerCouponWrapper
);
if
(
CollectionUtils
.
isEmpty
(
sConsumerCouponList
))
{
return
;
}
LambdaQueryWrapper
<
SCoupon
>
sCouponLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
getPromotionPrice
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
getSubPrice
);
List
<
SCoupon
>
couponList
=
sCouponService
.
list
(
sCouponLambdaQueryWrapper
);
if
(
sConsumerCouponList
.
size
()
>
100
)
{
sConsumerCouponList
=
sConsumerCouponList
.
subList
(
0
,
100
);
}
sConsumerCouponList
=
sConsumerCouponList
.
subList
(
0
,
100
);
}
Map
<
Long
,
SCoupon
>
dealgroupCouponMap
=
couponList
.
stream
()
.
filter
(
coupon
->
coupon
.
getDealgroupId
()
!=
null
&&
coupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
...
...
@@ -198,11 +200,11 @@ public class CouponRetryTask {
});
});
if
(!
CollectionUtils
.
isEmpty
(
sConsumerCouponList
))
sConsumerCouponService
.
updateBatchById
(
sConsumerCouponList
);
if
(!
CollectionUtils
.
isEmpty
(
sConsumerCouponList
))
sConsumerCouponService
.
updateBatchById
(
sConsumerCouponList
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
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