kpi_report

This commit is contained in:
AdisakKanthawilang 2024-06-27 17:35:13 +07:00
parent 468d8d8865
commit 8faaeed745

View file

@ -38,8 +38,9 @@ export class ReportController extends Controller {
type: string; type: string;
root?: string | null; root?: string | null;
periodId?: string | null; periodId?: string | null;
filters?: string | null; profileId?: string | null;
keyword?: string | null; // filters?: string | null;
// keyword?: string | null;
}, },
) { ) {
let templateName: any; let templateName: any;
@ -85,11 +86,18 @@ export class ReportController extends Controller {
templateName = "KPI8"; templateName = "KPI8";
reportName = "KPI8"; reportName = "KPI8";
} }
// if (requestBody.root && requestBody.periodId) { if (requestBody.root && requestBody.periodId) {
// const getEvaluations = await this.kpiUserEvaluationRepository.find({ const getEvaluations = await this.kpiUserEvaluationRepository.find({
// where: { kpiPeriodId: requestBody.periodId }, 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({ // const getRoot = await this.kpiRoleRepository.findOne({
// where: { rootId: requestBody.root }, // where: { rootId: requestBody.root },
// }); // });
@ -114,7 +122,7 @@ export class ReportController extends Controller {
// officer: officer, // officer: officer,
// }; // };
// } }
// if (requestBody.filters && requestBody.keyword) { // if (requestBody.filters && requestBody.keyword) {
// } // }
return new HttpSuccess({ return new HttpSuccess({
@ -123,4 +131,21 @@ export class ReportController extends Controller {
data: formattedData, data: formattedData,
}); });
} }
@Post("kpi9/{periodId}")
async GetReportKpi9(
@Path() periodId?: string | null,
) {
return new HttpSuccess({
template: "KPI9",
reportName: "KPI9",
data: {},
});
}
} }