Commit 8fd14d4e authored by zhengjie's avatar zhengjie
Browse files

Merge branch 'master' of github.com:elunez/eladmin

parents fdf82d24 5381ac38
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment