diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 2bc89eb7..3c363fce 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -742,6 +742,28 @@ export class PositionController extends Controller { relations: ["posLevel", "posType", "posExecutive"], }); + if(body.isAll === true) { + if(posMaster.orgRootId !== null && posMaster.orgChild1Id == null && posMaster.orgChild2Id == null + && posMaster.orgChild2Id == null && posMaster.orgChild3Id == null) { + body.type = 0; + } + else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id == null + && posMaster.orgChild2Id == null && posMaster.orgChild3Id == null) { + body.type = 1; + } + else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id !== null + && posMaster.orgChild2Id == null && posMaster.orgChild3Id == null) { + body.type = 2; + } + else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id !== null + && posMaster.orgChild2Id !== null && posMaster.orgChild3Id == null) { + body.type = 3; + } + else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id !== null + && posMaster.orgChild2Id !== null && posMaster.orgChild3Id !== null) { + body.type = 4; + } + } return { id: posMaster.id, orgRootId: posMaster.orgRootId,