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

处理

parent 062b57ef
......@@ -63,7 +63,7 @@ def get_report_table_html(invoice_id):
return report_table_html
except ElementNotFoundError:
page.refresh()
get_report_table_html()
get_report_table_html(invoice_id)
def export_item_read_data(invoice_id):
file_name = f"coop\\{invoice_id}.xlsx"
......@@ -110,11 +110,10 @@ def export_item_read_data(invoice_id):
def main():
relation_data = asin_sku_relations() # 获取 ASIN 与 SKU 的对应关系数据
coop_list = export_list_read_data() # 获取合作数据列表
# coop_list = coop_list[:189]
# coop_list = coop_list[:10]
print(f"共计:{len(coop_list)},条数据")
i = 0
new_coop_data = []
sheet_data = {}
for _, coop in coop_list.iterrows():
......@@ -149,13 +148,20 @@ def main():
# 如果 item_list 长度大于 10,使用原有数据
if len(item_list) >= 10:
new_item = item.copy()
new_item.pop("Asin")
new_item['Asin'] = asin
new_item['ERP SKU'] = relation.get("SKU")
new_item['Group Name'] = relation.get("NAME")
item_coop_data.append(new_item)
else:
# 否则新建一个条目
new_item = coop.copy()
rebate_in_agreement_currency = item.get("Rebate In Agreement Currency")
if rebate_in_agreement_currency:
new_item['Original balance'] = rebate_in_agreement_currency
vendor_funding_in_agreement_currency = item.get("Vendor Funding In Agreement Currency")
if vendor_funding_in_agreement_currency:
new_item['Original balance'] = vendor_funding_in_agreement_currency
new_item['Asin'] = asin
new_item['ERP SKU'] = relation.get("SKU")
new_item['Group Name'] = relation.get("NAME")
......
......@@ -44,7 +44,7 @@ def get_latest_unread_email():
msg = email.message_from_bytes(response_part[1])
# 获取邮件主题
subject, encoding = decode_header(msg["Subject"])[0]
subject, encoding = decode_header(str(msg["Subject"]))[0]
if isinstance(subject, bytes):
subject = subject.decode(encoding if encoding else "utf-8")
......
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