list转换
List<SysDept> deptTrees; deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); TreeSelect是需要转换的list public TreeSelect(SysDept dept) { this.id = dept.getDeptId(); // this.level = dept.getLevel(); this.label = dept.getDeptName(); this.status = dept.getStatus(); this.fbfbm = dept.getFbfbm(); }
TreeSelect中新建构造方法。把需要复制的属性一一赋值。
nnjk