From 06ea561e7854c393c590128b6627a4e1490fa8ce Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 20 Feb 2024 14:02:19 +0700 Subject: [PATCH] no message --- src/controllers/PositionController.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 2cafa7d1..5be01e62 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -623,8 +623,8 @@ export class PositionController extends Controller { } else { const dataDup: any = await this.posMasterRepository.findOne({ where: { - orgChild3Id: orgChild3.id, - orgChild4Id: IsNull() || "", + id: Not(posMaster.id), + orgChild4Id: orgChild4.id, posMasterNoPrefix: requestBody.posMasterNoPrefix, posMasterNo: requestBody.posMasterNo, posMasterNoSuffix: requestBody.posMasterNoSuffix, @@ -645,8 +645,8 @@ export class PositionController extends Controller { } else { const dataDup: any = await this.posMasterRepository.findOne({ where: { - orgChild2Id: orgChild2.id, - orgChild3Id: IsNull() || "", + id: Not(posMaster.id), + orgChild3Id: orgChild3.id, orgChild4Id: IsNull() || "", posMasterNoPrefix: requestBody.posMasterNoPrefix, posMasterNo: requestBody.posMasterNo, @@ -667,8 +667,8 @@ export class PositionController extends Controller { } else { const dataDup: any = await this.posMasterRepository.findOne({ where: { - orgChild1Id: orgChild1.id, - orgChild2Id: IsNull() || "", + id: Not(posMaster.id), + orgChild2Id: orgChild2.id, orgChild3Id: IsNull() || "", orgChild4Id: IsNull() || "", posMasterNoPrefix: requestBody.posMasterNoPrefix, @@ -689,8 +689,8 @@ export class PositionController extends Controller { } else { const dataDup: any = await this.posMasterRepository.findOne({ where: { - orgRootId: orgRoot.id, - orgChild1Id: IsNull() || "", + id: Not(posMaster.id), + orgChild1Id: orgChild1.id, orgChild2Id: IsNull() || "", orgChild3Id: IsNull() || "", orgChild4Id: IsNull() || "", @@ -711,6 +711,7 @@ export class PositionController extends Controller { } else { const dataDup: any = await this.posMasterRepository.findOne({ where: { + id: Not(posMaster.id), orgRootId: orgRoot.id, orgChild1Id: IsNull() || "", orgChild2Id: IsNull() || "",