Merge remote-tracking branch '惠信/develop' into develop

This commit is contained in:
曹鹏飞 2025-02-16 23:03:53 +08:00
commit 47038a8aeb
2 changed files with 17 additions and 0 deletions

View File

@ -104,10 +104,12 @@ public class AdminBaseAreaService {
.collect(Collectors.toMap(TBaseAreaVO::getId,area->area, (existing, replacement) -> existing));
List<TBaseAreaVO> roots = new ArrayList<>();
// List<TBaseAreaVO> resultNodes= nodes.stream().sorted((n1, n2) -> Integer.compare(n2.getId(), n1.getId())).collect(Collectors.toList());
for (TBaseAreaVO node : nodes) {
TBaseAreaVO parent = idToNodeMap.get(node.getParentAreaRowId());
if (parent != null) {
if(null==parent.getChildren()) {
parent.setChildren(new ArrayList<>());
}

View File

@ -7,6 +7,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
/**
* <p>
@ -82,4 +83,18 @@ public class TBaseAreaVO implements Serializable {
* 子级列表
*/
private List<TBaseAreaVO> children;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TBaseAreaVO that = (TBaseAreaVO) o;
return Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}