feat: 树形改为isLeaf
This commit is contained in:
@@ -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;
|
||||
|
||||
/**
|
||||
* 子零部件
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user