Подготовка к переводу на MV
This commit is contained in:
@@ -36,6 +36,7 @@ class ReportService
|
||||
?ReportMetadataReadService $reportMetadataReadService = null,
|
||||
?ReportSaveOrchestrator $reportSaveOrchestrator = null,
|
||||
?ReportRuntimeService $reportRuntimeService = null,
|
||||
protected MetrikaService $metrikaService
|
||||
) {
|
||||
$this->autoFillReportPayloadBuilder = $autoFillReportPayloadBuilder ?? app(AutoFillReportPayloadBuilder::class);
|
||||
$this->reportPatientsReadService = $reportPatientsReadService ?? app(ReportPatientsReadService::class);
|
||||
@@ -289,4 +290,24 @@ class ReportService
|
||||
{
|
||||
return $this->reportMetadataReadService->getRecipientPlanOfYear($department, $dateRange);
|
||||
}
|
||||
|
||||
public function getReportInfo(User $user, Department $department, DateRange $dateRange)
|
||||
{
|
||||
$report = $this->resolveReport($department->department_id, $dateRange);
|
||||
$metrics = $this->metrikaService->getMetricsForReport($report);
|
||||
}
|
||||
|
||||
private function resolveReport(int $departmentId, DateRange $dateRange)
|
||||
{
|
||||
$query = Report::query()
|
||||
->where('rf_department_id', $departmentId)
|
||||
->exactPeriod($dateRange->startSql(), $dateRange->endSql())
|
||||
->orderByDesc('report_id');
|
||||
|
||||
if ($dateRange->isOneDay) {
|
||||
return $query->first();
|
||||
}
|
||||
|
||||
return $query->onlySubmitted()->first();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user