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

优化

parent 1f0db93b
No preview for this file type
No preview for this file type
......@@ -65,7 +65,7 @@ def main():
relations_dict = api.sku_relations()
# 下载并读取list数据
list_data = export_list_read_data()
list_data = list_data[220:]
log.info(f"共计:{len(list_data)} 订单")
new_list_data = []
......@@ -87,17 +87,17 @@ def main():
relation = relations_dict.get(item_row.get('ASIN'))
erp_sku = relation.get('erp_sku')
data_dict = data.to_dict()
data_dict['Return Date'] = data_dict['Return Date'].strftime('%m/%d/%Y')
data_dict['Return ID'] = str(data_dict['Return ID'])
data_dict['PO'] = item_row.get('Purchase order')
data_dict['ASIN'] = item_row.get('ASIN')
data_dict['SKU'] = erp_sku if erp_sku is not None else "",
data_dict['Quantity'] = item_row.get('Quantity')
# 替换回会数量和金额为详情里面的值
data_dict['Return quantity'] = item_row.get('Quantity')
data_dict['Total cost'] = item_row.get('Total amount')
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'),
'SKU': erp_sku if erp_sku is not None else "",
'Quantity': item_row.get('Quantity'),
# 替换回会数量和金额为详情里面的值
'Return quantity': item_row.get('Quantity'), # 替换回会数量
'Total cost': item_row.get('Total amount') # 替换金额
})
# 追加数据
new_list_data.append(data_dict)
......
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