From f2ab1ec91e79635021adc28f1284883cf15699db Mon Sep 17 00:00:00 2001 From: harid Date: Mon, 9 Feb 2026 11:13:15 +0700 Subject: [PATCH] add fields --- src/controllers/CommandController.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 0c5a8653..5c801315 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -519,6 +519,7 @@ export class CommandController extends Controller { commandTypeName: command.commandType?.name || null, commandCode: command.commandType?.code || null, commandSysId: command.commandType?.commandSysId || null, + createdUserId: command.createdUserId }; return new HttpSuccess(_command); } @@ -2310,6 +2311,19 @@ export class CommandController extends Controller { } } if (issue == null) issue = "..................................."; + + const operators = await this.commandOperatorRepository.find({ + select: { + prefix: true, + firstName: true, + lastName: true, + roleName: true, + orderNo: true + }, + where: { commandId: command.id }, + order: { orderNo: "ASC" }, + }); + return new HttpSuccess({ template: command.commandType.fileAttachment, reportName: "xlsx-report", @@ -2325,6 +2339,15 @@ export class CommandController extends Controller { command.commandExcecuteDate == null ? "" : Extension.ToThaiNumber(Extension.ToThaiFullDate2(command.commandExcecuteDate)), + operators: operators.length > 0 + ? operators.map(x => ({ + fullName: `${x.prefix ?? ""}${x.firstName ?? ""} ${x.lastName ?? ""}`, + roleName: x.roleName + })) + : [{ + fullName: "", + roleName: "เจ้าหน้าที่ดำเนินการ" + }] }, }); }