Commit f1dd204b authored by 邱阿朋's avatar 邱阿朋

feat(vc): 支持按国家区分ASIN关联关系

- 修改return_goods模块,使用ASIN和国家组合键查询关联关系
- 修改spa模块,使用ASIN和国家组合键查询关联关系
- 确保不同国家相同ASIN能正确匹配对应关系数据
parent 1ec3ece6
......@@ -83,14 +83,16 @@ class ReturnGoods(AutoInterface):
})
for _, item_row in item_data_result.iterrows():
relation = relations_dict.get(item_row.get('ASIN'), {})
asin = item_row.get('Asin', None)
country_key = f"{asin}_{self.country}"
relation = relations_dict.get(country_key, {})
erp_sku = relation.get('erp_sku', "")
data_dict = data.to_dict()
data_dict.update({
'Return Date': data_dict['Return Date'].strftime('%m/%d/%Y'),
'Return ID': str(data_dict['Return ID']),
'PO': item_row.get('Purchase order', ""),
'ASIN': item_row.get('ASIN', ""),
'ASIN': asin,
'SKU': erp_sku,
'Quantity': item_row.get('Quantity', 0),
# 替换回会数量和金额为详情里面的值
......
......@@ -131,7 +131,8 @@ class Spa(AutoInterface):
if not self.__validate_asin(asin):
continue
relation = relation_data.get(asin, {})
country_key = f"{asin}_{self.country}"
relation = relation_data.get(country_key, {})
rebate = item.get("Rebate In Agreement Currency", None)
vendor_funding = item.get("Vendor Funding In Agreement Currency", None)
original_balance = rebate or vendor_funding
......@@ -166,7 +167,8 @@ class Spa(AutoInterface):
if not self.__validate_asin(asin):
continue
relation = relation_data.get(asin, {})
country_key = f"{asin}_{self.country}"
relation = relation_data.get(country_key, {})
rebate = item.get("Rebate In Agreement Currency", None)
vendor_funding = item.get("Vendor Funding In Agreement Currency", None)
original_balance = rebate or vendor_funding
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment