mirror of https://github.com/elunez/eladmin
Merge branch 'master' of github.com:elunez/eladmin
commit
8fd14d4ea1
|
@ -95,7 +95,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
|||
File file = null;
|
||||
try {
|
||||
// 用uuid作为文件名,防止生成的临时文件重复
|
||||
file = File.createTempFile(IdUtil.simpleUUID(), prefix);
|
||||
file = new File(SYS_TEM_DIR + IdUtil.simpleUUID() + prefix);
|
||||
// MultipartFile to File
|
||||
multipartFile.transferTo(file);
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -81,12 +81,12 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
|
|||
|
||||
/**
|
||||
* 根据角色中的部门查询
|
||||
* @param id /
|
||||
* @param deptId /
|
||||
* @return /
|
||||
*/
|
||||
@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)
|
||||
List<User> findByDeptRoleId(Long id);
|
||||
"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> findByRoleDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据菜单查询
|
||||
|
|
|
@ -273,7 +273,7 @@ public class DeptServiceImpl implements DeptService {
|
|||
* @param id /
|
||||
*/
|
||||
public void delCaches(Long id){
|
||||
List<User> users = userRepository.findByDeptRoleId(id);
|
||||
List<User> users = userRepository.findByRoleDeptId(id);
|
||||
// 删除数据权限
|
||||
redisUtils.delByKeys(CacheKey.DATA_USER, users.stream().map(User::getId).collect(Collectors.toSet()));
|
||||
redisUtils.del(CacheKey.DEPT_ID + id);
|
||||
|
|
Loading…
Reference in New Issue