diff --git a/storage_resource/product_interface.py b/storage_resource/product_interface.py index 03fc363..84d4346 100644 --- a/storage_resource/product_interface.py +++ b/storage_resource/product_interface.py @@ -147,17 +147,8 @@ async def calculate_product_cost(resource_ref_id, usage_data, user_org_id=None): amount = sum(getattr(p, 'amount', 0) for p in prices) - # 客户折扣:资源真实定价 × 客户折扣 = 成交价(照 llmage 范式) - discount = 1.0 - if user_org_id: - try: - d = await env.get_customer_discount( - getattr(spec, 'org_id', '') or '0', user_org_id) - if d not in (None, '', 0): - discount = float(d) - except Exception: - discount = 1.0 - - return {'success': True, 'amount': round(amount * discount, 6), + # 资源层只算真实定价(原价)。产品级折扣(客户/分销商/供应商)由产品层 + # calculate_product_cost 按 product_id 精确计算,见 product_management.core。 + return {'success': True, 'amount': round(amount, 6), 'original_amount': round(amount, 6), - 'cost': 0.0, 'discount': discount, 'pricing_program_id': ppid} + 'cost': 0.0, 'discount': 1.0, 'pricing_program_id': ppid}