Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3ee29398
authored
Apr 29, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:优惠券发放记录代码优化
1 parent
72094937
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
aus-core/src/main/java/com/glsx/usedcar/module/coupon/service/CouponActivityService.java
aus-core/src/main/java/com/glsx/usedcar/module/coupon/service/CouponActivityService.java
View file @
3ee2939
...
...
@@ -20,6 +20,9 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -723,6 +726,10 @@ public class CouponActivityService {
LocalDateTime
[]
parsedRange
=
parseTimeRange
(
timeRange
);
LocalDateTime
startTime
=
parsedRange
[
0
];
LocalDateTime
endTime
=
parsedRange
[
1
];
String
sort
=
StrUtil
.
blankToDefault
(
pagination
.
getSort
(),
"distributionTime"
);
Sort
.
Direction
direction
=
pagination
.
getSortDirection
()
==
null
?
Sort
.
Direction
.
DESC
:
pagination
.
getSortDirection
();
PageRequest
base
=
pagination
.
getPageRequest
();
Pageable
pageable
=
PageRequest
.
of
(
base
.
getPageNumber
(),
base
.
getPageSize
(),
Sort
.
by
(
direction
,
sort
));
// 2. 执行查询
Page
<
CouponDistributionRecordDTO
>
dtoPage
=
distributionRecordRepository
.
findDistributionRecords
(
keyword
,
...
...
@@ -732,7 +739,7 @@ public class CouponActivityService {
orderCode
,
startTime
,
endTime
,
pag
ination
.
getPageRequest
()
pag
eable
);
// 3. 批量预加载需要重发校验的模板,避免 N+1 查询
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment