From b1210d51e841016c31c8fbcd5188197d01addb60 Mon Sep 17 00:00:00 2001 From: harid Date: Tue, 20 Jan 2026 16:40:10 +0700 Subject: [PATCH] =?UTF-8?q?Task=20#2207=20=E0=B8=81=E0=B8=A3=E0=B8=93?= =?UTF-8?q?=E0=B8=B5=E0=B8=84=E0=B8=99=E0=B8=82=E0=B8=AD=E0=B9=82=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=E0=B8=AD=E0=B8=A2=E0=B8=B9=E0=B9=88=E0=B9=83=E0=B8=99?= =?UTF-8?q?=E0=B8=AA=E0=B8=B3=E0=B8=99=E0=B8=B1=E0=B8=81=E0=B8=9B=E0=B8=A5?= =?UTF-8?q?=E0=B8=B1=E0=B8=94=E0=B8=81=E0=B8=A3=E0=B8=B8=E0=B8=87=E0=B9=80?= =?UTF-8?q?=E0=B8=97=E0=B8=9E=E0=B8=A1=E0=B8=AB=E0=B8=B2=E0=B8=99=E0=B8=84?= =?UTF-8?q?=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileController.ts | 6 ++++-- src/controllers/WorkflowController.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 36be10f1..6a6988b9 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -7418,7 +7418,8 @@ export class ProfileController extends Controller { posNo: null, privacyCheckin: profile.privacyCheckin, privacyUser: profile.privacyUser, - privacyMgt : profile.privacyMgt + privacyMgt : profile.privacyMgt, + isDeputy: root?.isDeputy ?? false, // root?.orgRootShortName && posMaster?.posMasterNo // ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}` // : "", @@ -7590,7 +7591,8 @@ export class ProfileController extends Controller { posNo: null, privacyCheckin: profile.privacyCheckin, privacyUser: profile.privacyUser, - privacyMgt : profile.privacyMgt + privacyMgt : profile.privacyMgt, + isDeputy: root?.isDeputy ?? false, // root?.orgRootShortName && posMaster?.posMasterNo // ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}` // : "", diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index 44e3716e..12688f80 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -53,6 +53,7 @@ export class WorkflowController extends Controller { posLevelName: string; posTypeName: string; fullName?: string | null; + isDeputy?: boolean | null; }, ) { // ขั้นที่ 1: ทำการค้นหา profile และ metaWorkflow แบบ parallel @@ -144,7 +145,13 @@ export class WorkflowController extends Controller { metaStates.find((metaState) => metaState.id === metaStateOp.metaStateId)?.order === state.order, ); - + // Task #2207 กรณีคนขอโอนอยู่ในสำนักปลัดกรุงเทพมหานคร + if (body.isDeputy && metaStateOp.operator == "PersonnelOfficer" && correspondingState?.order == 1) { + return; + } + else if (body.isDeputy && metaStateOp.operator == "Officer" && [1, 2].includes(correspondingState?.order as number)) { + metaStateOp.operator = "PersonnelOfficer" + } if (correspondingState) { const stateOperator = new StateOperator(); Object.assign(stateOperator, {