From a66f5db3f2bf0ff8a9cd0f088285d07feddfd4a2 Mon Sep 17 00:00:00 2001 From: whm <973418690@qq.com> Date: Thu, 30 Oct 2025 15:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=82=B9=E7=B1=BB=E5=9E=8B=E8=A7=84?= =?UTF-8?q?=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/settlement_data.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/services/settlement_data.py b/app/services/settlement_data.py index 19e009e..fd7b608 100644 --- a/app/services/settlement_data.py +++ b/app/services/settlement_data.py @@ -413,16 +413,19 @@ class SettlementDataService(BaseService[SettlementData]): # 解析查询结果(元组:(沉降数据实例, section_id, aname, work_site)) settlement, section_id, aname, work_site = record - # 根据work_site判断work_type(默认0表示未匹配或无数据) + # 根据work_site判断work_type(默认0表示未匹配或无数据) 涵洞H 沉降板L 观测桩G和Z(分标段) B 路基 work_type = 0 if work_site: work_site_str = str(work_site).strip() # 确保为字符串且去空格 - if "隧道" in work_site_str: + if "S" in aname: work_type = 1 - elif "区间路基" in work_site_str: + elif "L" in aname or "G" in aname or "Z" in aname or "B" in aname: work_type = 2 - elif "桥" in work_site_str: + elif "T" in aname or "D" in aname or "C " in aname: work_type = 3 + elif "H" in aname : + work_type = 4 + # 组装返回字典(新增aname字段) record_dict = { @@ -431,7 +434,7 @@ class SettlementDataService(BaseService[SettlementData]): "aname": aname, # 新增:测点名称(从Checkpoint表获取) "section_id": section_id, # 新增:观测点关联的断面ID "work_site": work_site, # 新增:断面的工点信息 - "work_type": work_type, # 新增:工点类型编码(1-隧道,2-区间路基,3-桥) + "work_type": work_type, # 新增:工点类型编码(1-隧道,2-区间路基,3-桥,4-) "CVALUE": settlement.CVALUE, "MAVALUE": settlement.MAVALUE, "MTIME_W": settlement.MTIME_W.strftime("%Y-%m-%d %H:%M:%S") if settlement.MTIME_W else None,