Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
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
poc
poc-api
Commits
df2518ab
Commit
df2518ab
authored
Nov 12, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复接口 [BizAgentApplicationMallRest#getList] 分页问题
parent
91e08228
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
MallAgentApplicationQuery.sql
...poc/agent_application/query/MallAgentApplicationQuery.sql
+5
-3
MallAgentApplicationQueryCondition.java
...application/query/MallAgentApplicationQueryCondition.java
+10
-0
BizAgentApplicationMallRestImpl.java
...pplication/rest/impl/BizAgentApplicationMallRestImpl.java
+10
-7
No files found.
src/main/java/cn/com/poc/agent_application/query/MallAgentApplicationQuery.sql
View file @
df2518ab
...
@@ -11,10 +11,12 @@ select
...
@@ -11,10 +11,12 @@ select
baap
.
agent_id
baap
.
agent_id
from
from
biz_agent_application_mall
baam
biz_agent_application_mall
baam
left
join
biz_agent_application_publish
baap
on
baap
.
id
=
baam
.
agent_publish_id
and
baap
.
is_deleted
=
'N'
left
join
biz_agent_application_publish
baap
on
baap
.
id
=
baam
.
agent_publish_id
where
baam
.
is_deleted
=
'N'
where
baam
.
is_deleted
=
'N'
and
baam
.
is_sale
=
'Y'
and
baap
.
is_deleted
=
'N'
<<
and
baam
.
is_sale
=
:
isSale
>>
<<
and
baam
.
agent_type
=
:
agentType
>>
<<
and
baam
.
agent_type
=
:
agentType
>>
<<
and
baam
.
category_id
=
:
categoryId
>>
<<
and
baam
.
category_id
=
:
categoryId
>>
<<
and
LOCATE
(:
query
,
baap
.
agent_title
)
>>
<<
and
LOCATE
(:
query
,
baap
.
agent_title
)
>>
order
by
baam
.
CREATED_TIME
desc
order
by
baam
.
popularity
desc
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/MallAgentApplicationQueryCondition.java
View file @
df2518ab
...
@@ -39,4 +39,14 @@ public class MallAgentApplicationQueryCondition implements Serializable{
...
@@ -39,4 +39,14 @@ public class MallAgentApplicationQueryCondition implements Serializable{
public
void
setQuery
(
String
query
)
{
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
this
.
query
=
query
;
}
}
private
java
.
lang
.
String
isSale
;
public
String
getIsSale
()
{
return
isSale
;
}
public
void
setIsSale
(
String
isSale
)
{
this
.
isSale
=
isSale
;
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/impl/BizAgentApplicationMallRestImpl.java
View file @
df2518ab
...
@@ -102,9 +102,13 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
...
@@ -102,9 +102,13 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
return
null
;
return
null
;
}
}
@Override
//todo 分页问题
public
List
<
BizAgentApplicationMallDto
>
getList
(
AgentApplicationMallQueryDto
dto
,
PagingInfo
pagingInfo
)
throws
Exception
{
public
List
<
BizAgentApplicationMallDto
>
getList
(
AgentApplicationMallQueryDto
dto
,
PagingInfo
pagingInfo
)
throws
Exception
{
List
<
BizAgentApplicationMallDto
>
resultList
=
new
ArrayList
<>();
List
<
BizAgentApplicationMallDto
>
resultList
=
new
ArrayList
<>();
//查询应用广场的应用
MallAgentApplicationQueryCondition
mallAgentApplicationQueryCondition
=
new
MallAgentApplicationQueryCondition
();
MallAgentApplicationQueryCondition
mallAgentApplicationQueryCondition
=
new
MallAgentApplicationQueryCondition
();
mallAgentApplicationQueryCondition
.
setIsSale
(
CommonConstant
.
YOrN
.
Y
);
if
(
dto
!=
null
)
{
if
(
dto
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
dto
.
getSearch
()))
{
if
(
StringUtils
.
isNotBlank
(
dto
.
getSearch
()))
{
mallAgentApplicationQueryCondition
.
setQuery
(
dto
.
getSearch
());
mallAgentApplicationQueryCondition
.
setQuery
(
dto
.
getSearch
());
...
@@ -117,20 +121,19 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
...
@@ -117,20 +121,19 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
}
}
}
}
List
<
MallAgentApplicationQueryItem
>
items
=
bizAgentApplicationMallService
.
mallAgentApplicationQuery
(
mallAgentApplicationQueryCondition
,
pagingInfo
);
List
<
MallAgentApplicationQueryItem
>
items
=
bizAgentApplicationMallService
.
mallAgentApplicationQuery
(
mallAgentApplicationQueryCondition
,
pagingInfo
);
//查询当前用户的收藏情况
MemberCollectQueryCondition
collectQueryCondition
=
new
MemberCollectQueryCondition
();
MemberCollectQueryCondition
collectQueryCondition
=
new
MemberCollectQueryCondition
();
collectQueryCondition
.
setMemberId
(
BlContext
.
getCurrentUserNotException
().
getUserId
());
collectQueryCondition
.
setMemberId
(
BlContext
.
getCurrentUserNotException
().
getUserId
());
collectQueryCondition
.
setIsCollect
(
CommonConstant
.
YOrN
.
Y
);
collectQueryCondition
.
setIsCollect
(
CommonConstant
.
YOrN
.
Y
);
List
<
MemberCollectQueryItem
>
memberCollectQueryItems
=
bizMemberAgentApplicationCollectService
.
queryMemberCollect
(
collectQueryCondition
,
null
);
List
<
MemberCollectQueryItem
>
memberCollectQueryItems
=
bizMemberAgentApplicationCollectService
.
queryMemberCollect
(
collectQueryCondition
,
null
);
// 把查询结果封装到DTO中
for
(
MallAgentApplicationQueryItem
item
:
items
)
{
for
(
MallAgentApplicationQueryItem
item
:
items
)
{
BizAgentApplicationMallDto
mallDto
=
BizAgentApplicationMallConvert
.
itemToDto
(
item
);
BizAgentApplicationMallDto
mallDto
=
BizAgentApplicationMallConvert
.
itemToDto
(
item
);
// 如果应用上架了
String
agentId
=
mallDto
.
getBaseInfo
().
getAgentId
();
if
(
mallDto
.
getBaseInfo
()
!=
null
&&
CommonConstant
.
YOrN
.
Y
.
equals
(
mallDto
.
getIsSale
()))
{
mallDto
.
setIsCollect
(
memberCollectQueryItems
.
stream
().
anyMatch
(
v
->
agentId
.
equals
(
v
.
getAgentId
()))
?
CommonConstant
.
YOrN
.
Y
:
CommonConstant
.
YOrN
.
N
);
// 设置当前用户是否收藏了
resultList
.
add
(
mallDto
);
String
agentId
=
mallDto
.
getBaseInfo
().
getAgentId
();
mallDto
.
setIsCollect
(
memberCollectQueryItems
.
stream
().
anyMatch
(
v
->
agentId
.
equals
(
v
.
getAgentId
()))
?
CommonConstant
.
YOrN
.
Y
:
CommonConstant
.
YOrN
.
N
);
resultList
.
add
(
mallDto
);
}
}
}
return
resultList
;
return
resultList
;
}
}
...
...
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