From cd5308686f327d64fa45f354aec17471566f598c Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Wed, 14 May 2025 09:14:16 +0800 Subject: [PATCH 1/2] 1 --- timer/external_order_glbV2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timer/external_order_glbV2.py b/timer/external_order_glbV2.py index ba49b78..5ebacc7 100644 --- a/timer/external_order_glbV2.py +++ b/timer/external_order_glbV2.py @@ -283,7 +283,7 @@ if __name__ == '__main__': info = json.loads(info) - pid = info['pid'] + pid = int(info['pid']) order_ids = info['order_id'] if not pid.isdigit(): From 6b509a9fcca74552664e841183a3e28a706923e3 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Wed, 14 May 2025 09:34:26 +0800 Subject: [PATCH 2/2] 1 --- timer/external_order_glbV2.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/timer/external_order_glbV2.py b/timer/external_order_glbV2.py index 5ebacc7..fe157b2 100644 --- a/timer/external_order_glbV2.py +++ b/timer/external_order_glbV2.py @@ -154,7 +154,7 @@ def base_fix(pid,order_ids): print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 模型基础校正完成') -def export_and_update_glbs(pid): +def export_and_update_glbs(pid,order_ids): print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 开始导出并上传审核模型和3D相册模型glb文件...') start_time = time.time() #headcount = libs.getHeadCount(pid) @@ -182,8 +182,8 @@ def export_and_update_glbs(pid): model_info['weight'] = round(model_info['volume'] * 1.226, 2) print(f'{pid}的模型数据:{model_info}') - res = requests.get(f'{config.urls["upload_model_info_url"]}?pid={pid}&headcount={headcount}&faces={model_info["faces"]}&volume={model_info["volume"]}&weight={model_info["weight"]}&height={model_info["height"]}') - print('上传模型数据:', res.text) + #res = requests.get(f'{config.urls["upload_model_info_url"]}?pid={pid}&headcount={headcount}&faces={model_info["faces"]}&volume={model_info["volume"]}&weight={model_info["weight"]}&height={model_info["height"]}') + #print('上传模型数据:', res.text) # with open(os.path.join(config.sharedir, 'model_info', f'{pid}.json'), 'w') as f: # json.dump(model_info, f) # f.close() @@ -230,6 +230,7 @@ def export_and_update_glbs(pid): #更新该笔订单的状态为 3000 # order_ids 逗号隔开 + print(order_ids) order_ids = ",".join(order_ids) requests.post("https://shop.api.suwa3d.com/api/printOrder/updateExternalOrderStatusV2", data={'pid': pid,"order_ids":order_ids}) @@ -237,7 +238,7 @@ def createGlb(pid,order_ids): base_fix(pid,order_ids) - export_and_update_glbs(pid) + export_and_update_glbs(pid,order_ids) #移除文件夹 # try: # shutil.rmtree(os.path.join(config.workdir,'print',pid)) @@ -283,13 +284,13 @@ if __name__ == '__main__': info = json.loads(info) - pid = int(info['pid']) + pid = info['pid'] order_ids = info['order_id'] - if not pid.isdigit(): - continue + # if not pid.isdigit(): + # continue - createGlb(pid,order_ids) + createGlb(str(pid),order_ids) except Exception as e: print(f'错误:{e}') time.sleep(10)