Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
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
liyang
sts网站
Commits
99d1760b
Commit
99d1760b
authored
Aug 22, 2022
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
4d71cfa9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
27 deletions
+5
-27
SysDeptController.java
...va/com/ruoyi/web/controller/system/SysDeptController.java
+1
-11
SysDictData.java
...java/com/ruoyi/common/core/domain/entity/SysDictData.java
+1
-1
RedisCache.java
...src/main/java/com/ruoyi/common/core/redis/RedisCache.java
+3
-15
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
View file @
99d1760b
package
com
.
ruoyi
.
web
.
controller
.
system
;
package
com
.
ruoyi
.
web
.
controller
.
system
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -54,16 +53,7 @@ public class SysDeptController extends BaseController
...
@@ -54,16 +53,7 @@ public class SysDeptController extends BaseController
public
AjaxResult
excludeChild
(
@PathVariable
(
value
=
"deptId"
,
required
=
false
)
Long
deptId
)
public
AjaxResult
excludeChild
(
@PathVariable
(
value
=
"deptId"
,
required
=
false
)
Long
deptId
)
{
{
List
<
SysDept
>
depts
=
deptService
.
selectDeptList
(
new
SysDept
());
List
<
SysDept
>
depts
=
deptService
.
selectDeptList
(
new
SysDept
());
Iterator
<
SysDept
>
it
=
depts
.
iterator
();
depts
.
removeIf
(
d
->
d
.
getDeptId
().
intValue
()
==
deptId
||
ArrayUtils
.
contains
(
StringUtils
.
split
(
d
.
getAncestors
(),
","
),
deptId
+
""
));
while
(
it
.
hasNext
())
{
SysDept
d
=
(
SysDept
)
it
.
next
();
if
(
d
.
getDeptId
().
intValue
()
==
deptId
||
ArrayUtils
.
contains
(
StringUtils
.
split
(
d
.
getAncestors
(),
","
),
deptId
+
""
))
{
it
.
remove
();
}
}
return
AjaxResult
.
success
(
depts
);
return
AjaxResult
.
success
(
depts
);
}
}
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
View file @
99d1760b
...
@@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
...
@@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
public
boolean
getDefault
()
public
boolean
getDefault
()
{
{
return
UserConstants
.
YES
.
equals
(
this
.
isDefault
)
?
true
:
false
;
return
UserConstants
.
YES
.
equals
(
this
.
isDefault
);
}
}
public
String
getIsDefault
()
public
String
getIsDefault
()
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
View file @
99d1760b
...
@@ -124,9 +124,9 @@ public class RedisCache
...
@@ -124,9 +124,9 @@ public class RedisCache
* @param collection 多个对象
* @param collection 多个对象
* @return
* @return
*/
*/
public
long
deleteObject
(
final
Collection
collection
)
public
boolean
deleteObject
(
final
Collection
collection
)
{
{
return
redisTemplate
.
delete
(
collection
);
return
redisTemplate
.
delete
(
collection
)
>
0
;
}
}
/**
/**
...
@@ -231,18 +231,6 @@ public class RedisCache
...
@@ -231,18 +231,6 @@ public class RedisCache
return
opsForHash
.
get
(
key
,
hKey
);
return
opsForHash
.
get
(
key
,
hKey
);
}
}
/**
* 删除Hash中的数据
*
* @param key
* @param hKey
*/
public
void
delCacheMapValue
(
final
String
key
,
final
String
hKey
)
{
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
hashOperations
.
delete
(
key
,
hKey
);
}
/**
/**
* 获取多个Hash中的数据
* 获取多个Hash中的数据
*
*
...
@@ -264,7 +252,7 @@ public class RedisCache
...
@@ -264,7 +252,7 @@ public class RedisCache
*/
*/
public
boolean
deleteCacheMapValue
(
final
String
key
,
final
String
hKey
)
public
boolean
deleteCacheMapValue
(
final
String
key
,
final
String
hKey
)
{
{
return
Boolean
.
TRUE
.
equals
(
redisTemplate
.
opsForHash
().
delete
(
key
,
hKey
))
;
return
redisTemplate
.
opsForHash
().
delete
(
key
,
hKey
)
>
0
;
}
}
/**
/**
...
...
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