1
This commit is contained in:
1 parent
732b7e37ea
commit
8c03af2214
2 files changed
+20
-23
No files matched your search
@@ -121,25 +121,6 @@ def checkDownloadFile(pid):
|
||||
|
||||
#加载obj文件
|
||||
def reload_obj(pid,order_ids):
|
||||
|
||||
#下载obj文件
|
||||
down_obj_from_oss(config.workdir, pid, "print")
|
||||
|
||||
#检测mtl 文件是否正常,
|
||||
isNormal = checkDownloadFile(pid)
|
||||
if isNormal == False:
|
||||
print(f'{pid}的mtl文件检测出现问题,不执行该笔任务,调用取消的接口')
|
||||
for order_id in order_ids:
|
||||
url = f"https://mp.api.suwa3d.com/api/order/cancelExternalOrder?id={order_id}&typename=system"
|
||||
response = requests.get(url)
|
||||
response = response.json()
|
||||
if response['code'] != 1000:
|
||||
continue
|
||||
print(f'取消订单{order_id}成功')
|
||||
return
|
||||
|
||||
|
||||
|
||||
for order_id in order_ids:
|
||||
print(order_id)
|
||||
#url 请求
|
||||
@@ -307,6 +288,21 @@ def export_and_update_glbs(pid,order_ids):
|
||||
|
||||
def createGlb(pid,order_ids):
|
||||
|
||||
#下载obj文件
|
||||
down_obj_from_oss(config.workdir, pid, "print")
|
||||
|
||||
#检测mtl 文件是否正常,
|
||||
isNormal = checkDownloadFile(pid)
|
||||
if isNormal == False:
|
||||
print(f'{pid}的mtl文件检测出现问题,不执行该笔任务,调用取消的接口')
|
||||
for order_id in order_ids:
|
||||
url = f"https://mp.api.suwa3d.com/api/order/cancelExternalOrder?id={order_id}&typename=system"
|
||||
response = requests.get(url)
|
||||
response = response.json()
|
||||
if response['code'] != 1000:
|
||||
continue
|
||||
print(f'取消订单{order_id}成功')
|
||||
return
|
||||
|
||||
base_fix(pid,order_ids)
|
||||
export_and_update_glbs(pid,order_ids)
|
||||
|
||||
@@ -48,10 +48,11 @@ def find_pid_objname(pid):
|
||||
|
||||
def down_obj_from_oss(workdir, pid, action):
|
||||
if os.path.exists(os.path.join(workdir, action, pid)):
|
||||
print(f'目录{os.path.join(workdir, action, pid)}已存在,跳过')
|
||||
return
|
||||
else:
|
||||
os.makedirs(os.path.join(workdir, action, pid))
|
||||
#print(f'目录{os.path.join(workdir, action, pid)}已存在,跳过')
|
||||
#return
|
||||
shutil.rmtree(os.path.join(workdir, action, pid))
|
||||
|
||||
os.makedirs(os.path.join(workdir, action, pid))
|
||||
|
||||
# 根据前缀获取文件列表
|
||||
prefix = f'objs/print/{pid}/base/model/'
|
||||
|
||||
Reference in new issue
Block a user