From d12ccd88fbca4cd4d448af12556fef28c2d2e30f Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 26 Jun 2024 15:14:12 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB=E0=B8=B23?= =?UTF-8?q?=20=E0=B8=A3=E0=B8=B0=E0=B8=94=E0=B8=B1=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PositionController.ts | 40 ++++++--------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 9d7ba81b..e9d1499f 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -3256,37 +3256,15 @@ export class PositionController extends Controller { posId.push(body.posmasterId); let typeCondition: any = {}; if (body.isAll == true) { - if (posMasterMain.orgChild4Id != null) { - typeCondition = { - orgChild4Id: body.posmasterId, - current_holderId: Not(IsNull()), - id: Not(In(posId)), - }; - } else if (posMasterMain.orgChild3Id != null) { - typeCondition = { - orgChild3Id: body.posmasterId, - current_holderId: Not(IsNull()), - id: Not(In(posId)), - }; - } else if (posMasterMain.orgChild2Id != null) { - typeCondition = { - orgChild2Id: body.posmasterId, - current_holderId: Not(IsNull()), - id: Not(In(posId)), - }; - } else if (posMasterMain.orgChild1Id != null) { - typeCondition = { - orgChild1Id: body.posmasterId, - current_holderId: Not(IsNull()), - id: Not(In(posId)), - }; - } else if (posMasterMain.orgRootId != null) { - typeCondition = { - orgRootId: body.posmasterId, - current_holderId: Not(IsNull()), - id: Not(In(posId)), - }; - } + typeCondition = { + orgRootId: posMasterMain.orgRootId, + orgChild1Id: posMasterMain.orgChild1Id, + orgChild2Id: posMasterMain.orgChild2Id, + orgChild3Id: posMasterMain.orgChild3Id, + orgChild4Id: posMasterMain.orgChild4Id, + current_holderId: Not(IsNull()), + id: Not(In(posId)), + }; } else { typeCondition = { orgRootId: posMasterMain.orgRootId == null ? IsNull() : posMasterMain.orgRootId,