From 4b2e58a66d84951fa19e463c4db077224ceeaab7 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 22 Apr 2024 14:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BF=AB=E9=80=9F=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AE=A2=E5=8D=95=E5=8F=B7=E5=92=8C=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=8F=8A=E6=B3=A8=E9=87=8A=E6=8E=89=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E9=95=BF=E5=AE=BD=E9=AB=98=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/quick_easy_order_old.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 21fc3f5e..be9bae3d 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -128,18 +128,18 @@ class QuickEasyOrder(models.Model): # # print(volume) # item.model_volume = volume # # 长宽高/体积 - # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(library_of_models.code) + '.stl') + # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl') output_file = os.path.join('/tmp', str(model_code) + '.stl') - your_mesh = mesh.Mesh.from_file(output_file) - volume, cog, inertia = your_mesh.get_mass_properties() - xyz = (your_mesh.max_ - your_mesh.min_) - item.model_length = xyz[0] # 长 单位mm - item.model_width = xyz[1] # 宽 - item.model_height = xyz[2] # 高 - item.model_volume = volume + # your_mesh = mesh.Mesh.from_file(output_file) + # volume, cog, inertia = your_mesh.get_mass_properties() + # xyz = (your_mesh.max_ - your_mesh.min_) + # item.model_length = xyz[0] # 长 单位mm + # item.model_width = xyz[1] # 宽 + # item.model_height = xyz[2] # 高 + # item.model_volume = volume write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) # 转化为glb - # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(library_of_models.code) + '.glb') + # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb') output_glb_file = os.path.join('/tmp', str(model_code) + '.glb') util_path = get_resource_path('sf_base', 'static/util') cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) @@ -189,6 +189,7 @@ class QuickEasyOrder(models.Model): 'number': item.quantity, 'total_amount': item.price, 'remark': '', + 'manual_quotation': True, 'barcode': barcode }) # res['bfm_process_order_list'] = json.dumps(res['bfm_process_order_list']) @@ -292,7 +293,7 @@ class QuickEasyOrder(models.Model): 'model_height': order.model_height, 'model_volume': order.model_volume, 'color_model_path': '/tmp/' + str(model_code) + ".step", - 'model_order_no': order.name, + 'model_order_no': '%s-%s' % (order.name, 1), 'remark': '订单号:%s 客户:%s' % (order.name, order.customer_id.name) } try: