From dfcc136c797f45ad88c7a54b7767abc6e992a5f7 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 18 Dec 2024 17:44:28 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B9=89?= =?UTF-8?q?=E0=B8=A1=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B8=94=E0=B9=8C=E0=B8=AA?= =?UTF-8?q?=E0=B8=B1=E0=B8=87=E0=B8=81=E0=B8=B1=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationDotnetController.ts | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 1e9d4b85..66f401af 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -2920,7 +2920,20 @@ export class OrganizationDotnetController extends Controller { ?.orgRoot != null ? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot.orgRootShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}` : null; - + const Oc = + item.current_holders.length == 0 + ? null + : body.node == 4 && item.current_holders[0].orgChild4 != null + ? `${item.current_holders[0].orgChild4.orgChild4Name}/${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 3 && item.current_holders[0].orgChild3 != null + ? `${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 2 && item.current_holders[0].orgChild2 != null + ? `${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 1 && item.current_holders[0].orgChild1 != null + ? `${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 0 && item.current_holders[0].orgRoot != null + ? `${item.current_holders[0].orgRoot.orgRootName}` + : null; return { id: item.id, prefix: item.prefix, @@ -2931,6 +2944,7 @@ export class OrganizationDotnetController extends Controller { position: item.position, positionLevel: item.posLevel?.posLevelName ?? null, positionType: item.posType?.posTypeName ?? null, + oc: Oc }; }), ); @@ -3049,7 +3063,20 @@ export class OrganizationDotnetController extends Controller { ?.orgRoot != null ? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot.orgRootShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}` : null; - + const Oc = + item.current_holders.length == 0 + ? null + : body.node == 4 && item.current_holders[0].orgChild4 != null + ? `${item.current_holders[0].orgChild4.orgChild4Name}/${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 3 && item.current_holders[0].orgChild3 != null + ? `${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 2 && item.current_holders[0].orgChild2 != null + ? `${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 1 && item.current_holders[0].orgChild1 != null + ? `${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}` + : body.node == 0 && item.current_holders[0].orgRoot != null + ? `${item.current_holders[0].orgRoot.orgRootName}` + : null; return { id: item.id, prefix: item.prefix, @@ -3061,6 +3088,7 @@ export class OrganizationDotnetController extends Controller { position: item.position, positionLevel: item.posLevel?.posLevelName ?? null, positionType: item.posType?.posTypeName ?? null, + oc: Oc }; }), );