主题 : -902错误 |
级别: 总版主
|
2# 发表于:2023-01-04 11:15:06 IP:125.12.*.*
@Transient
public Boolean getIsBottom() { //只相差1那中间肯定没有子栏目,这样效率更高效 if (getRgt() - getLft() == 1) { return true; } Set<Channel> childs = getChild(); if (childs == null) { return true; } // 判断是否为根节点 if (childs.isEmpty()) { return true; } else { int i = 0; for (Channel channel : childs) { if (channel.getRecycle()) { i++; } /**子栏目数量大于2,只要有1个是未回收状态,则说明有子节点,及早退出循环*/ if(childs.size()>=2){ return false; } } // 如果在回收站的个数小于总个数表示不是根节点 if (i < childs.size()) { return false; } return true; } } |
||
---|---|---|---|
1
共1页