This commit is contained in:
2025-07-07 15:29:55 +08:00
parent fcb09c04f2
commit 46552a536f
10 changed files with 143 additions and 71 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ from datetime import datetime
# 获取当前时间,格式化为字符串
now_str = datetime.now().strftime("%Y%m%d%H%M%S")
log_filename = f"test_code1{now_str}.log"
current_file = os.path.splitext(os.path.basename(__file__))[0]
log_filename = f"{current_file}{now_str}.log"
logging.basicConfig(
level=logging.DEBUG,
+3 -3
View File
@@ -145,7 +145,7 @@ def xml_to_json(xml_content, output_path):
result.append(base_item)
elif data_sources in project_division:
mapping_desc = f"获取项目划分【{index_extraction_scope}】下取费名称等于【{keyword}】的费用"
mapping_desc = f"返回项目划分【{index_extraction_scope}】下取费名称等于【{keyword}】的费用"
base_item["指标描述"] = {
"指标映射": mapping_desc,
"映射规则": parsed["映射规则"]
@@ -162,9 +162,9 @@ def xml_to_json(xml_content, output_path):
# 取数据来源的开头两个字(如"定额"、"清单"等)
temp3 = data_sources[0:2]
if temp3 in ["清单", "定额", "人材机"]:
mapping_desc = f"获取项目划分【{index_extraction_scope}】下编码包含【{temp0}】的所有【{temp3}】的【{temp2}】之和"
mapping_desc = f"返回项目划分【{index_extraction_scope}】下编码包含【{temp0}】的所有【{temp3}】的【{temp2}】之和"
elif temp3 in ["主材", "设备"]:
mapping_desc = f"获取项目划分【{index_extraction_scope}】及名称包含【{temp0}】的所有【{temp3}】的【{temp2}】之和"
mapping_desc = f"返回项目划分【{index_extraction_scope}】及名称包含【{temp0}】的所有【{temp3}】的【{temp2}】之和"
else:
mapping_desc = f"从【{data_sources}】中获取{temp0}的值"