From 3475224f36cd387721366948f5aa76050682fad6 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 8 Jan 2025 18:57:01 +0700 Subject: [PATCH] director --- src/controllers/ProfileController.ts | 154 +++++++++++++-------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 0f2fcd10..3cd59567 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -1310,36 +1310,36 @@ export class ProfileController extends Controller { orgRootId: posMaster.orgRootId, id: Not(posMaster.current_holderId || ""), }; - let conditionNow: any = { - orgRootId: posMaster.orgRootId, - orgChild1Id: posMaster.orgChild1Id, - orgChild2Id: posMaster.orgChild2Id, - orgChild3Id: posMaster.orgChild3Id, - orgChild4Id: posMaster.orgChild4Id, - id: Not(posMaster.current_holderId), - }; - if (posMaster.orgChild1Id == null) { - } else if (posMaster.orgChild2Id == null) { - condition.orgChild1Id = null; - } else if (posMaster.orgChild3Id == null) { - condition.orgChild2Id = null; - } else if (posMaster.orgChild4Id == null) { - condition.orgChild3Id = null; - } else { - condition.orgChild4Id = null; - } + // let conditionNow: any = { + // orgRootId: posMaster.orgRootId, + // orgChild1Id: posMaster.orgChild1Id, + // orgChild2Id: posMaster.orgChild2Id, + // orgChild3Id: posMaster.orgChild3Id, + // orgChild4Id: posMaster.orgChild4Id, + // id: Not(posMaster.current_holderId), + // }; + // if (posMaster.orgChild1Id == null) { + // } else if (posMaster.orgChild2Id == null) { + // condition.orgChild1Id = null; + // } else if (posMaster.orgChild3Id == null) { + // condition.orgChild2Id = null; + // } else if (posMaster.orgChild4Id == null) { + // condition.orgChild3Id = null; + // } else { + // condition.orgChild4Id = null; + // } if (body.isDirector == true) { condition.isDirector = true; - conditionNow.isDirector = true; + // conditionNow.isDirector = true; } const [lists, total] = await AppDataSource.getRepository(viewDirectorActing) .createQueryBuilder("viewDirectorActing") - // .andWhere(condition) - .andWhere( - new Brackets((qb) => { - qb.orWhere(condition).orWhere(conditionNow); - }), - ) + .andWhere(condition) + // .andWhere( + // new Brackets((qb) => { + // qb.orWhere(condition).orWhere(conditionNow); + // }), + // ) .andWhere( new Brackets((qb) => { qb.orWhere( @@ -1426,37 +1426,37 @@ export class ProfileController extends Controller { orgRootId: posMaster.orgRootId, id: Not(posMaster.current_holderId || ""), }; - let conditionNow: any = { - orgRootId: posMaster.orgRootId, - orgChild1Id: posMaster.orgChild1Id, - orgChild2Id: posMaster.orgChild2Id, - orgChild3Id: posMaster.orgChild3Id, - orgChild4Id: posMaster.orgChild4Id, - id: Not(posMaster.current_holderId), - }; - if (posMaster.orgChild1Id == null) { - condition.orgRootId = null; - } else if (posMaster.orgChild2Id == null) { - condition.orgChild1Id = null; - } else if (posMaster.orgChild3Id == null) { - condition.orgChild2Id = null; - } else if (posMaster.orgChild4Id == null) { - condition.orgChild3Id = null; - } else { - condition.orgChild4Id = null; - } + // let conditionNow: any = { + // orgRootId: posMaster.orgRootId, + // orgChild1Id: posMaster.orgChild1Id, + // orgChild2Id: posMaster.orgChild2Id, + // orgChild3Id: posMaster.orgChild3Id, + // orgChild4Id: posMaster.orgChild4Id, + // id: Not(posMaster.current_holderId), + // }; + // if (posMaster.orgChild1Id == null) { + // condition.orgRootId = null; + // } else if (posMaster.orgChild2Id == null) { + // condition.orgChild1Id = null; + // } else if (posMaster.orgChild3Id == null) { + // condition.orgChild2Id = null; + // } else if (posMaster.orgChild4Id == null) { + // condition.orgChild3Id = null; + // } else { + // condition.orgChild4Id = null; + // } if (body.isDirector == true) { condition.isDirector = true; - conditionNow.isDirector = true; + // conditionNow.isDirector = true; } const [lists, total] = await AppDataSource.getRepository(viewDirectorActing) .createQueryBuilder("viewDirectorActing") - // .andWhere(condition) - .andWhere( - new Brackets((qb) => { - qb.orWhere(condition).orWhere(conditionNow); - }), - ) + .andWhere(condition) + // .andWhere( + // new Brackets((qb) => { + // qb.orWhere(condition).orWhere(conditionNow); + // }), + // ) .andWhere( new Brackets((qb) => { qb.orWhere( @@ -1518,37 +1518,37 @@ export class ProfileController extends Controller { orgRootId: posMaster.orgRootId, id: Not(posMaster.current_holderId || ""), }; - let conditionNow: any = { - orgRootId: posMaster.orgRootId, - orgChild1Id: posMaster.orgChild1Id, - orgChild2Id: posMaster.orgChild2Id, - orgChild3Id: posMaster.orgChild3Id, - orgChild4Id: posMaster.orgChild4Id, - id: Not(posMaster.current_holderId), - }; - if (posMaster.orgChild1Id == null) { - condition.orgRootId = null; - } else if (posMaster.orgChild2Id == null) { - condition.orgChild1Id = null; - } else if (posMaster.orgChild3Id == null) { - condition.orgChild2Id = null; - } else if (posMaster.orgChild4Id == null) { - condition.orgChild3Id = null; - } else { - condition.orgChild4Id = null; - } + // let conditionNow: any = { + // orgRootId: posMaster.orgRootId, + // orgChild1Id: posMaster.orgChild1Id, + // orgChild2Id: posMaster.orgChild2Id, + // orgChild3Id: posMaster.orgChild3Id, + // orgChild4Id: posMaster.orgChild4Id, + // id: Not(posMaster.current_holderId), + // }; + // if (posMaster.orgChild1Id == null) { + // condition.orgRootId = null; + // } else if (posMaster.orgChild2Id == null) { + // condition.orgChild1Id = null; + // } else if (posMaster.orgChild3Id == null) { + // condition.orgChild2Id = null; + // } else if (posMaster.orgChild4Id == null) { + // condition.orgChild3Id = null; + // } else { + // condition.orgChild4Id = null; + // } if (body.isDirector == true) { condition.isDirector = true; - conditionNow.isDirector = true; + // conditionNow.isDirector = true; } const [lists, total] = await AppDataSource.getRepository(viewDirector) .createQueryBuilder("viewDirector") - // .andWhere(condition) - .andWhere( - new Brackets((qb) => { - qb.orWhere(condition).orWhere(conditionNow); - }), - ) + .andWhere(condition) + // .andWhere( + // new Brackets((qb) => { + // qb.orWhere(condition).orWhere(conditionNow); + // }), + // ) .andWhere( new Brackets((qb) => { qb.orWhere(