Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EMUAFactory
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
mayinghao
EMUAFactory
Commits
75dbfedd
Commit
75dbfedd
authored
Mar 25, 2026
by
mayinghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加版本支持
parent
2b5d9de7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
config.py
multipleThread/config.py
+27
-3
thread_upload.py
multipleThread/thread_upload.py
+16
-9
No files found.
multipleThread/config.py
View file @
75dbfedd
...
@@ -5,11 +5,35 @@ auth = oss2.Auth(aliyun_key, aliyun_secret)
...
@@ -5,11 +5,35 @@ auth = oss2.Auth(aliyun_key, aliyun_secret)
endpoint
=
"https://oss-cn-shanghai.aliyuncs.com"
endpoint
=
"https://oss-cn-shanghai.aliyuncs.com"
region
=
"cn-shanghai"
region
=
"cn-shanghai"
bucket
=
oss2
.
Bucket
(
auth
,
endpoint
,
"qgongye"
,
region
=
region
)
bucket
=
oss2
.
Bucket
(
auth
,
endpoint
,
"qgongye"
,
region
=
region
)
version
=
"release"
# 分片大小
# 分片大小
part_size
=
5
*
1024
*
1024
part_size
=
5
*
1024
*
1024
# 阿里云前缀
# 阿里云前缀
name_prefix
=
"https://qgongye.oss-cn-shanghai.aliyuncs.com
\\
upload/order"
name_prefix
=
"https://qgongye.oss-cn-shanghai.aliyuncs.com
\\
upload/order"
# 回调地址
# 回调地址
callback_url
=
"https://uat.emku.laidecloud.com/console/productOrder/filePthSave.ajax"
if
version
==
"test"
:
goods_callback_url
=
"https://uat.emku.laidecloud.com/console/productOrder/goodsFilePthSave.ajax"
callback_url
=
"http://uat.vue.emku.laidecloud.com/console/productOrder/filePthSave.ajax"
\ No newline at end of file
goods_callback_url
=
"http://uat.vue.emku.laidecloud.com/console/productOrder/goodsFilePthSave.ajax"
login_url
=
'http://uat.vue.emku.laidecloud.com/console/pc/userLoginByToken.ajax'
# order信息地址
order_info_url
=
"http://uat.vue.laidecloud.com/console/productOrder/experimentOrderList.ajax"
# order detail
order_detail_url
=
"http://uat.vue.laidecloud.com/console/productOrder/uploadorderdetail.ajax"
product_manager_url
=
"http://uat.vue.emku.laidecloud.com/console/goods/goods_list.ajax"
product_callback_url
=
"http://uat.vue.emku.laidecloud.com/console/seller/getFiles.ajax"
#获取上传文件列表
fileupload_url
=
"http://uat.vue.emku.laidecloud.com/console/productOrder/onupload.ajax"
else
:
callback_url
=
"https://emku.laidecloud.com/console/productOrder/filePthSave.ajax"
login_url
=
'https://emku.laidecloud.com/console/pc/userLoginByToken.ajax'
# order信息地址
order_info_url
=
"https://emku.laidecloud.com/console/productOrder/experimentOrderList.ajax"
# order detail
order_detail_url
=
"https://emku.laidecloud.com/console/productOrder/uploadorderdetail.ajax"
product_manager_url
=
"http://emku.laidecloud.com/console/goods/goods_list.ajax"
product_callback_url
=
"https://emku.laidecloud.com/console/seller/getFiles.ajax"
# 获取上传文件列表
fileupload_url
=
"https://emku.laidecloud.com/console/productOrder/onupload.ajax"
goods_callback_url
=
"https://emku.laidecloud.com/console/productOrder/goodsFilePthSave.ajax"
multipleThread/thread_upload.py
View file @
75dbfedd
...
@@ -11,8 +11,8 @@ from oss2 import SizedFileAdapter
...
@@ -11,8 +11,8 @@ from oss2 import SizedFileAdapter
import
uuid
import
uuid
from
oss2.models
import
PartInfo
from
oss2.models
import
PartInfo
from
.config
import
*
from
.config
import
*
product_callback_url
=
"https://emku.laidecloud.com/console/seller/getFiles.ajax"
print
(
f
"f{product_manager_url} ======>"
)
def
nanoseconds_to_date
(
nano_seconds
):
def
nanoseconds_to_date
(
nano_seconds
):
timestamp
=
nano_seconds
/
1000
timestamp
=
nano_seconds
/
1000
...
@@ -30,7 +30,6 @@ def process_data(data):
...
@@ -30,7 +30,6 @@ def process_data(data):
result
.
append
([
j
[
"info"
],
"设计资料"
,
j
[
'addTime'
]])
result
.
append
([
j
[
"info"
],
"设计资料"
,
j
[
'addTime'
]])
for
j
in
data
[
"obj"
][
"files2"
]:
for
j
in
data
[
"obj"
][
"files2"
]:
result
.
append
([
j
[
"info"
],
"Bom资料"
,
j
[
'addTime'
]])
result
.
append
([
j
[
"info"
],
"Bom资料"
,
j
[
'addTime'
]])
print
(
result
)
return
result
return
result
...
@@ -44,7 +43,7 @@ class Upload_Thread(QObject):
...
@@ -44,7 +43,7 @@ class Upload_Thread(QObject):
finishSignal
=
pyqtSignal
()
finishSignal
=
pyqtSignal
()
updateSignal
=
pyqtSignal
(
tuple
)
updateSignal
=
pyqtSignal
(
tuple
)
def
__init__
(
self
,
thread_num
=
0
,
order_id
=
None
,
type_info
=
None
,
token
=
""
):
def
__init__
(
self
,
thread_num
=
0
,
order_id
=
None
,
type_info
=
None
,
token
=
""
,
version_id
=
""
):
QObject
.
__init__
(
self
)
QObject
.
__init__
(
self
)
# 要发送的文件地址
# 要发送的文件地址
self
.
_filename
=
''
self
.
_filename
=
''
...
@@ -60,6 +59,8 @@ class Upload_Thread(QObject):
...
@@ -60,6 +59,8 @@ class Upload_Thread(QObject):
self
.
type_info
=
type_info
self
.
type_info
=
type_info
self
.
order_id
=
order_id
self
.
order_id
=
order_id
self
.
token
=
token
self
.
token
=
token
print
(
f
"-------->{self.token}"
)
self
.
version_id
=
version_id
def
pause
(
self
):
def
pause
(
self
):
self
.
_isPause
=
True
self
.
_isPause
=
True
...
@@ -176,26 +177,32 @@ class Upload_Thread(QObject):
...
@@ -176,26 +177,32 @@ class Upload_Thread(QObject):
bucket
.
complete_multipart_upload
(
oss_key
,
upload_id
,
parts
,
headers
=
headers
)
bucket
.
complete_multipart_upload
(
oss_key
,
upload_id
,
parts
,
headers
=
headers
)
if
os
.
path
.
exists
(
"./upload_tag/tmp_"
+
key
+
".json"
):
if
os
.
path
.
exists
(
"./upload_tag/tmp_"
+
key
+
".json"
):
os
.
remove
(
"./upload_tag/tmp_"
+
key
+
".json"
)
os
.
remove
(
"./upload_tag/tmp_"
+
key
+
".json"
)
datas
=
{
"id"
:
str
(
self
.
order_id
),
"name"
:
self
.
uuid_str
+
"."
+
extension
,
"path"
:
name_prefix
,
"info"
:
key
,
datas
=
{
"id"
:
str
(
self
.
order_id
),
"name"
:
self
.
uuid_str
+
"."
+
extension
,
"path"
:
name_prefix
,
"info"
:
key
,
"type"
:
self
.
type_info
}
"type"
:
self
.
type_info
,
"product_version_id"
:
self
.
version_id
}
print
(
f
"datas {datas}"
)
headers
=
{
'token'
:
self
.
token
,
headers
=
{
'token'
:
self
.
token
,
'User-Agent'
:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
'User-Agent'
:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
if
self
.
type_info
>=
12
:
if
self
.
type_info
>=
12
:
try
:
try
:
response
=
requests
.
post
(
goods_callback_url
,
data
=
datas
,
headers
=
headers
)
response
=
requests
.
post
(
goods_callback_url
,
data
=
datas
,
headers
=
headers
)
res
=
response
.
json
()
res
=
response
.
json
()
print
(
res
[
"obj"
])
version_id
=
self
.
version_id
response
=
requests
.
post
(
product_callback_url
,
data
=
{
"id"
:
self
.
order_id
},
headers
=
headers
)
if
self
.
version_id
==
-
1
:
version_id
=
-
1
response
=
requests
.
post
(
product_callback_url
,
data
=
{
"id"
:
self
.
order_id
,
"product_version_id"
:
version_id
},
headers
=
headers
)
data
=
response
.
json
()
data
=
response
.
json
()
res
=
process_data
(
data
)
res
=
process_data
(
data
)
print
(
res
)
self
.
finishSignal2
.
emit
(
res
,
self
.
order_id
)
self
.
finishSignal2
.
emit
(
res
,
self
.
order_id
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"wrong 1
"
)
print
(
f
"wrong 1{e}
"
)
else
:
else
:
# try:
# try:
if
datas
[
"product_version_id"
]
==
-
1
:
datas
[
"product_version_id"
]
=
''
print
(
"-----1"
)
response
=
requests
.
post
(
callback_url
,
data
=
datas
,
headers
=
headers
)
response
=
requests
.
post
(
callback_url
,
data
=
datas
,
headers
=
headers
)
res
=
response
.
json
()
res
=
response
.
json
()
print
(
res
[
"obj"
])
print
(
res
[
"obj"
])
...
...
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