From 022d88068b0f30ef91299f90534a7ee3dbf3ec00 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Tue, 22 Apr 2025 14:30:43 +0700 Subject: [PATCH] fix --- src/controllers/EvaluationController.ts | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/controllers/EvaluationController.ts b/src/controllers/EvaluationController.ts index 8d687e6..2408bcf 100644 --- a/src/controllers/EvaluationController.ts +++ b/src/controllers/EvaluationController.ts @@ -347,6 +347,28 @@ export class EvaluationController { } else throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, error); } } + + /** + * API get template ประกาศคัดเลือก + * + * @summary get template ประกาศคัดเลือก (ADMIN) + * + * @param {string} id id ข้อมูลการประเมิน + */ + @Get("get-announce-template/{id}") + async getAnnounceTemp(@Path() id: string, @Request() request: RequestWithUser) { + try { + const evaluation = await this.evaluationRepository.findOne({ where: { id } , select: ["id","detailAnnounceStep5Body","detailAnnounceStep5Footer"]}); + if (!evaluation) { + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการประเมิน"); + } + return new HttpSuccess(evaluation); + } catch (error: any) { + if (error instanceof HttpError) { + throw error; + } else throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, error); + } + } /** * ดึงข้อมูลรายละเอียด step การขอประเมิน @@ -1768,6 +1790,14 @@ export class EvaluationController { await this.evaluationRepository.save(evaluation, { data: request }); setLogDataDiff(request, { before, after: evaluation }); + // const _director = await new CallAPI() + // .PostData(request, "/org/workflow/find/director/SYS_EVA_REQ", { + // refId: [evaluation.userId], + // }) + // .then((x) => {}) + // .catch((x) => {}); + // console.log("_director>>",_director); + await new CallAPI() .PostData(request, "/placement/noti/keycloak", { subject: `${evaluation.fullName} แบบประเมินมีการบันทึกตรวจสอบจัดเตรียมเอกสารเล่ม 1`,