From 20ff14def949e043f02fc2a625a22dceeea153ce Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 12 Mar 2025 12:15:13 +0700 Subject: [PATCH] =?UTF-8?q?import=20=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/OrgRootController.ts | 4 ++-- src/entities/OFFICER.ts | 7 +++++++ src/services/rabbitmq.ts | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/controllers/OrgRootController.ts b/src/controllers/OrgRootController.ts index 4e9e4f29..ae27a5ed 100644 --- a/src/controllers/OrgRootController.ts +++ b/src/controllers/OrgRootController.ts @@ -1009,7 +1009,7 @@ export class OrgRootController extends Controller { relations: ["positions", "positions.posLevel", "positions.posType"], }); for (const item of employeePosMaster) { - if (item.next_holderId != null && status == "NOW") { + if (item.next_holderId != null) { const profile = await repoProfileEmployee.findOne({ where: { id: item.next_holderId == null ? "" : item.next_holderId }, }); @@ -1031,7 +1031,7 @@ export class OrgRootController extends Controller { relations: ["positions", "positions.posLevel", "positions.posType"], }); for (const item of employeeTempPosMaster) { - if (item.next_holderId != null && status == "NOW") { + if (item.next_holderId != null) { const profile = await repoProfileEmployee.findOne({ where: { id: item.next_holderId == null ? "" : item.next_holderId }, }); diff --git a/src/entities/OFFICER.ts b/src/entities/OFFICER.ts index 3ef6f39f..92dc117a 100644 --- a/src/entities/OFFICER.ts +++ b/src/entities/OFFICER.ts @@ -103,6 +103,13 @@ export class OFFICER { }) DEPARTMENT_NAME: string; + @Column({ + nullable: true, + type: "text", + default: null, + }) + DEPARTMENT_CODE: string; + @Column({ nullable: true, type: "text", diff --git a/src/services/rabbitmq.ts b/src/services/rabbitmq.ts index 61df06f5..ba670b3a 100644 --- a/src/services/rabbitmq.ts +++ b/src/services/rabbitmq.ts @@ -188,7 +188,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { ], }); for (const item of posMaster) { - if (item.next_holderId != null && status == "NOW") { + if (item.next_holderId != null) { const profile = await repoProfile.findOne({ where: { id: item.next_holderId == null ? "" : item.next_holderId }, }); @@ -208,7 +208,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { item.lastUpdatedAt = lastUpdatedAt; await repoPosmaster.save(item).catch((e) => console.log(e)); } - if (orgRevisionPublish != null && orgRevisionDraft !=null) { + if (orgRevisionPublish != null && orgRevisionDraft != null) { //new main revision const before = null; @@ -1005,7 +1005,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { relations: ["positions", "positions.posLevel", "positions.posType"], }); for (const item of employeePosMaster) { - if (item.next_holderId != null && status == "NOW") { + if (item.next_holderId != null) { const profile = await repoProfileEmployee.findOne({ where: { id: item.next_holderId == null ? "" : item.next_holderId }, }); @@ -1030,7 +1030,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { relations: ["positions", "positions.posLevel", "positions.posType"], }); for (const item of employeeTempPosMaster) { - if (item.next_holderId != null && status == "NOW") { + if (item.next_holderId != null) { const profile = await repoProfileEmployee.findOne({ where: { id: item.next_holderId == null ? "" : item.next_holderId }, });