From 52891cfb76334874e5f376f20c11416ead63c434 Mon Sep 17 00:00:00 2001 From: lhx Date: Tue, 14 Oct 2025 10:38:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=82=E6=B5=8B=E7=82=B9=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B0=B4=E5=87=86=E7=BA=BF=E8=B7=AF=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ app/models/checkpoint.py | 1 + app/schemas/comprehensive_data.py | 1 + app/services/checkpoint.py | 4 +++- app/services/section_data.py | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8a91539..2f60662 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ logs/ *.log temp/ +.claude/ +.vscode/ !README.md diff --git a/app/models/checkpoint.py b/app/models/checkpoint.py index 1ba5669..2f46492 100644 --- a/app/models/checkpoint.py +++ b/app/models/checkpoint.py @@ -7,5 +7,6 @@ class Checkpoint(Base): id = Column(Integer, primary_key=True, index=True, autoincrement=True) aname = Column(String(100), nullable=False, comment="观察点名称") burial_date = Column(String(100), comment="埋设日期") + linecode = Column(String(100), comment="线路编码") section_id = Column(String(100), nullable=False, comment="所属断面id") point_id = Column(String(100), nullable=False, comment="观察点id") \ No newline at end of file diff --git a/app/schemas/comprehensive_data.py b/app/schemas/comprehensive_data.py index eb44f5d..b4ad2bd 100644 --- a/app/schemas/comprehensive_data.py +++ b/app/schemas/comprehensive_data.py @@ -50,6 +50,7 @@ class CheckpointDataImportRequest(BaseModel): aname: Optional[str] = None section_id: str burial_date: Optional[str] = None + linecode: Optional[str] = None # 断面数据导入请求 class SectionDataImportRequest(BaseModel): diff --git a/app/services/checkpoint.py b/app/services/checkpoint.py index 9773b57..548fdea 100644 --- a/app/services/checkpoint.py +++ b/app/services/checkpoint.py @@ -71,6 +71,7 @@ class CheckpointService(BaseService[Checkpoint]): checkpoint.aname = item_data.get('aname') checkpoint.section_id = item_data.get('section_id') checkpoint.burial_date = item_data.get('burial_date') + checkpoint.linecode = item_data.get('linecode') logger.info(f"Updated checkpoint: {item_data.get('point_id')}") else: # 新增操作 @@ -78,7 +79,8 @@ class CheckpointService(BaseService[Checkpoint]): point_id=item_data.get('point_id'), aname=item_data.get('aname'), section_id=item_data.get('section_id'), - burial_date=item_data.get('burial_date') + burial_date=item_data.get('burial_date'), + linecode=item_data.get('linecode') ) db.add(checkpoint) logger.info(f"Created checkpoint: {item_data.get('point_id')}") diff --git a/app/services/section_data.py b/app/services/section_data.py index e167313..a3f5bdd 100644 --- a/app/services/section_data.py +++ b/app/services/section_data.py @@ -86,7 +86,8 @@ class SectionDataService(BaseService[SectionData]): "point_id": cp.point_id, "aname": cp.aname, "burial_date": cp.burial_date, - "section_id": cp.section_id + "section_id": cp.section_id, + "linecode": cp.linecode } for cp in checkpoints ] }