Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
data_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9867575e
authored
Aug 26, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
modify script
parent
63ec1cee
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
handle.py
handle.py
View file @
9867575e
...
...
@@ -99,21 +99,24 @@ def resolve(file_name: str, supplier_id: int):
table
[
"ladder_price"
]
.
append
(
item_map
)
ans
=
json
.
dumps
(
table
,
ensure_ascii
=
False
)
producer
.
push
(
ans
)
os
.
remove
(
file_name
)
producer
.
close
()
def
process
(
url
:
str
,
supplier_id
:
int
):
# http://erp.liexindev.net/sku/20240823/p6jMKaPtjMpNnZMK5vEX3KEQf7Gdvgvw3TCA7d6b.xls
abs_path
=
""
try
:
response
=
requests
.
get
(
url
)
if
response
.
status_code
==
200
:
tmp_file
=
url
.
split
(
sep
=
"/"
)[
-
1
]
absolute_path
=
config
.
tmp_xls_file_dir
+
tmp_file
abs_path
=
absolute_path
with
open
(
absolute_path
,
"wb"
)
as
f
:
f
.
write
(
response
.
content
)
resolve
(
absolute_path
,
supplier_id
)
except
Exception
as
e
:
print
(
e
)
finally
:
os
.
remove
(
abs_path
)
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