Merge branch 'develop' into develop-Bright

This commit is contained in:
Bright 2025-07-07 09:27:30 +07:00
commit 2506e8dae0

View file

@ -2232,91 +2232,91 @@ export class OrganizationController extends Controller {
responsibility: orgRoot.responsibility, responsibility: orgRoot.responsibility,
labelName: labelName:
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName, orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({ // totalPosition: await this.posMasterRepository.count({
where: { orgRevisionId: orgRoot.orgRevisionId, orgRootId: orgRoot.id }, // where: { orgRevisionId: orgRoot.orgRevisionId, orgRootId: orgRoot.id },
}), // }),
totalPositionCurrentUse: await this.posMasterRepository.count({ // totalPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionCurrentVacant: await this.posMasterRepository.count({ // totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalPositionNextUse: await this.posMasterRepository.count({ // totalPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionNextVacant: await this.posMasterRepository.count({ // totalPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPosition: await this.posMasterRepository.count({ // totalRootPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: IsNull() || "", // orgChild1Id: IsNull() || "",
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
}, // },
}), // }),
totalRootPositionCurrentUse: await this.posMasterRepository.count({ // totalRootPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: IsNull() || "", // orgChild1Id: IsNull() || "",
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionCurrentVacant: await this.posMasterRepository.count({ // totalRootPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: IsNull() || "", // orgChild1Id: IsNull() || "",
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPositionNextUse: await this.posMasterRepository.count({ // totalRootPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: IsNull() || "", // orgChild1Id: IsNull() || "",
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionNextVacant: await this.posMasterRepository.count({ // totalRootPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: IsNull() || "", // orgChild1Id: IsNull() || "",
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
children: await Promise.all( children: await Promise.all(
orgChild1Data orgChild1Data
@ -2361,91 +2361,91 @@ export class OrganizationController extends Controller {
"00" + "00" +
" " + " " +
orgRoot.orgRootShortName, orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({ // totalPosition: await this.posMasterRepository.count({
where: { orgRevisionId: orgRoot.orgRevisionId, orgChild1Id: orgChild1.id }, // where: { orgRevisionId: orgRoot.orgRevisionId, orgChild1Id: orgChild1.id },
}), // }),
totalPositionCurrentUse: await this.posMasterRepository.count({ // totalPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionCurrentVacant: await this.posMasterRepository.count({ // totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalPositionNextUse: await this.posMasterRepository.count({ // totalPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionNextVacant: await this.posMasterRepository.count({ // totalPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPosition: await this.posMasterRepository.count({ // totalRootPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
}, // },
}), // }),
totalRootPositionCurrentUse: await this.posMasterRepository.count({ // totalRootPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionCurrentVacant: await this.posMasterRepository.count({ // totalRootPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPositionNextUse: await this.posMasterRepository.count({ // totalRootPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionNextVacant: await this.posMasterRepository.count({ // totalRootPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: IsNull() || "", // orgChild2Id: IsNull() || "",
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
children: await Promise.all( children: await Promise.all(
orgChild2Data orgChild2Data
@ -2495,94 +2495,94 @@ export class OrganizationController extends Controller {
"00" + "00" +
" " + " " +
orgRoot.orgRootShortName, orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({ // totalPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
}, // },
}), // }),
totalPositionCurrentUse: await this.posMasterRepository.count({ // totalPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionCurrentVacant: await this.posMasterRepository.count({ // totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalPositionNextUse: await this.posMasterRepository.count({ // totalPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionNextVacant: await this.posMasterRepository.count({ // totalPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPosition: await this.posMasterRepository.count({ // totalRootPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
}, // },
}), // }),
totalRootPositionCurrentUse: await this.posMasterRepository.count({ // totalRootPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionCurrentVacant: await this.posMasterRepository.count({ // totalRootPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPositionNextUse: await this.posMasterRepository.count({ // totalRootPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionNextVacant: await this.posMasterRepository.count({ // totalRootPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: IsNull() || "", // orgChild3Id: IsNull() || "",
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
children: await Promise.all( children: await Promise.all(
orgChild3Data orgChild3Data
@ -2639,94 +2639,94 @@ export class OrganizationController extends Controller {
"00" + "00" +
" " + " " +
orgRoot.orgRootShortName, orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({ // totalPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
}, // },
}), // }),
totalPositionCurrentUse: await this.posMasterRepository.count({ // totalPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionCurrentVacant: await this.posMasterRepository.count({ // totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalPositionNextUse: await this.posMasterRepository.count({ // totalPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionNextVacant: await this.posMasterRepository.count({ // totalPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPosition: await this.posMasterRepository.count({ // totalRootPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
}, // },
}), // }),
totalRootPositionCurrentUse: await this.posMasterRepository.count({ // totalRootPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionCurrentVacant: await this.posMasterRepository.count({ // totalRootPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPositionNextUse: await this.posMasterRepository.count({ // totalRootPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionNextVacant: await this.posMasterRepository.count({ // totalRootPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: IsNull() || "", // orgChild4Id: IsNull() || "",
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
children: await Promise.all( children: await Promise.all(
orgChild4Data orgChild4Data
@ -2790,99 +2790,99 @@ export class OrganizationController extends Controller {
"00" + "00" +
" " + " " +
orgRoot.orgRootShortName, orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({ // totalPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
}, // },
}), // }),
totalPositionCurrentUse: await this.posMasterRepository.count({ // totalPositionCurrentUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionCurrentVacant: await this.posMasterRepository.count({ // totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalPositionNextUse: await this.posMasterRepository.count({ // totalPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalPositionNextVacant: await this.posMasterRepository.count({ // totalPositionNextVacant: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPosition: await this.posMasterRepository.count({ // totalRootPosition: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
}, // },
}), // }),
totalRootPositionCurrentUse: await this.posMasterRepository.count( // totalRootPositionCurrentUse: await this.posMasterRepository.count(
{ // {
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
current_holderId: Not(IsNull()) || Not(""), // current_holderId: Not(IsNull()) || Not(""),
}, // },
}, // },
), // ),
totalRootPositionCurrentVacant: // totalRootPositionCurrentVacant:
await this.posMasterRepository.count({ // await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
current_holderId: IsNull() || "", // current_holderId: IsNull() || "",
}, // },
}), // }),
totalRootPositionNextUse: await this.posMasterRepository.count({ // totalRootPositionNextUse: await this.posMasterRepository.count({
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
next_holderId: Not(IsNull()) || Not(""), // next_holderId: Not(IsNull()) || Not(""),
}, // },
}), // }),
totalRootPositionNextVacant: await this.posMasterRepository.count( // totalRootPositionNextVacant: await this.posMasterRepository.count(
{ // {
where: { // where: {
orgRevisionId: orgRoot.orgRevisionId, // orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id, // orgRootId: orgRoot.id,
orgChild1Id: orgChild1.id, // orgChild1Id: orgChild1.id,
orgChild2Id: orgChild2.id, // orgChild2Id: orgChild2.id,
orgChild3Id: orgChild3.id, // orgChild3Id: orgChild3.id,
orgChild4Id: orgChild4.id, // orgChild4Id: orgChild4.id,
next_holderId: IsNull() || "", // next_holderId: IsNull() || "",
}, // },
}, // },
), // ),
})), })),
), ),
})), })),