Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
8fd14d4e
"vscode:/vscode.git/clone" did not exist on "2ff992eea0f84555ca76906a93216b6ed3f85357"
Commit
8fd14d4e
authored
Feb 01, 2021
by
zhengjie
Browse files
Merge branch 'master' of github.com:elunez/eladmin
parents
fdf82d24
5381ac38
Changes
3
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
View file @
8fd14d4e
...
@@ -95,7 +95,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
...
@@ -95,7 +95,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
File
file
=
null
;
File
file
=
null
;
try
{
try
{
// 用uuid作为文件名,防止生成的临时文件重复
// 用uuid作为文件名,防止生成的临时文件重复
file
=
File
.
createTempFile
(
IdUtil
.
simpleUUID
()
,
prefix
);
file
=
new
File
(
SYS_TEM_DIR
+
IdUtil
.
simpleUUID
()
+
prefix
);
// MultipartFile to File
// MultipartFile to File
multipartFile
.
transferTo
(
file
);
multipartFile
.
transferTo
(
file
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
View file @
8fd14d4e
...
@@ -81,12 +81,12 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
...
@@ -81,12 +81,12 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
/**
/**
* 根据角色中的部门查询
* 根据角色中的部门查询
* @param
i
d /
* @param
deptI
d /
* @return /
* @return /
*/
*/
@Query
(
value
=
"SELECT u.* FROM sys_user u, sys_users_roles r, sys_roles_depts d WHERE "
+
@Query
(
value
=
"SELECT u.* FROM sys_user u, sys_users_roles r, sys_roles_depts d WHERE "
+
"u.user_id = r.user_id AND r.role_id = d.role_id AND
r.role
_id = ?1 group by u.user_id"
,
nativeQuery
=
true
)
"u.user_id = r.user_id AND r.role_id = d.role_id AND
d.dept
_id = ?1 group by u.user_id"
,
nativeQuery
=
true
)
List
<
User
>
findBy
Dept
RoleId
(
Long
i
d
);
List
<
User
>
findByRole
Dept
Id
(
Long
deptI
d
);
/**
/**
* 根据菜单查询
* 根据菜单查询
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java
View file @
8fd14d4e
...
@@ -273,7 +273,7 @@ public class DeptServiceImpl implements DeptService {
...
@@ -273,7 +273,7 @@ public class DeptServiceImpl implements DeptService {
* @param id /
* @param id /
*/
*/
public
void
delCaches
(
Long
id
){
public
void
delCaches
(
Long
id
){
List
<
User
>
users
=
userRepository
.
findBy
Dept
RoleId
(
id
);
List
<
User
>
users
=
userRepository
.
findByRole
Dept
Id
(
id
);
// 删除数据权限
// 删除数据权限
redisUtils
.
delByKeys
(
CacheKey
.
DATA_USER
,
users
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toSet
()));
redisUtils
.
delByKeys
(
CacheKey
.
DATA_USER
,
users
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toSet
()));
redisUtils
.
del
(
CacheKey
.
DEPT_ID
+
id
);
redisUtils
.
del
(
CacheKey
.
DEPT_ID
+
id
);
...
...
Write
Preview
Supports
Markdown
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