Skip to content
当前页大纲

bug 记录

java
1.这个p.getYuanProjectId() 和 pjt.getId() 都是long 类型,值也相等,但是就是查不出来  
                  String splitProjectItemIds = list.stream().filter( p -> p.getYuanProjectId() == pjt.getId())
                         .map(p -> p.getYuanProjectItemId().toString())
                         .distinct()
                         .collect(Collectors.joining(","));
            2.修改之后
                 String splitProjectItemIds = list.stream()
                        .filter(p -> {
                            boolean matches = p.getYuanProjectId().equals(pjt.getId());
                            return matches;
                        })
                        .map(p -> {
                            Long itemId = p.getYuanProjectItemId();
                            return itemId;
                        })
                        .filter(Objects::nonNull)  // 确保过滤掉 null 值
                        .map(String::valueOf)
                        .distinct()
                        .collect(Collectors.joining(","));

MIT License.