no message
This commit is contained in:
parent
f2b4ff93c6
commit
ce504c6088
1 changed files with 9 additions and 19 deletions
|
|
@ -4215,9 +4215,7 @@ export class ProfileController extends Controller {
|
|||
@Query() yearLeave?: number,
|
||||
@Query() isProbation?: boolean,
|
||||
@Query() isRetire?: boolean,
|
||||
@Query() node?: number,
|
||||
@Query() nodeId?: string,
|
||||
@Query() isAll?: boolean,
|
||||
) {
|
||||
let queryLike =
|
||||
"CONCAT(profile.prefix, profile.firstName, ' ', profile.lastName) LIKE :keyword";
|
||||
|
|
@ -4236,24 +4234,16 @@ export class ProfileController extends Controller {
|
|||
END LIKE :keyword
|
||||
`;
|
||||
}
|
||||
let nodeCondition = "1=1";
|
||||
let nodeAll = "";
|
||||
if (node === 0 && nodeId) {
|
||||
nodeCondition = "current_holders.orgRootId = :nodeId";
|
||||
if (isAll == false) nodeAll = " AND current_holders.orgChild1Id IS NULL";
|
||||
} else if (node === 1 && nodeId) {
|
||||
nodeCondition = "current_holders.orgChild1Id = :nodeId";
|
||||
if (isAll == false) nodeAll = " AND current_holders.orgChild2Id IS NULL";
|
||||
} else if (node === 2 && nodeId) {
|
||||
nodeCondition = "current_holders.orgChild2Id = :nodeId";
|
||||
if (isAll == false) nodeAll = " AND current_holders.orgChild3Id IS NULL";
|
||||
} else if (node === 3 && nodeId) {
|
||||
nodeCondition = "current_holders.orgChild3Id = :nodeId";
|
||||
if (isAll == false) nodeAll = " AND current_holders.orgChild4Id IS NULL";
|
||||
} else if (node === 4 && nodeId) {
|
||||
nodeCondition = "current_holders.orgChild4Id = :nodeId";
|
||||
let posMaster = await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
current_holder: { keycloak: request.user.sub },
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
},
|
||||
});
|
||||
if (nodeId == null) {
|
||||
if (posMaster != null) nodeId = posMaster.orgRootId ?? "";
|
||||
}
|
||||
nodeCondition = nodeCondition + nodeAll;
|
||||
let nodeCondition = "current_holders.orgRootId = :nodeId";
|
||||
const findRevision = await this.orgRevisionRepo.findOne({
|
||||
where: { orgRevisionIsCurrent: true },
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue