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 }, });