Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
a956ffe1
Commit
a956ffe1
authored
Sep 23, 2021
by
王业雄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jpa分页查询参数fix
parent
04f7f4d5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
6 deletions
+7
-6
ChannelRouteController.java
...controller/route/channelroute/ChannelRouteController.java
+0
-2
ChannelRouteServiceImpl.java
...tribution/service/route/impl/ChannelRouteServiceImpl.java
+4
-1
FundProductServiceImpl.java
...stribution/service/route/impl/FundProductServiceImpl.java
+1
-1
RouteRecordServiceImpl.java
...stribution/service/route/impl/RouteRecordServiceImpl.java
+1
-1
WhiteListServiceImpl.java
...distribution/service/route/impl/WhiteListServiceImpl.java
+1
-1
No files found.
src/main/java/com/quantgroup/asset/distribution/controller/route/channelroute/ChannelRouteController.java
View file @
a956ffe1
...
...
@@ -4,14 +4,12 @@ import com.quantgroup.asset.distribution.enums.route.UserLevel;
import
com.quantgroup.asset.distribution.enums.route.UserTag
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.ChannelRouteAddVo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.ChannelRouteQueryVo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.ChannelRouteSaveVo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.FundProInfoVo
;
import
com.quantgroup.asset.distribution.model.entity.route.fundproduct.TypeVo
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
import
com.quantgroup.asset.distribution.service.route.IChannelRouteService
;
import
com.quantgroup.asset.distribution.util.AllRecords
;
import
lombok.extern.slf4j.Slf4j
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/ChannelRouteServiceImpl.java
View file @
a956ffe1
...
...
@@ -11,6 +11,7 @@ import com.quantgroup.asset.distribution.service.route.IChannelRouteService;
import
com.quantgroup.asset.distribution.util.AllRecords
;
import
com.querydsl.core.types.dsl.BooleanExpression
;
import
com.querydsl.core.types.dsl.Expressions
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -26,6 +27,7 @@ import java.util.List;
import
java.util.Objects
;
@Service
@Slf4j
public
class
ChannelRouteServiceImpl
implements
IChannelRouteService
{
@Autowired
...
...
@@ -58,7 +60,8 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
//查询总条数
long
count
=
channelRuleRepository
.
count
(
booleanExpression
);
//查询数据
Page
<
ChannelRuleEntity
>
plantPage
=
channelRuleRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
channelRouteQueryVo
.
getOffset
(),
channelRouteQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
log
.
info
(
"{},{},{}"
,
channelRouteQueryVo
.
getOffset
(),
channelRouteQueryVo
.
getPageIndex
(),
channelRouteQueryVo
.
getPageSize
());
Page
<
ChannelRuleEntity
>
plantPage
=
channelRuleRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
channelRouteQueryVo
.
getPageIndex
()-
1
,
channelRouteQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
List
<
ChannelRuleEntity
>
channelRuleEntities
=
new
ArrayList
<>();
channelRuleEntities
=
plantPage
.
getContent
();
List
<
ChannelRouteResultVo
>
channelRouteResultVos
=
new
ArrayList
<>();
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/FundProductServiceImpl.java
View file @
a956ffe1
...
...
@@ -107,7 +107,7 @@ public class FundProductServiceImpl implements IFundProductService {
//查询总条数
long
count
=
fundProductRepository
.
count
(
booleanExpression
);
//查询数据
Page
<
FundProductEntity
>
plantPage
=
fundProductRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
fundProductQueryVo
.
get
Offset
()
,
fundProductQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
Page
<
FundProductEntity
>
plantPage
=
fundProductRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
fundProductQueryVo
.
get
PageIndex
()-
1
,
fundProductQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
List
<
FundProductEntity
>
fundProductEntities
=
new
ArrayList
<>();
fundProductEntities
=
plantPage
.
getContent
();
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/RouteRecordServiceImpl.java
View file @
a956ffe1
...
...
@@ -56,7 +56,7 @@ public class RouteRecordServiceImpl implements IRouteRecordService {
//查询总条数
long
count
=
routingRecordRepository
.
count
(
booleanExpression
);
//查询数据
Page
<
RoutingRecordEntity
>
plantPage
=
routingRecordRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
routeRecordQueryVo
.
get
Offset
()
,
routeRecordQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
Page
<
RoutingRecordEntity
>
plantPage
=
routingRecordRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
routeRecordQueryVo
.
get
PageIndex
()-
1
,
routeRecordQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
List
<
RoutingRecordEntity
>
routingRecordEntityList
=
new
ArrayList
<>();
routingRecordEntityList
=
plantPage
.
getContent
();
List
<
RouteRecordResultVo
>
routeRecordResultVoList
=
new
ArrayList
<>();
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/WhiteListServiceImpl.java
View file @
a956ffe1
...
...
@@ -50,7 +50,7 @@ public class WhiteListServiceImpl implements IWhiteListService {
//查询总条数
long
count
=
whiteListRepository
.
count
(
booleanExpression
);
//查询数据
Page
<
WhiteListEntity
>
plantPage
=
whiteListRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
whiteListQueryVo
.
get
Offset
()
,
whiteListQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
Page
<
WhiteListEntity
>
plantPage
=
whiteListRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
whiteListQueryVo
.
get
PageIndex
()-
1
,
whiteListQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"createdAt"
)));
List
<
WhiteListEntity
>
whiteListEntityList
=
new
ArrayList
<>();
whiteListEntityList
=
plantPage
.
getContent
();
List
<
WhiteListResultVo
>
whiteListResultVoArrayList
=
new
ArrayList
<>();
...
...
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