no message

This commit is contained in:
Kittapath 2024-02-06 15:21:36 +07:00
parent 344c277d1f
commit 129c58efaf

View file

@ -722,19 +722,35 @@ export class OrganizationController extends Controller {
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
totalPosition: await this.posMasterRepository.count({
where: { orgRootId: orgRoot.id },
where: { orgRevisionId: orgRoot.orgRevisionId, orgRootId: orgRoot.id },
}),
totalPositionCurrentUse: await this.posMasterRepository.count({
where: { orgRootId: orgRoot.id, profileIdCurrentHolder: Not(IsNull()) || Not("") },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id,
profileIdCurrentHolder: Not(IsNull()) || Not(""),
},
}),
totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { orgRootId: orgRoot.id, profileIdCurrentHolder: IsNull() || "" },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id,
profileIdCurrentHolder: IsNull() || "",
},
}),
totalPositionNextUse: await this.posMasterRepository.count({
where: { orgRootId: orgRoot.id, profileIdNextHolder: Not(IsNull()) || Not("") },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id,
profileIdNextHolder: Not(IsNull()) || Not(""),
},
}),
totalPositionNextVacant: await this.posMasterRepository.count({
where: { orgRootId: orgRoot.id, profileIdNextHolder: IsNull() || "" },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgRootId: orgRoot.id,
profileIdNextHolder: IsNull() || "",
},
}),
children: await Promise.all(
@ -758,25 +774,35 @@ export class OrganizationController extends Controller {
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
totalPosition: await this.posMasterRepository.count({
where: { orgChild1Id: orgChild1.id },
where: { orgRevisionId: orgRoot.orgRevisionId, orgChild1Id: orgChild1.id },
}),
totalPositionCurrentUse: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id,
profileIdCurrentHolder: Not(IsNull()) || Not(""),
},
}),
totalPositionCurrentVacant: await this.posMasterRepository.count({
where: { orgChild1Id: orgChild1.id, profileIdCurrentHolder: IsNull() || "" },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id,
profileIdCurrentHolder: IsNull() || "",
},
}),
totalPositionNextUse: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id,
profileIdNextHolder: Not(IsNull()) || Not(""),
},
}),
totalPositionNextVacant: await this.posMasterRepository.count({
where: { orgChild1Id: orgChild1.id, profileIdNextHolder: IsNull() || "" },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild1Id: orgChild1.id,
profileIdNextHolder: IsNull() || "",
},
}),
children: await Promise.all(
orgChild2Data
@ -799,28 +825,38 @@ export class OrganizationController extends Controller {
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
totalPosition: await this.posMasterRepository.count({
where: { orgChild2Id: orgChild2.id },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id,
},
}),
totalPositionCurrentUse: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id,
profileIdCurrentHolder: Not(IsNull()) || Not(""),
},
}),
totalPositionCurrentVacant: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id,
profileIdCurrentHolder: IsNull() || "",
},
}),
totalPositionNextUse: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id,
profileIdNextHolder: Not(IsNull()) || Not(""),
},
}),
totalPositionNextVacant: await this.posMasterRepository.count({
where: { orgChild2Id: orgChild2.id, profileIdNextHolder: IsNull() || "" },
where: {
orgRevisionId: orgRoot.orgRevisionId,
orgChild2Id: orgChild2.id,
profileIdNextHolder: IsNull() || "",
},
}),
children: await Promise.all(
orgChild3Data