master
parent
6de6111a6c
commit
ebd2b29f70
|
|
@ -125,7 +125,7 @@ public class SzTreatmentBasisController{
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
parentList.forEach(this::trim);
|
parentList.forEach(this::trim);
|
||||||
parentList.removeIf(node -> CollectionUtils.isEmpty(node.getChildren()));
|
parentList.removeIf(node -> CollectionUtils.isEmpty(node.getChildren()) && (Integer.valueOf(0).equals(node.getDisplay()) || node.getDisplay() == null));
|
||||||
|
|
||||||
return R.ok(parentList);
|
return R.ok(parentList);
|
||||||
}
|
}
|
||||||
|
|
@ -135,19 +135,11 @@ public class SzTreatmentBasisController{
|
||||||
boolean isMiddleNode = false;
|
boolean isMiddleNode = false;
|
||||||
if (CollectionUtils.isNotEmpty(children)) {
|
if (CollectionUtils.isNotEmpty(children)) {
|
||||||
isMiddleNode = true;
|
isMiddleNode = true;
|
||||||
Iterator<SzTreatmentBasis> iterator = children.iterator();
|
|
||||||
// while (iterator.hasNext()) {
|
|
||||||
// SzTreatmentBasis child = iterator.next();
|
|
||||||
// boolean f = trim(child);
|
|
||||||
// if (f) {
|
|
||||||
// iterator.remove();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
children.removeIf(this::trim);
|
children.removeIf(this::trim);
|
||||||
}
|
}
|
||||||
//没有子节点的节点,且display是0,是末端节点;没有子节点的节点,且曾经有过子节点,是中间节点
|
//没有子节点的节点,且display是0,是末端节点;没有子节点的节点,且曾经有过子节点,是中间节点
|
||||||
//末端节点的display是0就删,中间节点没有子节点就删
|
//末端节点的display是0就删,中间节点没有子节点就删
|
||||||
return CollectionUtils.isEmpty(children) && (Integer.valueOf(0).equals(node.getDisplay()) || isMiddleNode);
|
return CollectionUtils.isEmpty(children) && (isMiddleNode || Integer.valueOf(0).equals(node.getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "删除")
|
@Operation(summary = "删除")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue