This commit is contained in:
PQZ 2025-06-30 16:00:00 +08:00
parent 8a3325e083
commit b3fdf26a52
2 changed files with 8 additions and 4 deletions

View File

@ -126,6 +126,7 @@ public class BusiProdController extends BaseController
item.setFileType(FILE_TYPE_PRODUCT); item.setFileType(FILE_TYPE_PRODUCT);
}); });
} }
busiProdNewService.setAmount(prodNewVO.getTenantId());
return success(); return success();
} }

View File

@ -99,14 +99,17 @@ public class BusiCategoryServiceImpl extends ServiceImpl<BusiCategoryMapper, Bus
} }
// 构建树结构找出根节点 // 构建树结构找出根节点
BusiCategory root = null; // 找到所有根节点parentId为null
List<BusiCategory> roots = new ArrayList<>();
for (BusiCategory category : categoryList) { for (BusiCategory category : categoryList) {
if (category.getParentId() == null) { if (category.getParentId() == null) {
root = category; roots.add(category);
} }
} }
// 递归统计 // 遍历每个根节点递归统计
calculateProdsAll(root, categoryList); for (BusiCategory root : roots) {
calculateProdsAll(root, categoryList);
}
return categoryList; return categoryList;
} }