Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
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
finance-oa
finance-manage
Commits
436f8eb7
Commit
436f8eb7
authored
Dec 31, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门顶级节点逻辑优化
parent
d677cd11
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java
...va/com/ruoyi/framework/security/service/TokenService.java
+0
-2
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java
...ruoyi/project/system/service/impl/SysDeptServiceImpl.java
+8
-7
No files found.
ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java
View file @
436f8eb7
...
@@ -124,8 +124,6 @@ public class TokenService
...
@@ -124,8 +124,6 @@ public class TokenService
long
currentTime
=
System
.
currentTimeMillis
();
long
currentTime
=
System
.
currentTimeMillis
();
if
(
expireTime
-
currentTime
<=
MILLIS_MINUTE_TEN
)
if
(
expireTime
-
currentTime
<=
MILLIS_MINUTE_TEN
)
{
{
String
token
=
loginUser
.
getToken
();
loginUser
.
setToken
(
token
);
refreshToken
(
loginUser
);
refreshToken
(
loginUser
);
}
}
}
}
...
...
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java
View file @
436f8eb7
...
@@ -49,18 +49,19 @@ public class SysDeptServiceImpl implements ISysDeptService
...
@@ -49,18 +49,19 @@ public class SysDeptServiceImpl implements ISysDeptService
public
List
<
SysDept
>
buildDeptTree
(
List
<
SysDept
>
depts
)
public
List
<
SysDept
>
buildDeptTree
(
List
<
SysDept
>
depts
)
{
{
List
<
SysDept
>
returnList
=
new
ArrayList
<
SysDept
>();
List
<
SysDept
>
returnList
=
new
ArrayList
<
SysDept
>();
if
(
StringUtils
.
isNotEmpty
(
depts
)
&&
StringUtils
.
isNotNull
(
depts
.
stream
().
findFirst
()))
List
<
Long
>
tempList
=
new
ArrayList
<
Long
>();
for
(
SysDept
dept
:
depts
)
{
{
depts
.
stream
().
findFirst
().
get
().
setParentId
(
null
);
tempList
.
add
(
dept
.
getDeptId
()
);
}
}
for
(
Iterator
<
SysDept
>
iterator
=
depts
.
iterator
();
iterator
.
hasNext
();)
for
(
Iterator
<
SysDept
>
iterator
=
depts
.
iterator
();
iterator
.
hasNext
();)
{
{
SysDept
t
=
(
SysDept
)
iterator
.
next
();
SysDept
dep
t
=
(
SysDept
)
iterator
.
next
();
//
根据传入的某个父节点ID,
遍历该父节点的所有子节点
//
如果是顶级节点,
遍历该父节点的所有子节点
if
(
StringUtils
.
isNull
(
t
.
getParentId
())
||
t
.
getParentId
()
==
0
)
if
(
!
tempList
.
contains
(
dept
.
getParentId
())
)
{
{
recursionFn
(
depts
,
t
);
recursionFn
(
depts
,
dep
t
);
returnList
.
add
(
t
);
returnList
.
add
(
dep
t
);
}
}
}
}
if
(
returnList
.
isEmpty
())
if
(
returnList
.
isEmpty
())
...
...
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