提交 97d15c40 authored 作者: renjianyu's avatar renjianyu

--no commit message

上级 cd490628
......@@ -1196,10 +1196,10 @@ public class EbookController {
public List<ChapterLibrary> tree(List<ChapterLibrary> list,List<ChapterLibrary> voList){
voList.forEach(entity ->{
//第一次设置 一级分类的子类 后续递归设置 子类的子类
entity.setList(Copy.copyList(list, ChapterLibrary.class,obj -> obj.getParentId().equals(entity.getMarkId())));
entity.setChapterList(Copy.copyList(list, ChapterLibrary.class,obj -> obj.getParentId().equals(entity.getMarkId())));
//当前分类存在子类 开始递归子类
if(entity.getList().size() > 0){
tree(list, entity.getList());
if(entity.getChapterList().size() > 0){
tree(list, entity.getChapterList());
}
});
return voList;
......
......@@ -54,7 +54,7 @@ public class ChapterLibrary implements java.io.Serializable {
@Transient
@ApiModelProperty(value = "子目录")
private List<ChapterLibrary> list = new ArrayList<ChapterLibrary>();
private List<ChapterLibrary> chapterList = new ArrayList<ChapterLibrary>();
@Transient
@ApiModelProperty(value = "绑定资源状态")
......
......@@ -474,10 +474,10 @@ public class FgEbookController {
public List<ChapterLibrary> tree(List<ChapterLibrary> list,List<ChapterLibrary> voList){
voList.forEach(entity ->{
//第一次设置 一级分类的子类 后续递归设置 子类的子类
entity.setList(Copy.copyList(list, ChapterLibrary.class,obj -> obj.getParentId().equals(entity.getMarkId())));
entity.setChapterList(Copy.copyList(list, ChapterLibrary.class,obj -> obj.getParentId().equals(entity.getMarkId())));
//当前分类存在子类 开始递归子类
if(entity.getList().size() > 0){
tree(list, entity.getList());
if(entity.getChapterList().size() > 0){
tree(list, entity.getChapterList());
}
});
return voList;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论