dongchangxi 10 months ago
parent
commit
f317d7ff41
  1. 24
      no_resize.py

24
no_resize.py

@ -144,14 +144,16 @@ def make3d4print_task(r):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), 'redis连接异常,重新连接') 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) r = redis.Redis(host='106.14.158.208', password='kcV2000', port=6379, db=6)
return return
orderId = r.lpop('model:noresize') orderIdStr = r.lpop('model:noresize')
if orderId is None: return if orderIdStr is None: return
arrOrder = orderIdStr.decode('utf-8').split('_')
orderId = arrOrder[0]
size = arrOrder[1]
if type(orderId) != str: if type(orderId) != str:
orderId = orderId.decode('utf-8') orderId = orderId.decode('utf-8')
# orderId = 56077 # orderId = 56077
res = getPidFromOrderId(orderId)
res = getPidFromOrderId(orderId) res = getPidFromOrderId(orderId)
if res == -1: if res == -1:
print("查询打印订单信息失败,重新开启进程") print("查询打印订单信息失败,重新开启进程")
@ -167,6 +169,20 @@ def make3d4print_task(r):
path = os.path.join(workdir, 'print', f'{pid}_{orderId}') 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
# 如果指定文件夹目标文件存在,则先删除 # 如果指定文件夹目标文件存在,则先删除

Loading…
Cancel
Save