diff --git a/no_resize.py b/no_resize.py index 0c279fc..fc6e314 100644 --- a/no_resize.py +++ b/no_resize.py @@ -144,14 +144,16 @@ def make3d4print_task(r): print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), 'redis连接异常,重新连接') r = redis.Redis(host='106.14.158.208', password='kcV2000', port=6379, db=6) return - orderId = r.lpop('model:noresize') - if orderId is None: return + orderIdStr = r.lpop('model:noresize') + if orderIdStr is None: return + + arrOrder = orderIdStr.decode('utf-8').split('_') + orderId = arrOrder[0] + size = arrOrder[1] if type(orderId) != str: orderId = orderId.decode('utf-8') # orderId = 56077 - res = getPidFromOrderId(orderId) - res = getPidFromOrderId(orderId) if res == -1: print("查询打印订单信息失败,重新开启进程") @@ -167,6 +169,20 @@ def make3d4print_task(r): path = os.path.join(workdir, 'print', f'{pid}_{orderId}') + + #获取打印尺寸信息 + get_printsize_url = 'https://mp.api.suwa3d.com/api/printOrder/info' + res = requests.get(f'{get_printsize_url}?id={orderId}') + print('获取打印尺寸:', res.text) + # for f in res.json()['data']['fileList']: + # if "undefined" in f: + # continue + # try: + # height = float(f.split('_')[-2][:-2]) * 10 + # except Exception as e: + # print("eeee",e) + # bpy.ops.wm.quit_blender() + # return # 如果指定文件夹目标文件存在,则先删除