From 9782871c9c26b30c4071302bc7d1b22fe159066b Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 27 May 2026 17:46:44 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B8=A7?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2=20=E0=B9=80=E0=B8=9E?= =?UTF-8?q?=E0=B8=B4=E0=B9=88=E0=B8=A1=20CommandCode,=20CommandId=20#2377?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index c676ad51..f114a24c 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -2618,6 +2618,7 @@ export class CommandController extends Controller { const now = new Date(); let command = new Command(); let commandCode: string = ""; + let commandSysId: string = ""; let _null: any = null; let userProfile: any = null; if ( @@ -2637,6 +2638,7 @@ export class CommandController extends Controller { if (!_command) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบคำสั่งนี้ในระบบ"); } + commandSysId = _command.commandType.commandSysId; commandCode = _command.commandType.code; command = _command; } else { @@ -2651,6 +2653,7 @@ export class CommandController extends Controller { if (!commandType) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ"); } + commandSysId = commandType.commandSysId; commandCode = commandType.code; command.detailHeader = commandType.detailHeader; command.detailBody = commandType.detailBody; @@ -2795,7 +2798,7 @@ export class CommandController extends Controller { const path = commandTypePath(commandCode); if (path == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ"); - if (!["C-PM-26", "C-PM-25"].includes(commandCode)) { + if (commandSysId && commandSysId.toLocaleUpperCase().trim() !== "DISCIPLINE") { await new CallAPI() .PostData(request, path, { refIds: requestBody.persons.filter((x) => x.refId != null).map((x) => x.refId),