区域,公司id 改INT
This commit is contained in:
parent
f3179d65c5
commit
027bc4eedf
|
|
@ -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<>());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue