From 1bbef97a691360c695b36c72fb022a53cb2c63e5 Mon Sep 17 00:00:00 2001 From: lhx Date: Thu, 16 Oct 2025 11:34:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=AD=E9=9D=A2=E5=8A=A0=E8=B4=A6=E5=8F=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/section_data.py | 1 + app/schemas/comprehensive_data.py | 2 ++ app/services/section_data.py | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/section_data.py b/app/models/section_data.py index 3f5c3d5..3b023fd 100644 --- a/app/models/section_data.py +++ b/app/models/section_data.py @@ -17,4 +17,5 @@ class SectionData(Base): treatment_depth = Column(String(100), comment="处理深度") foundation_treatment_method = Column(String(100), comment="地基处理方法") rock_mass_classification = Column(String(100), comment="围岩级别") + account_id = Column(String(100), nullable=True, comment="账号id", index=True) section_id = Column(String(100), nullable=False, comment="断面id", index=True) \ No newline at end of file diff --git a/app/schemas/comprehensive_data.py b/app/schemas/comprehensive_data.py index 129ff3f..8873305 100644 --- a/app/schemas/comprehensive_data.py +++ b/app/schemas/comprehensive_data.py @@ -65,6 +65,7 @@ class SectionDataImportRequest(BaseModel): treatment_depth: Optional[str] = None foundation_treatment_method: Optional[str] = None rock_mass_classification: Optional[str] = None + account_id: Optional[str] = None # 原始数据查询请求 class OriginalDataQueryRequest(BaseModel): @@ -118,6 +119,7 @@ class SectionDataQueryRequest(BaseModel): treatment_depth: Optional[str] = None foundation_treatment_method: Optional[str] = None rock_mass_classification: Optional[str] = None + account_id: Optional[str] = None # 水准数据查询请求 class LevelDataQueryRequest(BaseModel): diff --git a/app/services/section_data.py b/app/services/section_data.py index 835a4f2..66c1054 100644 --- a/app/services/section_data.py +++ b/app/services/section_data.py @@ -81,6 +81,7 @@ class SectionDataService(BaseService[SectionData]): "treatment_depth": section.treatment_depth, "foundation_treatment_method": section.foundation_treatment_method, "rock_mass_classification": section.rock_mass_classification, + "account_id": section.account_id, "checkpoints": [ { "id": cp.id, @@ -242,6 +243,7 @@ class SectionDataService(BaseService[SectionData]): section.treatment_depth = item_data.get('treatment_depth') section.foundation_treatment_method = item_data.get('foundation_treatment_method') section.rock_mass_classification = item_data.get('rock_mass_classification') + section.account_id = item_data.get('account_id') logger.info(f"Updated section: {item_data.get('section_id')}") else: # 新增操作 @@ -259,7 +261,8 @@ class SectionDataService(BaseService[SectionData]): compression_layer_thickness=item_data.get('compression_layer_thickness'), treatment_depth=item_data.get('treatment_depth'), foundation_treatment_method=item_data.get('foundation_treatment_method'), - rock_mass_classification=item_data.get('rock_mass_classification') + rock_mass_classification=item_data.get('rock_mass_classification'), + account_id=item_data.get('account_id') ) db.add(section) logger.info(f"Created section: {item_data.get('section_id')}")