修复快速订单订单号和人工报价及注释掉识别长宽高代码
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user