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
e555606f
Commit
e555606f
authored
Apr 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自动更新优惠券促销金额
parent
768681f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
4 deletions
+33
-4
CouponRetryTask.java
...artz/src/main/java/share/quartz/task/CouponRetryTask.java
+33
-4
No files found.
share-quartz/src/main/java/share/quartz/task/CouponRetryTask.java
View file @
e555606f
...
...
@@ -14,12 +14,10 @@ import share.common.enums.PlatformTypeEnum;
import
share.common.enums.UserStatusEnum
;
import
share.common.enums.YesNoEnum
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.SCoupon
;
import
share.system.domain.SOrder
;
import
share.system.domain.SStore
;
import
share.system.service.ISConsumerCouponService
;
import
share.system.service.ISStoreService
;
import
share.system.service.QPService
;
import
share.system.service.TiktokService
;
import
share.system.service.*
;
import
share.system.service.impl.QPServiceImpl
;
import
java.math.BigDecimal
;
...
...
@@ -34,6 +32,8 @@ public class CouponRetryTask {
@Autowired
private
ISConsumerCouponService
sConsumerCouponService
;
@Autowired
private
ISCouponService
sCouponService
;
@Autowired
private
ISStoreService
storeService
;
@Autowired
private
QPService
qpService
;
...
...
@@ -108,6 +108,35 @@ public class CouponRetryTask {
}
}
//更新优惠券促销金额
public
void
AutoUpdateCouponPromotionPrice
()
{
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
consumerCouponWrapper
.
isNull
(
SConsumerCoupon:
:
getPromotionPrice
);
List
<
SConsumerCoupon
>
sConsumerCouponList
=
sConsumerCouponService
.
list
(
consumerCouponWrapper
);
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
.
stream
().
forEach
(
item
->
{
if
(
item
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
item
.
setPromotionPrice
(
couponList
.
stream
().
filter
(
coupon
->
coupon
.
getDealgroupId
().
equals
(
item
.
getDealgroupId
())).
findFirst
().
get
().
getPromotionPrice
());
}
else
if
(
item
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
item
.
setPromotionPrice
(
couponList
.
stream
().
filter
(
coupon
->
coupon
.
getTiktokSkuId
().
equals
(
item
.
getTiktokSkuId
())).
findFirst
().
get
().
getPromotionPrice
());
}
else
if
(
item
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
SELF
.
getCode
()))
{
item
.
setPromotionPrice
(
couponList
.
stream
().
filter
(
coupon
->
coupon
.
getId
().
equals
(
item
.
getCouponId
())).
findFirst
().
get
().
getPromotionPrice
());
item
.
setSubPrice
(
couponList
.
stream
().
filter
(
coupon
->
coupon
.
getId
().
equals
(
item
.
getCouponId
())).
findFirst
().
get
().
getSubPrice
());
}
});
if
(!
CollectionUtils
.
isEmpty
(
sConsumerCouponList
))
sConsumerCouponService
.
updateBatchById
(
sConsumerCouponList
);
}
//补齐美团团购id
public
void
AutoGenerateTuangouId
()
{
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
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