From 4127b76bc0426be364d5ca25e4410e991b5fa7c6 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 8 Feb 2024 15:07:55 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=95?= =?UTF-8?q?=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PositionController.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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,