เพิ่้มฟิลด์สังกัด

This commit is contained in:
Bright 2024-12-18 17:44:28 +07:00
parent f79104be14
commit dfcc136c79

View file

@ -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
};
}),
);