调整
This commit is contained in:
parent
54525e6ce7
commit
09a5c7da55
@ -93,13 +93,7 @@ public class BusiCategoryServiceImpl extends ServiceImpl<BusiCategoryMapper, Bus
|
||||
if (categoryList == null || categoryList.isEmpty()) {
|
||||
return categoryList;
|
||||
}
|
||||
// 构建id到节点的映射,便于查找
|
||||
Map<String, BusiCategory> idToCategory = new HashMap<>();
|
||||
for (BusiCategory category : categoryList) {
|
||||
idToCategory.put(category.getId(), category);
|
||||
}
|
||||
|
||||
// 构建树结构(找出根节点)
|
||||
// 找到所有根节点(parentId为null)
|
||||
List<BusiCategory> roots = new ArrayList<>();
|
||||
for (BusiCategory category : categoryList) {
|
||||
|
Loading…
Reference in New Issue
Block a user