From 2dcabd5a6643a5fd4e6b66a1c26e86f513c1804c Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 23 Apr 2025 16:40:42 +0700 Subject: [PATCH] update --- src/controllers/EvaluationController.ts | 2 ++ src/controllers/ReportController.ts | 41 +++++++++++++------------ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/controllers/EvaluationController.ts b/src/controllers/EvaluationController.ts index 1ae1d81..c2d078f 100644 --- a/src/controllers/EvaluationController.ts +++ b/src/controllers/EvaluationController.ts @@ -537,6 +537,8 @@ export class EvaluationController { evaluation.userId = request.user.sub; evaluation.detailAnnounceStep5Body = announceTemplate5?.detailBody??_null; evaluation.detailAnnounceStep5Footer = announceTemplate5?.detailFooter??_null; + evaluation.positionArea = requestBody.positionArea && requestBody.positionArea !== "" ? requestBody.positionArea : _null; + evaluation.posExecutive = requestBody.posExecutive && requestBody.posExecutive !== "" ? requestBody.posExecutive : _null; await this.evaluationRepository.save(evaluation, { data: request }); setLogDataDiff(request, { before, after: evaluation }); diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index ffa50e9..892a12d 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -291,23 +291,23 @@ export class ReoportController { if (!evaluation.userId) { return "ไม่พบข้อมูลผู้ขอประเมิน"; } - await new CallAPI() - .GetData(request, `/org/profile/keycloak/commander/${evaluation.userId}`) - .then(async (x) => { - (root = x.root), - (dateStart = x.dateStart), - (dateRetireLaw = x.dateRetireLaw), - (org = x.org), - (commanderFullname = x.commanderFullname), - (commanderPosition = x.commanderPosition), - (commanderRootName = x.commanderRootName), - (commanderOrg = x.commanderOrg), - (commanderAboveFullname = x.commanderAboveFullname), - (commanderAbovePosition = x.commanderAbovePosition), - (commanderAboveRootName = x.commanderAboveRootName), - (commanderAboveOrg = x.commanderAboveOrg); - }) - .catch(); + // await new CallAPI() + // .GetData(request, `/org/profile/keycloak/commander/${evaluation.userId}`) + // .then(async (x) => { + // (root = x.root), + // (dateStart = x.dateStart), + // (dateRetireLaw = x.dateRetireLaw), + // (org = x.org), + // (commanderFullname = x.commanderFullname), + // (commanderPosition = x.commanderPosition), + // (commanderRootName = x.commanderRootName), + // (commanderOrg = x.commanderOrg), + // (commanderAboveFullname = x.commanderAboveFullname), + // (commanderAbovePosition = x.commanderAbovePosition), + // (commanderAboveRootName = x.commanderAboveRootName), + // (commanderAboveOrg = x.commanderAboveOrg); + // }) + // .catch(); const evaluationOld = await this.evaluationRepository.find({ where: { id: Not(id), @@ -351,8 +351,9 @@ export class ReoportController { positionLevel: evaluation.positionLevel ? evaluation.positionLevel : "", detailAnnounceStep5Body: evaluation.detailAnnounceStep5Body, detailAnnounceStep5Footer: evaluation.detailAnnounceStep5Footer, - positionArea: evaluation.positionArea, + positionAreaWithSym: evaluation.positionArea?`(${Extension.ToThaiNumber(evaluation.positionArea)})` : "", posExecutive: evaluation.posExecutive, + posFull: (evaluation.position ? `${evaluation.position}` : "") + (evaluation.posExecutive ? " " + `${evaluation.posExecutive}` : "") + (evaluation.positionLevel ? " " + `${evaluation.positionLevel}` : ""), birthDate: evaluation.birthDate != null && evaluation.birthDate != "" ? Extension.ToThaiNumber( @@ -440,7 +441,9 @@ export class ReoportController { amount: salaries.amount ? Extension.ToThaiNumber(salaries.amount.toLocaleString()) : "-", - position: salaries.positionName ? Extension.ToThaiNumber(salaries.positionName) : "-", + position: salaries.positionName ? salaries.positionName : "-", + positionExecutive: salaries.positionExecutive ? salaries.positionExecutive : "", + positionAndPosEx: (salaries.positionName ? salaries.positionName : "") + (salaries.positionExecutive ? " " + salaries.positionExecutive : ""), positionSalaryAmount: salaries.positionSalaryAmount, mouthSalaryAmount: salaries.mouthSalaryAmount, posNo: salaries.posNo,