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
a9335fe4
Commit
a9335fe4
authored
Jun 14, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加根据部门id 查询所属大厅
parent
4db1de0b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+11
-7
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
a9335fe4
...
@@ -211,11 +211,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -211,11 +211,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
SiteQuery
siteQuery
=
new
SiteQuery
();
SiteQuery
siteQuery
=
new
SiteQuery
();
//如果站点为空 或者用户为空 返回空数组
//如果站点为空 或者用户为空 返回空数组
if
(
context
.
getUser
()
==
null
||
context
.
getUser
().
getSiteIds
()
==
null
)
{
if
(
context
.
getUser
()
==
null
)
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
List
<
SiteEntity
>
siteList
=
new
ArrayList
<>();
if
(
context
.
getUser
()
!=
null
&&
context
.
getUser
()
.
getSiteIds
()
!=
null
)
{
if
(
context
.
getUser
().
getSiteIds
()
!=
null
)
{
Set
<
String
>
siteSet
=
Arrays
.
stream
(
context
.
getUser
().
getSiteIds
().
split
(
","
)).
filter
(
f
->
!
f
.
equals
(
""
)).
collect
(
Collectors
.
toSet
());
Set
<
String
>
siteSet
=
Arrays
.
stream
(
context
.
getUser
().
getSiteIds
().
split
(
","
)).
filter
(
f
->
!
f
.
equals
(
""
)).
collect
(
Collectors
.
toSet
());
if
(!
ObjectUtils
.
isEmpty
(
siteSet
))
{
if
(!
ObjectUtils
.
isEmpty
(
siteSet
))
{
List
<
Long
>
siteIdList
=
siteSet
.
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
List
<
Long
>
siteIdList
=
siteSet
.
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
...
@@ -223,17 +224,20 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -223,17 +224,20 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
siteQuery
.
idList
(
siteIdList
);
siteQuery
.
idList
(
siteIdList
);
}
}
}
}
}
//查詢指定的站點ids
//查詢指定的站點ids
log
.
info
(
String
.
format
(
"siteQuery==>%s"
,
JSON
.
toJSONString
(
siteQuery
)));
log
.
info
(
String
.
format
(
"siteQuery==>%s"
,
JSON
.
toJSONString
(
siteQuery
)));
List
<
SiteEntity
>
siteList
=
this
.
find
(
siteQuery
);
siteList
=
this
.
find
(
siteQuery
);
}
//如果是管理员 默认全部站点
//如果是管理员 默认全部站点
if
(
context
.
getUser
().
isAdmin
())
{
if
(
context
.
getUser
().
isAdmin
()
||
context
.
getUser
().
getId
()
==
0L
)
{
log
.
info
(
"user is admin !"
);
log
.
info
(
"user is admin !"
);
siteList
=
this
.
find
(
new
SiteQuery
());
siteList
=
this
.
find
(
new
SiteQuery
());
}
}
if
(
ObjectUtils
.
isEmpty
(
siteList
))
{
return
new
ArrayList
<>();
}
//turn to sitemap
//turn to sitemap
Map
<
String
,
SiteEntity
>
siteMap
=
siteList
.
parallelStream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getSiteCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
String
,
SiteEntity
>
siteMap
=
siteList
.
parallelStream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getSiteCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
//遍历过滤站点树
//遍历过滤站点树
...
...
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