Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

把查到的数据,根据getValue()过滤,筛选出getValue()为null的值,然后以 getId(),组装成List #157

Open
Zakariyya opened this issue Feb 10, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Zakariyya
Copy link
Owner

功能:
把查到的数据,根据getValue()过滤,筛选出getValue()为null的值,然后以 getId(),组装成List

    List<MaterialAttribute> findByPid = this.list(new MaterialAttribute().setParentId(oneById.getId()).queryWrapper());
    List<MaterialAttribute> filterList = new ArrayList();
    List<Long> idList = new ArrayList();
    findByPid.forEach(x->{
      if(StringUtils.isEmpty(x.getValue())){
        filterList.add(x);
      }
    });
    filterList.forEach(x->{
      idList.add(x.getId());
    });
//    return idList;
//----------------------------------------------------------------------------------------------------------------------------------------
    List<Long> collect = ((List<MaterialAttribute>) this.list(new MaterialAttribute().setParentId(oneById.getId()).queryWrapper())).stream()
      .filter(x -> StringUtil.isEmpty(x.getValue())).collect(Collectors.toList()).stream().map(MaterialAttribute::getId).collect(Collectors.toList());
//    return collect;
@Zakariyya Zakariyya added the documentation Improvements or additions to documentation label Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant