Merge remote-tracking branch '惠信/develop' into develop
This commit is contained in:
commit
47038a8aeb
|
|
@ -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<>());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue