This commit is contained in:
Bright 2025-04-02 18:45:25 +07:00
parent 8c2de2e7bf
commit 26a16c6833

View file

@ -2627,7 +2627,6 @@ export class CommandController extends Controller {
profileId: _posMasterCommission?.current_holder.id ?? _null,
});
}
const _posMasterOfficer = await this.posMasterRepository.findOne({
where: {
orgChild1: {
@ -2658,7 +2657,6 @@ export class CommandController extends Controller {
profileId: _posMasterOfficer?.current_holder.id ?? _null,
});
}
let _orgRoot: any = [];
let _orgChild1: any = [];
let _orgChild2: any = [];
@ -2743,7 +2741,7 @@ export class CommandController extends Controller {
current_holderId: Not(IsNull()),
},
],
relations: ["current_holder", "orgChild1", "orgChild2", "orgChild3", "orgChild4"],
relations: ["current_holder", "orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"],
});
if (_posMaster.length > 0) {
_posMaster.forEach((x: any) => {
@ -2756,12 +2754,12 @@ export class CommandController extends Controller {
organizationName: x.orgChild1 == null
? x.orgRoot.orgRootName
: x.orgChild2 == null
? x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName
: x.orgChild3 == null
? x.orgChil2.orgChild2Name + "\n" + x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName
: x.orgChild4 == null
? x.orgChil3.orgChild3Name + "\n" + x.orgChil2.orgChild2Name + "\n" + x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName
: x.orgChil4.orgChild4Name,
? x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName
: x.orgChild3 == null
? x.orgChild2.orgChild2Name + "\n" + x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName
: x.orgChild4 == null
? x.orgChild3.orgChild3Name + "\n" + x.orgChild2.orgChild2Name + "\n" + x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName
: x.orgChild4.orgChild4Name + "\n" + x.orgChild3.orgChild3Name + "\n" + x.orgChild2.orgChild2Name + "\n" + x.orgChild1.orgChild1Name + "\n" + x.orgRoot.orgRootName,
positionName: x?.current_holder.position ?? _null,
profileId: x?.current_holder.id ?? _null,
});