lambda表达式将List对象某个字段转换以逗号分隔的String类型
StringBuffer sb = new StringBuffer();
//获取节点id
list.forEach(ztree -> {
if (!(infoParentId.equals((ztree.getpId())))) {
sb.append(ztree.getId()).append(",");
}
});
sb.deleteCharAt(sb.length() - 1);
String str = sb.toString();