From 6a1ca6b867e11835a8baa68434b8e480efc7c7e4 Mon Sep 17 00:00:00 2001 From: harid Date: Thu, 9 Apr 2026 17:20:24 +0700 Subject: [PATCH] =?UTF-8?q?fix=20Noti=20=E0=B9=81=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=87=E0=B9=80=E0=B8=95=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B8=9C?= =?UTF-8?q?=E0=B8=B4=E0=B8=94=20#2417?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/DevelopmentRequestController.ts | 3 ++- src/controllers/ProfileEditController.ts | 3 ++- src/controllers/ProfileEditEmployeeController.ts | 3 ++- src/controllers/WorkflowController.ts | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/controllers/DevelopmentRequestController.ts b/src/controllers/DevelopmentRequestController.ts index 14c485c4..f629e1d5 100644 --- a/src/controllers/DevelopmentRequestController.ts +++ b/src/controllers/DevelopmentRequestController.ts @@ -369,7 +369,8 @@ export class DevelopmentRequestController extends Controller { posLevelName: profile.posLevel.posLevelName, posTypeName: profile.posType.posTypeName, fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`, - isDeputy: orgRoot?.isDeputy ?? false + isDeputy: orgRoot?.isDeputy ?? false, + orgRootId: orgRoot?.id ?? null }) .catch((error) => { console.error("Error calling API:", error); diff --git a/src/controllers/ProfileEditController.ts b/src/controllers/ProfileEditController.ts index 35f26786..17b952d8 100644 --- a/src/controllers/ProfileEditController.ts +++ b/src/controllers/ProfileEditController.ts @@ -363,7 +363,8 @@ export class ProfileEditController extends Controller { posLevelName: profile.posLevel.posLevelName, posTypeName: profile.posType.posTypeName, fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`, - isDeputy: orgRoot?.isDeputy ?? false + isDeputy: orgRoot?.isDeputy ?? false, + orgRootId: orgRoot?.id ?? null }) .catch((error) => { console.error("Error calling API:", error); diff --git a/src/controllers/ProfileEditEmployeeController.ts b/src/controllers/ProfileEditEmployeeController.ts index 2cdd9fde..288dc724 100644 --- a/src/controllers/ProfileEditEmployeeController.ts +++ b/src/controllers/ProfileEditEmployeeController.ts @@ -363,7 +363,8 @@ export class ProfileEditEmployeeController extends Controller { posLevelName: "EMP", posTypeName: "EMP", fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`, - isDeputy: orgRoot?.isDeputy ?? false + isDeputy: orgRoot?.isDeputy ?? false, + orgRootId: orgRoot?.id ?? null }) .catch((error) => { console.error("Error calling API:", error); diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index 8e9d2cd4..0609c932 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -54,6 +54,7 @@ export class WorkflowController extends Controller { posTypeName: string; fullName?: string | null; isDeputy?: boolean | null; + orgRootId?: string | null; }, ) { // ขั้นที่ 1: ทำการค้นหา profile และ metaWorkflow แบบ parallel @@ -203,9 +204,10 @@ export class WorkflowController extends Controller { posMasterAssigns: { assignId: body.sysName }, orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, current_holderId: Not(IsNull()), // เพิ่มเงื่อนไขนี้เพื่อกรองเฉพาะที่มี current_holder + ...(body.orgRootId && { orgRootId: body.orgRootId }), // กรองเฉพาะที่อยู่ในสำนักเดียวกัน (ถ้าส่งมา) }, relations: ["orgChild1"], - select: ["current_holderId", "orgChild1"], // เลือกเฉพาะ field ที่จำเป็น + // select: ["current_holderId", "orgChild1"], // เลือกเฉพาะ field ที่จำเป็น }); // สร้าง StateOperatorUsers สำหรับ officers