From 4ba71ff83036bb03264a6abb6edc5c8f3e730e03 Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 26 Nov 2025 16:20:11 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B9=80=E0=B8=89=E0=B8=9E=E0=B8=B2?= =?UTF-8?q?=E0=B8=B0=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= =?UTF-8?q?=20C-PM-10=20=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=20receiverUserId=20=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=20noti=20=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B9=89=E0=B8=87=E0=B9=81=E0=B8=A3=E0=B8=81=E0=B8=AD?= =?UTF-8?q?=E0=B8=AD=E0=B8=81=20#1995?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/rabbitmq.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/rabbitmq.ts b/src/services/rabbitmq.ts index dd57d886..74df4dc0 100644 --- a/src/services/rabbitmq.ts +++ b/src/services/rabbitmq.ts @@ -445,7 +445,11 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise isSendNotification: true, })) : []; - + /*เฉพาะคำสั่ง C-PM-10 ให้ตัด receiverUserId ที่ส่ง noti ครั้งแรกออก*/ + if (command && command.commandType && ["C-PM-10"].includes(command.commandType.code)) { + const firstNotiIds = profiles.map((p:any) => p.receiverUserId); + profilesSend = profilesSend.filter((x:any) => !firstNotiIds.includes(x.receiverUserId)); + } const payloadStr = await PayloadSendNoti(command.id); const profilesSendRequest = new CallAPI() .PostData( From 4bdf1ad7b49f3fa10469e789f323049ecc0212fc Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 26 Nov 2025 16:48:35 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B9=80=E0=B8=89=E0=B8=9E=E0=B8=B2?= =?UTF-8?q?=E0=B8=B0=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= =?UTF-8?q?=20C-PM-10=20=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=20profilesNotiRequest=20=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=20noti=20=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B9=89=E0=B8=87=E0=B9=81=E0=B8=A3=E0=B8=81=E0=B8=AD?= =?UTF-8?q?=E0=B8=AD=E0=B8=81=20=E0=B9=80=E0=B8=9E=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=B0=20UI=20=E0=B8=9B=E0=B8=B4=E0=B8=94=20Tab=20=E0=B8=99?= =?UTF-8?q?=E0=B8=B5=E0=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/rabbitmq.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/services/rabbitmq.ts b/src/services/rabbitmq.ts index 74df4dc0..0c18117c 100644 --- a/src/services/rabbitmq.ts +++ b/src/services/rabbitmq.ts @@ -445,11 +445,6 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise isSendNotification: true, })) : []; - /*เฉพาะคำสั่ง C-PM-10 ให้ตัด receiverUserId ที่ส่ง noti ครั้งแรกออก*/ - if (command && command.commandType && ["C-PM-10"].includes(command.commandType.code)) { - const firstNotiIds = profiles.map((p:any) => p.receiverUserId); - profilesSend = profilesSend.filter((x:any) => !firstNotiIds.includes(x.receiverUserId)); - } const payloadStr = await PayloadSendNoti(command.id); const profilesSendRequest = new CallAPI() .PostData( @@ -479,7 +474,14 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise console.error("Full error object:", error); }); - await Promise.all([profilesNotiRequest, profilesSendRequest]); + /*เฉพาะคำสั่ง C-PM-10 ให้ตัด profilesNotiRequest ที่ส่ง noti ครั้งแรกออก*/ + if (command && command.commandType && ["C-PM-10"].includes(command.commandType.code)) { + await Promise.all([profilesSendRequest]); + } + else { + await Promise.all([profilesNotiRequest, profilesSendRequest]); + } + console.log("[AMQ] Send Notification Success"); return true; From 072d9a6880d2b49f746412e7a347b48449ba7187 Mon Sep 17 00:00:00 2001 From: harid Date: Thu, 27 Nov 2025 19:28:38 +0700 Subject: [PATCH 3/3] migrate #2043 --- src/controllers/EducationLevelController.ts | 4 ++++ src/entities/EducationLevel.ts | 21 +++++++++++++++++++ ...-update_table_educationLeave_add_fields.ts | 16 ++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 src/migration/1764244579743-update_table_educationLeave_add_fields.ts diff --git a/src/controllers/EducationLevelController.ts b/src/controllers/EducationLevelController.ts index eecdbda0..f99214a9 100644 --- a/src/controllers/EducationLevelController.ts +++ b/src/controllers/EducationLevelController.ts @@ -132,6 +132,8 @@ export class EducationLevelController extends Controller { "id", "name", "rank", + "educationLevel", + "isHigh", "createdAt", "lastUpdatedAt", "createdFullName", @@ -157,6 +159,8 @@ export class EducationLevelController extends Controller { "id", "name", "rank", + "educationLevel", + "isHigh", "createdAt", "lastUpdatedAt", "createdFullName", diff --git a/src/entities/EducationLevel.ts b/src/entities/EducationLevel.ts index 631c5a9d..cc291e90 100644 --- a/src/entities/EducationLevel.ts +++ b/src/entities/EducationLevel.ts @@ -17,6 +17,21 @@ export class EducationLevel extends EntityBase { default: null, }) rank: number; + + @Column({ + nullable: true, + comment: "ขีดจำกัดวุฒิการศึกษา", + length: 50, + default: null, + }) + educationLevel?: string; + + @Column({ + nullable: true, + comment: "วุฒิการศึกษาสูงสุด", + default: null, + }) + isHigh?: boolean; } export class CreateEducationLevel { @@ -25,6 +40,12 @@ export class CreateEducationLevel { @Column() rank: number; + + @Column() + educationLevel?: string; + + @Column() + isHigh?: boolean; } export type UpdateEducationLevel = Partial; diff --git a/src/migration/1764244579743-update_table_educationLeave_add_fields.ts b/src/migration/1764244579743-update_table_educationLeave_add_fields.ts new file mode 100644 index 00000000..0453ff63 --- /dev/null +++ b/src/migration/1764244579743-update_table_educationLeave_add_fields.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableEducationLeaveAddFields1764244579743 implements MigrationInterface { + name = 'UpdateTableEducationLeaveAddFields1764244579743' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`educationLevel\` ADD \`educationLevel\` varchar(50) NULL COMMENT 'ขีดจำกัดวุฒิการศึกษา'`); + await queryRunner.query(`ALTER TABLE \`educationLevel\` ADD \`isHigh\` tinyint NULL COMMENT 'วุฒิการศึกษาสูงสุด'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`educationLevel\` DROP COLUMN \`isHigh\``); + await queryRunner.query(`ALTER TABLE \`educationLevel\` DROP COLUMN \`educationLevel\``); + } + +}