更新代码
This commit is contained in:
@@ -19,6 +19,7 @@ from equipment_calculation.bcl_utils import (
|
||||
create_node_from_type,
|
||||
create_material_or_equipment_from_node,
|
||||
)
|
||||
|
||||
from equipment_calculation.item_acquisition import (
|
||||
get_cost_table_children,
|
||||
get_quantity_nodes,
|
||||
@@ -37,7 +38,7 @@ calculated_fees = {}
|
||||
# bill_quantity_cache = {}
|
||||
|
||||
|
||||
# 主网处理地形系数
|
||||
# 主网架线处理地形系数
|
||||
def process_DXdata(json_data):
|
||||
"""
|
||||
处理 projectData 中的线路特征段数据,计算每条 bpBillZhXsTable 记录的加权值,
|
||||
@@ -88,13 +89,13 @@ def process_DXdata(json_data):
|
||||
) * 0.01
|
||||
|
||||
# 保留一位小数,格式化为字符串
|
||||
calculated_value = f"{total:.1f}"
|
||||
# calculated_value = f"{total:.8f}"
|
||||
|
||||
# 获取 ItemName
|
||||
item_name = item.get("ItemName", "未知项目")
|
||||
|
||||
# 构建结果字典
|
||||
item_dict = {"特征段": seg_number, item_name: calculated_value}
|
||||
item_dict = {"特征段": seg_number, item_name: total}
|
||||
|
||||
# 添加到结果列表
|
||||
result_list.append(item_dict)
|
||||
@@ -106,6 +107,10 @@ def process_DXdata(json_data):
|
||||
return result_list
|
||||
|
||||
|
||||
# # 技改处理地形系数
|
||||
# def JG_process_DXdata(json_data):
|
||||
|
||||
|
||||
# 在create_list_from_node函数后添加一个包装函数
|
||||
def create_list_from_node_with_bill_quantity(node, quantity=None):
|
||||
"""创建清单对象并设置数量,不使用全局变量"""
|
||||
|
||||
Reference in New Issue
Block a user