Compare commits

..

No commits in common. "3a93d193d3ea9c9602b7e33854db3bbd9a2fd5d1" and "5d0b1aba9cbe342d7f5fa7206c7e1ac87b10a07a" have entirely different histories.

2 changed files with 4 additions and 18 deletions

View File

@ -312,28 +312,14 @@ 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,
user_id: int | None = None,
) -> list[tuple]:
async def get_report_rows(self, report_id: int, sections: list[str] | 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[]),
CAST(:user_id AS INT)
)
FROM v3.v_form3_report_jsonb(CAST(:report_id AS INT), CAST(:sections AS TEXT[]))
"""
)
return (
await self.db.execute(
query,
{"report_id": report_id, "sections": sections, "user_id": user_id},
)
).all()
return (await self.db.execute(query, {"report_id": report_id, "sections": sections})).all()
async def get_rf_rollup_rows(
self,

View File

@ -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, user_id=user.id)
return await self.project_repo.get_report_rows(report_id=report_id, sections=sections)
async def get_rf_rollup_rows(
self,