diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 808dd93..bc44751 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -161,6 +161,8 @@ export class ReoportController { .leftJoin("evaluation.salaries", "salaries") .leftJoin("evaluation.training", "training") .leftJoin("evaluation.assessment", "assessment") + .leftJoin("evaluation.portfolios", "portfolios") + .leftJoin("evaluation.performances", "performances") .where("evaluation.id = :id", { id }) .select([ "evaluation.id", @@ -269,6 +271,14 @@ export class ReoportController { "assessment.point2", "assessment.pointSumTotal", "assessment.pointSum", + + "portfolios.name", + "portfolios.detail", + + "performances.year", + "performances.type", + "performances.subject", + "performances.evaluationResult", ]) .orderBy("salaries.commandDateAffect", "DESC") .getOne(); @@ -353,7 +363,7 @@ export class ReoportController { detailAnnounceStep5Footer: evaluation.detailAnnounceStep5Footer, positionAreaWithSym: evaluation.positionArea?`(${Extension.ToThaiNumber(evaluation.positionArea)})` : "", posExecutive: evaluation.posExecutive, - posFull: (evaluation.position ? `${evaluation.position}` : "") + (evaluation.posExecutive ? " " + `${evaluation.posExecutive}` : "") + (evaluation.positionLevel ? " " + `${evaluation.positionLevel}` : ""), + posFull: (evaluation.position ? `${evaluation.position}` : "") + (evaluation.positionLevel ? `${evaluation.positionLevel}` : "") + (evaluation.posExecutive ? " " + `${evaluation.posExecutive}` : "") , birthDate: evaluation.birthDate != null && evaluation.birthDate != "" ? Extension.ToThaiNumber( @@ -499,6 +509,16 @@ export class ReoportController { pointSumTotal: assessment.pointSumTotal, pointSum: assessment.pointSum, })), + portfolios: evaluation.portfolios.map((portfolio) => ({ + name: portfolio.name, + detail: portfolio.detail, + })), + performances: evaluation.performances.map((performance) => ({ + year: performance.year ? Extension.ToThaiNumber(performance.year.toString()) : "-", + type: performance.type, + subject: performance.subject, + evaluationResult: performance.evaluationResult, + })), commanderFullname: commanderFullname ? commanderFullname : "-", commanderPosition: commanderPosition ? commanderPosition : "-", commanderRootName: commanderRootName ? commanderRootName : "-", @@ -507,6 +527,7 @@ export class ReoportController { commanderAbovePosition: commanderAbovePosition ? commanderAbovePosition : "-", commanderAboveRootName: commanderAboveRootName ? commanderAboveRootName : "-", commanderAboveOrg: commanderAboveOrg ? commanderAboveOrg : "-", + // commanderPositionSign: `${commanderPosition} สำนักงานการเจ้าหน้าที่ ${commanderRootName}` + `\n` + `${commanderAbovePosition} ${commanderAboveRootName}`, years: years, };