feat: 树形改为isLeaf

This commit is contained in:
2024-08-06 20:32:11 +08:00
parent 941bf5179e
commit 5640c9ed85
4 changed files with 10 additions and 10 deletions
@@ -179,11 +179,11 @@ public class SysDictItem implements TreeNode {
private List<SysDictItem> childrenList;
/**
* 是否还有子集
* 是否是叶子节点
*/
@TableField(exist = false)
@ApiModelProperty(value = "是否还有子集")
private boolean hasChild;
@ApiModelProperty(value = "是否是叶子节点")
private boolean isLeaf;
@Override
public String obtainTreeNodeId() {
@@ -99,11 +99,11 @@ public class PartName implements Serializable, TreeNode {
private String parentCode;
/**
* 父级分类内部码(根节点0
* 是否是叶子节点
*/
@ApiModelProperty(value = "父级分类内部码(根节点0")
@ApiModelProperty(value = "是否是叶子节点")
@TableField(exist = false)
private boolean hasChild;
private boolean isLeaf;
/**
* 子零部件
@@ -40,7 +40,7 @@ public class DictTreeService {
List<SysDictItem> childList = dictItemService.list(queryWrapper);
list.forEach(item -> {
if (childList.stream().anyMatch(child -> child.getParentId().equals(item.getId()))) {
item.setHasChild(true);
item.setLeaf(false);
}
});
return list;
@@ -73,7 +73,7 @@ public class DictTreeService {
List<SysDictItem> childList = dictItemService.list(queryWrapper);
list.forEach(item -> {
if (childList.stream().anyMatch(child -> child.getParentId().equals(item.getId()))) {
item.setHasChild(true);
item.setLeaf(false);
}
});
return list;
@@ -196,7 +196,7 @@ public class PartNameServiceImpl extends ServiceImpl<PartNameMapper, PartName>
List<PartName> childList = list(queryWrapper);
list.forEach(item -> {
if (childList.stream().anyMatch(child -> child.getParentCode().equals(item.getCode()))) {
item.setHasChild(true);
item.setLeaf(false);
}
});
return list;
@@ -221,7 +221,7 @@ public class PartNameServiceImpl extends ServiceImpl<PartNameMapper, PartName>
List<PartName> childList = list(queryWrapper);
list.forEach(item -> {
if (childList.stream().anyMatch(child -> child.getParentCode().equals(item.getCode()))) {
item.setHasChild(true);
item.setLeaf(false);
}
});
return list;