From 6aa258d5e3d516f924be8813680cc55385a8b78b Mon Sep 17 00:00:00 2001 From: tsygankoviva Date: Fri, 21 Aug 2026 11:20:09 +0300 Subject: [PATCH] =?UTF-8?q?meta-form-3:=20=D0=B2=D0=BE=D0=B7=D0=B2=D1=80?= =?UTF-8?q?=D0=B0=D1=89=D0=B0=D0=B5=D0=BC=20=D0=BC=D0=B5=D1=82=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=BF=D0=BE=20=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D0=BB=D0=B1=D1=86=D0=B0=D0=BC=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D1=8B=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/src/repository/project_repository.py | 20 +++++++++++++++++--- api/src/services/project_service.py | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/api/src/repository/project_repository.py b/api/src/repository/project_repository.py index 90f3d71..b70089c 100644 --- a/api/src/repository/project_repository.py +++ b/api/src/repository/project_repository.py @@ -312,14 +312,28 @@ class ProjectRepository: query = query.where(Project.org_unit_id.in_(org_unit_ids)) return (await self.db.execute(query)).scalar_one_or_none() - async def get_report_rows(self, report_id: int, sections: list[str] | None = None) -> list[tuple]: + async def get_report_rows( + self, + report_id: int, + sections: list[str] | None = None, + user_id: int | None = None, + ) -> list[tuple]: query = text( """ SELECT row_type, depth, sort_order, data - FROM v3.v_form3_report_jsonb(CAST(:report_id AS INT), CAST(:sections AS TEXT[])) + FROM v3.v_form3_report_jsonb( + CAST(:report_id AS INT), + CAST(:sections AS TEXT[]), + CAST(:user_id AS INT) + ) """ ) - return (await self.db.execute(query, {"report_id": report_id, "sections": sections})).all() + return ( + await self.db.execute( + query, + {"report_id": report_id, "sections": sections, "user_id": user_id}, + ) + ).all() async def get_rf_rollup_rows( self, diff --git a/api/src/services/project_service.py b/api/src/services/project_service.py index a81bf74..e468c17 100644 --- a/api/src/services/project_service.py +++ b/api/src/services/project_service.py @@ -101,7 +101,7 @@ class ProjectService: report_id = await self.resolve_report_id(project_id, year, report_type, user) if not report_id: raise ValidationException("Отчёт не найден") - return await self.project_repo.get_report_rows(report_id=report_id, sections=sections) + return await self.project_repo.get_report_rows(report_id=report_id, sections=sections, user_id=user.id) async def get_rf_rollup_rows( self,