Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
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
ai-tech
E
ellehuis-group
backend
elleai
Commits
75054cf3
Commit
75054cf3
authored
Dec 13, 2024
by
yangyw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 过滤资料库分类
parent
3fe03f77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+21
-2
No files found.
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
75054cf3
...
...
@@ -37,6 +37,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.reactive.function.client.WebClient
;
import
org.xbill.DNS.InvalidTTLException
;
import
reactor.core.publisher.Flux
;
import
java.math.BigDecimal
;
...
...
@@ -909,18 +910,36 @@ public class AppExamineService {
return
pageResult
;
}
private
List
<
Integer
>
findLevelOneCategory
(
List
<
Integer
>
categoryIdList
)
{
Set
<
Integer
>
levelOneCategorySet
=
new
HashSet
<>();
WikiCategoryRequestModel
cr
=
new
WikiCategoryRequestModel
();
List
<
WikiCategoryResponseModel
>
items
=
examineService
.
wikiCategoryList
(
cr
);
Map
<
Integer
,
WikiCategoryResponseModel
>
map
=
items
.
stream
().
collect
(
Collectors
.
toMap
(
WikiCategoryResponseModel:
:
getId
,
v
->
v
));
for
(
Integer
id
:
categoryIdList
)
{
WikiCategoryResponseModel
model
=
map
.
get
(
id
);
if
(
Objects
.
nonNull
(
model
))
{
if
(
model
.
getParentId
()
==
0
)
{
levelOneCategorySet
.
add
(
id
);
}
else
{
levelOneCategorySet
.
add
(
model
.
getParentId
());
}
}
}
return
Lists
.
newArrayList
(
levelOneCategorySet
);
}
/**
* 资料库分类分页查询
* @param request
* @return
*/
public
PageResult
<
WikiCategoryMobileDto
>
wikiCategoryMobilePaginQuery
(
WikiCategoryRequestDto
request
)
{
WikiCategoryRequestModel
requestModel
=
BeanUtil
.
copyProperties
(
request
,
WikiCategoryRequestModel
.
class
);
requestModel
.
setStatus
(
1
);
requestModel
.
setPageSize
(
1000
);
List
<
Integer
>
categoryIdList
=
examineService
.
wikiCategoryUseableList
();
requestModel
.
setIdList
(
categoryIdList
);
requestModel
.
setIdList
(
findLevelOneCategory
(
categoryIdList
)
);
Page
<
WikiCategoryResponseModel
>
page
=
examineService
.
wikiCategoryPaginQuery
(
requestModel
);
PageResult
<
WikiCategoryMobileDto
>
pageResult
=
PageResult
.
of
(
request
.
getPageNo
(),
request
.
getPageSize
(),
(
int
)
page
.
getTotalRow
(),
null
);
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
...
...
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