From 986789229ded5f846314fb57833140daf76fc3f9 Mon Sep 17 00:00:00 2001 From: lhx Date: Thu, 16 Oct 2025 11:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=AD=E9=9D=A2=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=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/api/comprehensive_data.py | 3 ++- app/services/section_data.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/api/comprehensive_data.py b/app/api/comprehensive_data.py index fdb56e4..8f20285 100644 --- a/app/api/comprehensive_data.py +++ b/app/api/comprehensive_data.py @@ -154,7 +154,8 @@ def get_section(request: SectionDataQueryRequest, db: Session = Depends(get_db)) mileage=request.mileage, work_site=request.work_site, number=request.number, - status=request.status + status=request.status, + account_id=request.account_id ) logger.info(f"Found {len(result_data)} sections with checkpoints") diff --git a/app/services/section_data.py b/app/services/section_data.py index 66c1054..5c5642e 100644 --- a/app/services/section_data.py +++ b/app/services/section_data.py @@ -32,7 +32,8 @@ class SectionDataService(BaseService[SectionData]): work_site: Optional[str] = None, number: Optional[str] = None, status: Optional[str] = None, - basic_types: Optional[str] = None) -> List[SectionData]: + basic_types: Optional[str] = None, + account_id: Optional[str] = None) -> List[SectionData]: """根据多个条件搜索断面数据""" conditions = {} if section_id is not None: @@ -49,6 +50,8 @@ class SectionDataService(BaseService[SectionData]): conditions['id'] = id if mileage is not None: conditions['mileage'] = mileage + if account_id is not None: + conditions['account_id'] = account_id return self.search_by_conditions(db, conditions) @@ -58,9 +61,10 @@ class SectionDataService(BaseService[SectionData]): mileage: Optional[str] = None, work_site: Optional[str] = None, number: Optional[str] = None, - status: Optional[str] = None) -> List[Dict[str, Any]]: + status: Optional[str] = None, + account_id: Optional[str] = None) -> List[Dict[str, Any]]: """查询断面数据并返回带观测点的结果""" - sections = self.search_section_data(db, id, section_id, mileage, work_site, number, status) + sections = self.search_section_data(db, id, section_id, mileage, work_site, number, status, account_id=account_id) result = [] for section in sections: