Compare commits
No commits in common. "702ccbc7685a7222a06001f4267341b995f299ba" and "cd8d6a1adb2128481075f9a847c181e300b5b965" have entirely different histories.
702ccbc768
...
cd8d6a1adb
@ -93,7 +93,13 @@ 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