From 29519067856ec090c3afec3cc1f158e6abc8ceb6 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Mon, 31 Mar 2025 15:17:43 +0800 Subject: [PATCH] 2 --- timer/external_order_glb.py | 26 ++++++++++++++------------ timer/get_task_to_db.py | 12 ++++++------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/timer/external_order_glb.py b/timer/external_order_glb.py index 25b3498..6c87610 100644 --- a/timer/external_order_glb.py +++ b/timer/external_order_glb.py @@ -43,6 +43,8 @@ def find_pid_objname(pid): if obj.name.startswith(str(pid)): return obj.name + + #加载obj文件 def reload_obj(pid): @@ -50,18 +52,18 @@ def reload_obj(pid): libs.down_obj_from_oss(config.workdir, pid, "print") # obj = reload_obj(pid, action) #执行获取obj缩略图 - print("执行获取obj全身缩略图脚本") - os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://print/{pid} -o D://print/{pid}') - #判断文件是否存在,存在则上传到oss, 更新数据库内容 - if os.path.exists(f'D://print/{pid}/{pid}_pic.png'): - #获取拍照订单的信息,从中得到拍照订单的信息 - imagePathT = get_p3d_info(str(pid)) - if imagePathT != 0: - print("imagePathT",imagePathT) - config.oss_bucket_website.put_object_from_file(f'{imagePathT}', f'D://print/{pid}/{pid}_pic.png') - #请求接口 - res = requests.post("https://mp.api.suwa3d.com/api/printOrder/updateCoverByPidForExternalOrder", data={'pid': pid, 'image_path': 'https://www.suwa3d.com/'+imagePathT}) - print("res",res) + # print("执行获取obj全身缩略图脚本") + # os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://print/{pid} -o D://print/{pid}') + # #判断文件是否存在,存在则上传到oss, 更新数据库内容 + # if os.path.exists(f'D://print/{pid}/{pid}_pic.png'): + # #获取拍照订单的信息,从中得到拍照订单的信息 + # imagePathT = get_p3d_info(str(pid)) + # if imagePathT != 0: + # print("imagePathT",imagePathT) + # config.oss_bucket_website.put_object_from_file(f'{imagePathT}', f'D://print/{pid}/{pid}_pic.png') + # #请求接口 + # res = requests.post("https://mp.api.suwa3d.com/api/printOrder/updateCoverByPidForExternalOrder", data={'pid': pid, 'image_path': 'https://www.suwa3d.com/'+imagePathT}) + # print("res",res) obj_filename = os.path.join(config.workdir,'print',pid,f'{pid}.obj') bpy.ops.wm.read_homefile() diff --git a/timer/get_task_to_db.py b/timer/get_task_to_db.py index dd5a2c9..6361912 100644 --- a/timer/get_task_to_db.py +++ b/timer/get_task_to_db.py @@ -48,14 +48,14 @@ def readTask(key): pid = pid.decode('utf-8') #判断影棚类型 - ps_type = get_ps_type(pid) - if ps_type == 2: + #ps_type = get_ps_type(pid) + #if ps_type == 2: #方形影棚 # r.rpush('ai:ai_repeat_build',pid) - r.rpush('ai:ai_repeat_build',pid) - print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())+"-方形影棚数据推入到新的建模方式的重建队列") - common.notify("方形影棚数据推入到新的建模方式的重建队列 (ai:ai_repeat_build),pid="+pid) - return + r.rpush('ai:ai_repeat_build',pid) + #print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())+"-方形影棚数据推入到新的建模方式的重建队列") + common.notify("推入到新的建模方式的重建队列 (ai:ai_repeat_build),pid="+pid) + return psid = getPSid(pid) #判断是否走新的建模系统 2023-11-10 全部走新的建模系统