关联模块
This commit is contained in:
@@ -65,4 +65,11 @@ public class SarModelTree extends BaseEntity {
|
|||||||
@TableField(exist=false)
|
@TableField(exist=false)
|
||||||
private List<String> childMenuIds;
|
private List<String> childMenuIds;
|
||||||
|
|
||||||
|
@TableField("HAS_CHILDREN")
|
||||||
|
private String hasChildren;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private boolean leaf;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -33,6 +33,14 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
|||||||
// tree.setChildren(recursionGetChildren((tree)));
|
// tree.setChildren(recursionGetChildren((tree)));
|
||||||
// }
|
// }
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
|
switch (item.getHasChildren()){
|
||||||
|
case "0":
|
||||||
|
item.setLeaf(true);
|
||||||
|
break;
|
||||||
|
case "1":
|
||||||
|
item.setLeaf(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
item.setId(item.getName());
|
item.setId(item.getName());
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
@@ -55,6 +63,14 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
children.forEach(item->{
|
children.forEach(item->{
|
||||||
|
switch (item.getHasChildren()){
|
||||||
|
case "0":
|
||||||
|
item.setLeaf(true);
|
||||||
|
break;
|
||||||
|
case "1":
|
||||||
|
item.setLeaf(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
item.setId(item.getName());
|
item.setId(item.getName());
|
||||||
});
|
});
|
||||||
return children;
|
return children;
|
||||||
|
|||||||
Reference in New Issue
Block a user