fix(ops): 修复区域路径拼接重复问题
在构建区域完整路径时,跳过当前区域ID,避免parentPath中 包含当前区域时导致名称重复拼接 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
This commit is contained in:
@@ -447,9 +447,13 @@ public class CleanOrderServiceImpl implements CleanOrderService {
|
|||||||
Map<Long, OpsBusAreaDO> parentMap = parents.stream()
|
Map<Long, OpsBusAreaDO> parentMap = parents.stream()
|
||||||
.collect(Collectors.toMap(OpsBusAreaDO::getId, Function.identity()));
|
.collect(Collectors.toMap(OpsBusAreaDO::getId, Function.identity()));
|
||||||
|
|
||||||
// 按 parentPath 顺序拼接
|
// 按 parentPath 顺序拼接(排除当前区域)
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (Long pid : parentIdList) {
|
for (Long pid : parentIdList) {
|
||||||
|
// 跳过当前区域,避免重复拼接
|
||||||
|
if (pid.equals(areaId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
OpsBusAreaDO parent = parentMap.get(pid);
|
OpsBusAreaDO parent = parentMap.get(pid);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
sb.append(parent.getAreaName());
|
sb.append(parent.getAreaName());
|
||||||
|
|||||||
Reference in New Issue
Block a user