no message
This commit is contained in:
parent
3bfbb93691
commit
bc86f4d2d9
5 changed files with 200 additions and 128 deletions
|
|
@ -753,46 +753,56 @@ export class OrganizationController extends Controller {
|
|||
},
|
||||
}),
|
||||
totalRootPosition: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : IsNull() || "", orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: IsNull() || "",
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : IsNull() || "", orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: IsNull() || "",
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : IsNull() || "", orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: IsNull() || "",
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : IsNull() || "", orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: IsNull() || "",
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : IsNull() || "", orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: IsNull() || "",
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
|
|
@ -849,46 +859,56 @@ export class OrganizationController extends Controller {
|
|||
},
|
||||
}),
|
||||
totalRootPosition: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : IsNull() || "",
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: IsNull() || "",
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
|
|
@ -948,46 +968,56 @@ export class OrganizationController extends Controller {
|
|||
},
|
||||
}),
|
||||
totalRootPosition: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : IsNull() || "", orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: IsNull() || "",
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
|
|
@ -1047,46 +1077,56 @@ export class OrganizationController extends Controller {
|
|||
},
|
||||
}),
|
||||
totalRootPosition: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: IsNull() || "",
|
||||
current_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: IsNull() || "",
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
|
|
@ -1147,49 +1187,62 @@ export class OrganizationController extends Controller {
|
|||
},
|
||||
}),
|
||||
totalRootPosition: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : orgChild4.id,
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : orgChild4.id,
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : orgChild4.id,
|
||||
current_holderId: IsNull() || "",
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: orgChild4.id,
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse:
|
||||
await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: orgChild4.id,
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentVacant:
|
||||
await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: orgChild4.id,
|
||||
current_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextUse: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : orgChild4.id,
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: orgChild4.id,
|
||||
next_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id : orgChild1.id, orgChild2Id : orgChild2.id,
|
||||
orgChild3Id : orgChild3.id, orgChild4Id : orgChild4.id,
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant:
|
||||
await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild2Id: orgChild2.id,
|
||||
orgChild3Id: orgChild3.id,
|
||||
orgChild4Id: orgChild4.id,
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
})),
|
||||
),
|
||||
})),
|
||||
|
|
@ -1541,15 +1594,24 @@ export class OrganizationController extends Controller {
|
|||
orgRevisionDraft.orgRevisionIsCurrent = true;
|
||||
orgRevisionDraft.orgRevisionIsDraft = false;
|
||||
await this.orgRevisionRepository.save(orgRevisionDraft);
|
||||
|
||||
const posMaster = await this.posMasterRepository.find({
|
||||
where: { orgRevisionId: orgRevisionDraft.id },
|
||||
});
|
||||
posMaster.forEach(async (item) => {
|
||||
// if(item.next_holderId != null){
|
||||
item.current_holderId = item.next_holderId;
|
||||
item.next_holderId = null;
|
||||
await this.posMasterRepository.save(item);
|
||||
// }
|
||||
});
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cronjob
|
||||
*/
|
||||
async cronjobRevision() {
|
||||
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0); // Set time to the beginning of the day
|
||||
const orgRevisionPublish = await this.orgRevisionRepository
|
||||
|
|
@ -1571,7 +1633,6 @@ export class OrganizationController extends Controller {
|
|||
orgRevisionPublish.orgRevisionIsDraft = false;
|
||||
orgRevisionPublish.orgRevisionIsCurrent = false;
|
||||
await this.orgRevisionRepository.save(orgRevisionPublish);
|
||||
|
||||
}
|
||||
orgRevisionDraft.orgRevisionIsCurrent = true;
|
||||
orgRevisionDraft.orgRevisionIsDraft = false;
|
||||
|
|
@ -1582,12 +1643,12 @@ export class OrganizationController extends Controller {
|
|||
});
|
||||
posMaster.forEach(async (item) => {
|
||||
// if(item.next_holderId != null){
|
||||
item.current_holderId = item.next_holderId;
|
||||
item.next_holderId = null;
|
||||
await this.posMasterRepository.save(item);
|
||||
item.current_holderId = item.next_holderId;
|
||||
item.next_holderId = null;
|
||||
await this.posMasterRepository.save(item);
|
||||
// }
|
||||
});
|
||||
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue