区域,公司id 改INT

This commit is contained in:
luolm 2025-02-16 22:44:05 +08:00
parent f3179d65c5
commit 027bc4eedf
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)); .collect(Collectors.toMap(TBaseAreaVO::getId,area->area, (existing, replacement) -> existing));
List<TBaseAreaVO> roots = new ArrayList<>(); 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) { for (TBaseAreaVO node : nodes) {
TBaseAreaVO parent = idToNodeMap.get(node.getParentAreaRowId()); TBaseAreaVO parent = idToNodeMap.get(node.getParentAreaRowId());
if (parent != null) { if (parent != null) {
if(null==parent.getChildren()) { if(null==parent.getChildren()) {
parent.setChildren(new ArrayList<>()); parent.setChildren(new ArrayList<>());
} }

View File

@ -7,6 +7,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* <p> * <p>
@ -82,4 +83,18 @@ public class TBaseAreaVO implements Serializable {
* 子级列表 * 子级列表
*/ */
private List<TBaseAreaVO> children; 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);
}
} }