From 8faaeed7458383804ba6267bbed55d3d29d69aee Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 27 Jun 2024 17:35:13 +0700 Subject: [PATCH] kpi_report --- src/controllers/ReportController.ts | 39 +++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index ea9b08c..4e3e588 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -38,8 +38,9 @@ export class ReportController extends Controller { type: string; root?: string | null; periodId?: string | null; - filters?: string | null; - keyword?: string | null; + profileId?: string | null; + // filters?: string | null; + // keyword?: string | null; }, ) { let templateName: any; @@ -85,11 +86,18 @@ export class ReportController extends Controller { templateName = "KPI8"; reportName = "KPI8"; } - // if (requestBody.root && requestBody.periodId) { + if (requestBody.root && requestBody.periodId) { - // const getEvaluations = await this.kpiUserEvaluationRepository.find({ - // where: { kpiPeriodId: requestBody.periodId }, - // }); + const getEvaluations = await this.kpiUserEvaluationRepository.find({ + where: { kpiPeriodId: requestBody.periodId }, + }); + + // if (requestBody.type == "KPI-3") { + // formattedData = getEvaluations.map((x) => ({ + // fullName: x.prefix+" "+x.firstName+" "+x.lastName, + // fullName: x.prefix+" "+x.firstName+" "+x.lastName, + // })); + // } // const getRoot = await this.kpiRoleRepository.findOne({ // where: { rootId: requestBody.root }, // }); @@ -114,7 +122,7 @@ export class ReportController extends Controller { // officer: officer, // }; - // } + } // if (requestBody.filters && requestBody.keyword) { // } return new HttpSuccess({ @@ -123,4 +131,21 @@ export class ReportController extends Controller { data: formattedData, }); } + + + @Post("kpi9/{periodId}") + async GetReportKpi9( + @Path() periodId?: string | null, + ) { + + + + return new HttpSuccess({ + template: "KPI9", + reportName: "KPI9", + data: {}, + }); + } } + +