no message
This commit is contained in:
parent
971fac10d1
commit
8dfb093a9e
1 changed files with 106 additions and 4 deletions
|
|
@ -2758,12 +2758,63 @@ export class OrganizationDotnetController extends Controller {
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Body()
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
node: string;
|
node: number;
|
||||||
nodeId: string;
|
nodeId: string;
|
||||||
|
isAll: boolean;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
let typeCondition: any = {};
|
||||||
|
if (body.isAll == false) {
|
||||||
|
if (body.node === 0) {
|
||||||
|
typeCondition = {
|
||||||
|
orgRootId: body.nodeId,
|
||||||
|
orgChild1Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 1) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild1Id: body.nodeId,
|
||||||
|
orgChild2Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 2) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild2Id: body.nodeId,
|
||||||
|
orgChild3Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 3) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild3Id: body.nodeId,
|
||||||
|
orgChild4Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 4) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild4Id: body.nodeId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (body.node === 0) {
|
||||||
|
typeCondition = {
|
||||||
|
orgRootId: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 1) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild1Id: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 2) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild2Id: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 3) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild3Id: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 4) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild4Id: body.nodeId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
const profile = await this.profileRepo.find({
|
const profile = await this.profileRepo.find({
|
||||||
where: { keycloak: Not(IsNull()) || Not(""), isLeave: false },
|
where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition },
|
||||||
relations: [
|
relations: [
|
||||||
"current_holders",
|
"current_holders",
|
||||||
"current_holders.orgRoot",
|
"current_holders.orgRoot",
|
||||||
|
|
@ -2831,12 +2882,63 @@ export class OrganizationDotnetController extends Controller {
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Body()
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
node: string;
|
node: number;
|
||||||
nodeId: string;
|
nodeId: string;
|
||||||
|
isAll: boolean;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
let typeCondition: any = {};
|
||||||
|
if (body.isAll == false) {
|
||||||
|
if (body.node === 0) {
|
||||||
|
typeCondition = {
|
||||||
|
orgRootId: body.nodeId,
|
||||||
|
orgChild1Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 1) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild1Id: body.nodeId,
|
||||||
|
orgChild2Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 2) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild2Id: body.nodeId,
|
||||||
|
orgChild3Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 3) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild3Id: body.nodeId,
|
||||||
|
orgChild4Id: IsNull(),
|
||||||
|
};
|
||||||
|
} else if (body.node === 4) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild4Id: body.nodeId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (body.node === 0) {
|
||||||
|
typeCondition = {
|
||||||
|
orgRootId: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 1) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild1Id: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 2) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild2Id: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 3) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild3Id: body.nodeId,
|
||||||
|
};
|
||||||
|
} else if (body.node === 4) {
|
||||||
|
typeCondition = {
|
||||||
|
orgChild4Id: body.nodeId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
const profile = await this.profileEmpRepo.find({
|
const profile = await this.profileEmpRepo.find({
|
||||||
where: { keycloak: Not(IsNull()) || Not(""), isLeave: false },
|
where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition },
|
||||||
relations: [
|
relations: [
|
||||||
"current_holders",
|
"current_holders",
|
||||||
"current_holders.orgRoot",
|
"current_holders.orgRoot",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue