diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 46dd1dba..67ebf75c 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -2503,57 +2503,57 @@ export class PositionController extends Controller { typeCondition = { orgRootId: body.nodeId, orgChild1Id: IsNull(), - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 1) { typeCondition = { orgChild1Id: body.nodeId, orgChild2Id: IsNull(), - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 2) { typeCondition = { orgChild2Id: body.nodeId, orgChild3Id: IsNull(), - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 3) { typeCondition = { orgChild3Id: body.nodeId, orgChild4Id: IsNull(), - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 4) { typeCondition = { orgChild4Id: body.nodeId, - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } } else { if (body.node === 0) { typeCondition = { orgRootId: body.nodeId, - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 1) { typeCondition = { orgChild1Id: body.nodeId, - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 2) { typeCondition = { orgChild2Id: body.nodeId, - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 3) { typeCondition = { orgChild3Id: body.nodeId, - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } else if (body.node === 4) { typeCondition = { orgChild4Id: body.nodeId, - current_holder: body.isBlank == true ? IsNull() : Not(IsNull()), + current_holderId: body.isBlank == true ? IsNull() : Not(IsNull()), }; } } @@ -2629,8 +2629,29 @@ export class PositionController extends Controller { shortName = posMaster.orgChild4.orgChild4ShortName; } + let node: any = null; + let nodeId: any = null; + if (posMaster.orgChild4Id != null) { + node = 4; + nodeId = posMaster.orgChild4Id; + } else if (posMaster.orgChild3Id != null) { + node = 3; + nodeId = posMaster.orgChild3Id; + } else if (posMaster.orgChild2Id != null) { + node = 2; + nodeId = posMaster.orgChild2Id; + } else if (posMaster.orgChild1Id != null) { + node = 1; + nodeId = posMaster.orgChild1Id; + } else if (posMaster.orgRootId != null) { + node = 0; + nodeId = posMaster.orgRootId; + } + return { id: posMaster.id, + node: node, + nodeId: nodeId, orgRootId: posMaster.orgRootId, orgChild1Id: posMaster.orgChild1Id, orgChild2Id: posMaster.orgChild2Id,