Commit e91d8816 by huangjinxin

fix:构建资源树去掉组织

1 parent f51b511e
......@@ -10,13 +10,13 @@ import java.util.List;
/**
* 资源表 用户对某种具体权限或者功能的描述(Resource)表数据库访问层
*
*/
public interface ResourceDao extends JpaRepository<ResourceEntity, String>,
JpaSpecificationExecutor<ResourceEntity>, CrudRepository<ResourceEntity, String> {
/**
* 根据IDs查询多个资源
*
* @param ids 资源ID集合
* @return
*/
......@@ -31,5 +31,5 @@ public interface ResourceDao extends JpaRepository<ResourceEntity, String>,
List<ResourceEntity> findByParentId(String parentId);
List<ResourceEntity> findByTypeNot(Integer type);
}
......@@ -279,7 +279,7 @@ public class RoleService {
if (StringUtils.isNotBlank(redisValue)) {
return JSONObject.parseObject(redisValue, List.class);
}
List<ResourceEntity> all = resourceDao.findAll();
List<ResourceEntity> all = resourceDao.findByTypeNot(3);
List<ResourceInfo> collect = all.stream().filter(resourceEntity -> StringUtils.isBlank(resourceEntity.getParentId())).map(entity -> BeanUtil.copyProperties(entity, ResourceInfo.class)).collect(Collectors.toList());
for (ResourceInfo entity : collect) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!