Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
7822bb30
Commit
7822bb30
authored
May 08, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加站点参数
parent
207499ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
...xhx/module/site/service/impl/SiteBusinessServiceImpl.java
+34
-7
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
View file @
7822bb30
...
...
@@ -57,8 +57,8 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Override
protected
SiteBusinessEntity
findBefore
(
SiteBusinessEntity
params
,
PageInfo
pageInfo
,
Context
context
)
throws
AppException
{
//查询所有
pageInfo
.
setCurrPage
(
1
);
pageInfo
.
setPrePageResult
(-
1
);
//
pageInfo.setCurrPage(1);
//
pageInfo.setPrePageResult(-1);
if
(!
ObjectUtils
.
isEmpty
(
params
.
getIdNotList
()))
{
Set
<
Long
>
notIdSet
=
params
.
getIdNotList
().
stream
().
collect
(
Collectors
.
toSet
());
...
...
@@ -89,22 +89,49 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
}
/**
* @param
entity
* @param
params
* @param pageInfo
* @param context
* @return
* @throws AppException
*/
@Override
public
Result
<
SiteBusinessEntity
>
find
(
SiteBusinessEntity
entity
,
PageInfo
pageInfo
,
Context
context
)
throws
AppException
{
SiteBusinessEntity
params
=
this
.
findBefore
(
entity
,
pageInfo
,
context
);
public
Result
<
SiteBusinessEntity
>
find
(
SiteBusinessEntity
params
,
PageInfo
pageInfo
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
params
.
getIdNotList
()))
{
Set
<
Long
>
notIdSet
=
params
.
getIdNotList
().
stream
().
collect
(
Collectors
.
toSet
());
//排除掉了父级,但是子集存在,需要吧父id排除到notlist外
SiteBusinessQuery
siteBusinessQuery
=
new
SiteBusinessQuery
();
siteBusinessQuery
.
setIdList
(
params
.
getIdNotList
());
List
<
SiteBusinessEntity
>
rootSiteBusiness
=
this
.
find
(
siteBusinessQuery
).
stream
().
filter
(
f
->
f
.
getIsBusiness
()
==
IsBusinessEnum
.
一级业务
.
getValue
()).
collect
(
Collectors
.
toList
());
for
(
SiteBusinessEntity
root
:
rootSiteBusiness
)
{
SiteBusinessQuery
query
=
new
SiteBusinessQuery
();
query
.
setParentId
(
root
.
getId
());
List
<
SiteBusinessEntity
>
childSiteBusiness
=
this
.
find
(
query
,
context
);
//判断排除的id是否包含所有
Boolean
bool
=
false
;
for
(
SiteBusinessEntity
child
:
childSiteBusiness
)
{
if
(!
notIdSet
.
contains
(
child
.
getId
()))
{
bool
=
true
;
break
;
}
}
if
(
bool
)
{
//排除掉父id
notIdSet
.
remove
(
root
.
getId
());
}
}
params
.
setIdNotList
(
notIdSet
.
stream
().
collect
(
Collectors
.
toList
()));
}
//SiteBusinessEntity params = this.findBefore(entity, pageInfo, context);
Result
<
SiteBusinessEntity
>
result
=
this
.
dao
.
getList
(
params
,
pageInfo
);
List
<
SiteBusinessEntity
>
list
=
result
.
getList
();
if
(!
ObjectUtils
.
isEmpty
(
params
.
getIdNotList
()))
{
//重新内存分页
result
.
getPageInfo
().
setCurrPage
(
params
.
getPage
());
result
.
getPageInfo
().
setPrePageResult
(
params
.
getSize
());
//
result.getPageInfo().setCurrPage(params.getPage());
//
result.getPageInfo().setPrePageResult(params.getSize());
list
=
MemoryPagination
.
pagination
(
list
,
params
.
getSize
()
==
-
1
?
list
.
size
()
:
params
.
getSize
(),
params
.
getPage
());
//排除掉已经存在的ids
log
.
info
(
"idNotList:{}"
,
JSON
.
toJSONString
(
params
.
getIdNotList
()));
...
...
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