import ตำแหน่ง

This commit is contained in:
kittapath 2025-03-12 12:15:13 +07:00
parent 1e1bd56db6
commit 20ff14def9
3 changed files with 13 additions and 6 deletions

View file

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

View file

@ -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",

View file

@ -188,7 +188,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise<boolean> {
],
});
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<boolean> {
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<boolean> {
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<boolean> {
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 },
});