Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amazon_reports
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
common
amazon_reports
Commits
f64bbdde
Commit
f64bbdde
authored
Oct 22, 2024
by
邱阿朋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理
parent
062b57ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
coop.py
coop.py
+10
-4
fetch_email.py
example/fetch_email.py
+1
-1
No files found.
coop.py
View file @
f64bbdde
...
...
@@ -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[:1
89
]
# coop_list = coop_list[:1
0
]
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"
)
...
...
example/fetch_email.py
View file @
f64bbdde
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment