记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
9d94d5d9
Commit
9d94d5d9
authored
Nov 16, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setTotal
parent
402ea02d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
SweetIntegralActivityDrawServiceImpl.java
...et/service/impl/SweetIntegralActivityDrawServiceImpl.java
+10
-10
No files found.
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetIntegralActivityDrawServiceImpl.java
View file @
9d94d5d9
...
...
@@ -187,23 +187,23 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
PagedResult
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawPagedResult
=
SweetNewObjectUtil
.
getSweetIntegralActivityDrawVoPagedResult
();
long
count
=
0
;
//条件
Query
query
=
Query
.
query
(
Criteria
.
where
(
"integralActivityId"
).
is
(
integralActivityId
).
and
(
"userId"
).
is
(
currentUid
)
);
if
(
type
==
1
)
{
query
.
addCriteria
(
Criteria
.
where
(
"prizeType"
).
ne
(
1
));
}
else
{
query
.
addCriteria
(
Criteria
.
where
(
"prizeType"
).
is
(
1
));
}
if
(
pageNum
<=
1
)
{
List
<
IntegralActivityDrawVo
>
integralActivityDrawAll
=
redisDataUtils
.
getIntegralActivityDrawList
(
type
,
currentUid
,
integralActivityId
);
count
=
integralActivityDrawAll
.
size
(
);
count
=
mongoTemplate
.
count
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
()
);
sweetIntegralActivityDrawPagedResult
.
setList
(
integralActivityDrawAll
).
setTotal
(
count
,
20
).
setPageSize
(
20
).
setCurrentPage
(
pageNum
);
}
else
{
// page大于1 去mongo里面取
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
// 排序 分页
Pageable
pageable
=
PageRequest
.
of
(
pageNum
-
1
,
20
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdAt"
));
//条件
Query
query
=
Query
.
query
(
Criteria
.
where
(
"integralActivityId"
).
is
(
integralActivityId
).
and
(
"userId"
).
is
(
currentUid
)
);
if
(
type
==
1
)
{
query
.
addCriteria
(
Criteria
.
where
(
"prizeType"
).
ne
(
1
));
}
else
{
query
.
addCriteria
(
Criteria
.
where
(
"prizeType"
).
is
(
1
));
}
count
=
mongoTemplate
.
count
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
query
.
with
(
pageable
);
List
<
IntegralActivityDrawVo
>
integralActivityDrawVos
=
mongoTemplate
.
find
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
...
...
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