diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index c71e0b9e..b1eb4544 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -3569,17 +3569,17 @@ export class OrganizationController extends Controller { ) .map((x00: PosMaster) => ({ level: 2, - personID: x00.current_holder ? x00.current_holder.id : null, + personID: x00.current_holder ? x00.current_holder.id : "", name: x00.current_holder ? `${x00.current_holder.firstName} ${x00.current_holder.lastName}` - : null, + : "ว่าง", avatar: x00.current_holder && x00.current_holder.avatar != null && x00.current_holder.avatarName != null ? `${x00.current_holder.avatar}/${x00.current_holder.avatarName}` : null, - positionName: x00.current_holder ? x00.current_holder.position : null, + positionName: x00.current_holder ? x00.current_holder.position : "", positionNum: x00.orgRoot.orgRootShortName + x00.posMasterNo, positionNumInt: x00.posMasterNo, departmentName: x00.orgRoot.orgRootName, @@ -3603,17 +3603,17 @@ export class OrganizationController extends Controller { .map((x11: PosMaster) => { return { level: 3, - personID: x11.current_holder ? x11.current_holder.id : null, + personID: x11.current_holder ? x11.current_holder.id : "", name: x11.current_holder ? `${x11.current_holder.firstName} ${x11.current_holder.lastName}` - : null, + : "ว่าง", avatar: x11.current_holder && x11.current_holder.avatar != null && x11.current_holder.avatarName != null ? `${x11.current_holder.avatar}/${x11.current_holder.avatarName}` : null, - positionName: x11.current_holder ? x11.current_holder.position : null, + positionName: x11.current_holder ? x11.current_holder.position : "", positionNum: x11.orgChild1.orgChild1ShortName + x11.posMasterNo, positionNumInt: x11.posMasterNo, departmentName: x11.orgChild1.orgChild1Name, @@ -3636,17 +3636,17 @@ export class OrganizationController extends Controller { ) .map((x22: PosMaster) => ({ level: 4, - personID: x22.current_holder ? x22.current_holder.id : null, + personID: x22.current_holder ? x22.current_holder.id : "", name: x22.current_holder ? `${x22.current_holder.firstName} ${x22.current_holder.lastName}` - : null, + : "ว่าง", avatar: x22.current_holder && x22.current_holder.avatar != null && x22.current_holder.avatarName != null ? `${x22.current_holder.avatar}/${x22.current_holder.avatarName}` : null, - positionName: x22.current_holder ? x22.current_holder.position : null, + positionName: x22.current_holder ? x22.current_holder.position : "", positionNum: `${x22.orgChild2.orgChild2ShortName} ${x22.posMasterNo}`, positionNumInt: x22.posMasterNo, departmentName: x22.orgChild2.orgChild2Name, @@ -3667,10 +3667,10 @@ export class OrganizationController extends Controller { ) .map((x33: PosMaster) => ({ level: 5, - personID: x33.current_holder ? x33.current_holder.id : null, + personID: x33.current_holder ? x33.current_holder.id : "", name: x33.current_holder ? `${x33.current_holder.firstName} ${x33.current_holder.lastName}` - : null, + : "ว่าง", avatar: x33.current_holder && x33.current_holder.avatar != null && @@ -3679,7 +3679,7 @@ export class OrganizationController extends Controller { : null, positionName: x33.current_holder ? x33.current_holder.position - : null, + : "", positionNum: x33.orgChild3.orgChild3ShortName + x33.posMasterNo, positionNumInt: x33.posMasterNo, departmentName: x33.orgChild3.orgChild3Name, @@ -3698,10 +3698,10 @@ export class OrganizationController extends Controller { ) .map((x44: PosMaster) => ({ level: 5, - personID: x44.current_holder ? x44.current_holder.id : null, + personID: x44.current_holder ? x44.current_holder.id : "", name: x44.current_holder ? `${x44.current_holder.firstName} ${x44.current_holder.lastName}` - : null, + : "ว่าง", avatar: x44.current_holder && x44.current_holder.avatar != null && @@ -3710,7 +3710,7 @@ export class OrganizationController extends Controller { : null, positionName: x44.current_holder ? x44.current_holder.position - : null, + : "", positionNum: x44.orgChild4.orgChild4ShortName + x44.posMasterNo, positionNumInt: x44.posMasterNo, @@ -3721,10 +3721,10 @@ export class OrganizationController extends Controller { return { level: 4, - personID: x4.current_holder ? x4.current_holder.id : null, + personID: x4.current_holder ? x4.current_holder.id : "", name: x4.current_holder ? `${x4.current_holder.firstName} ${x4.current_holder.lastName}` - : null, + : "ว่าง", avatar: x4.current_holder && x4.current_holder.avatar != null && @@ -3733,7 +3733,7 @@ export class OrganizationController extends Controller { : null, positionName: x4.current_holder ? x4.current_holder.position - : null, + : "", positionNum: x4.orgChild4.orgChild4ShortName + x4.posMasterNo, positionNumInt: x4.posMasterNo, departmentName: x4.orgChild4.orgChild4Name, @@ -3745,17 +3745,17 @@ export class OrganizationController extends Controller { return { level: 4, - personID: x3.current_holder ? x3.current_holder.id : null, + personID: x3.current_holder ? x3.current_holder.id : "", name: x3.current_holder ? `${x3.current_holder.firstName} ${x3.current_holder.lastName}` - : null, + : "ว่าง", avatar: x3.current_holder && x3.current_holder.avatar != null && x3.current_holder.avatarName != null ? `${x3.current_holder.avatar}/${x3.current_holder.avatarName}` : null, - positionName: x3.current_holder ? x3.current_holder.position : null, + positionName: x3.current_holder ? x3.current_holder.position : "", positionNum: `${x3.orgChild3.orgChild3ShortName} ${x3.posMasterNo}`, positionNumInt: x3.posMasterNo, departmentName: x3.orgChild3.orgChild3Name, @@ -3767,17 +3767,17 @@ export class OrganizationController extends Controller { return { level: 3, - personID: x2.current_holder ? x2.current_holder.id : null, + personID: x2.current_holder ? x2.current_holder.id : "", name: x2.current_holder ? `${x2.current_holder.firstName} ${x2.current_holder.lastName}` - : null, + : "ว่าง", avatar: x2.current_holder && x2.current_holder.avatar != null && x2.current_holder.avatarName != null ? `${x2.current_holder.avatar}/${x2.current_holder.avatarName}` : null, - positionName: x2.current_holder ? x2.current_holder.position : null, + positionName: x2.current_holder ? x2.current_holder.position : "", positionNum: x2.orgChild2.orgChild2ShortName + x2.posMasterNo, positionNumInt: x2.posMasterNo, departmentName: x2.orgChild2.orgChild2Name, @@ -3789,17 +3789,17 @@ export class OrganizationController extends Controller { return { level: 2, - personID: x1.current_holder ? x1.current_holder.id : null, + personID: x1.current_holder ? x1.current_holder.id : "", name: x1.current_holder ? `${x1.current_holder.firstName} ${x1.current_holder.lastName}` - : null, + : "ว่าง", avatar: x1.current_holder && x1.current_holder.avatar != null && x1.current_holder.avatarName != null ? `${x1.current_holder.avatar}/${x1.current_holder.avatarName}` : null, - positionName: x1.current_holder ? x1.current_holder.position : null, + positionName: x1.current_holder ? x1.current_holder.position : "", positionNum: x1.orgChild1.orgChild1ShortName + x1.posMasterNo, positionNumInt: x1.posMasterNo, departmentName: x1.orgChild1.orgChild1Name, @@ -3898,17 +3898,17 @@ export class OrganizationController extends Controller { ) .map((x00: PosMaster) => ({ level: 2, - personID: x00.next_holder ? x00.next_holder.id : null, + personID: x00.next_holder ? x00.next_holder.id : "", name: x00.next_holder ? `${x00.next_holder.firstName} ${x00.next_holder.lastName}` - : null, + : "ว่าง", avatar: x00.next_holder && x00.next_holder.avatar != null && x00.next_holder.avatarName != null ? `${x00.next_holder.avatar}/${x00.next_holder.avatarName}` : null, - positionName: x00.next_holder ? x00.next_holder.position : null, + positionName: x00.next_holder ? x00.next_holder.position : "", positionNum: x00.orgRoot.orgRootShortName + x00.posMasterNo, positionNumInt: x00.posMasterNo, departmentName: x00.orgRoot.orgRootName, @@ -3930,17 +3930,17 @@ export class OrganizationController extends Controller { .map((x11: PosMaster) => { return { level: 3, - personID: x11.next_holder ? x11.next_holder.id : null, + personID: x11.next_holder ? x11.next_holder.id : "", name: x11.next_holder ? `${x11.next_holder.firstName} ${x11.next_holder.lastName}` - : null, + : "ว่าง", avatar: x11.next_holder && x11.next_holder.avatar != null && x11.next_holder.avatarName != null ? `${x11.next_holder.avatar}/${x11.next_holder.avatarName}` : null, - positionName: x11.next_holder ? x11.next_holder.position : null, + positionName: x11.next_holder ? x11.next_holder.position : "", positionNum: x11.orgChild1.orgChild1ShortName + x11.posMasterNo, positionNumInt: x11.posMasterNo, departmentName: x11.orgChild1.orgChild1Name, @@ -3963,17 +3963,17 @@ export class OrganizationController extends Controller { ) .map((x22: PosMaster) => ({ level: 4, - personID: x22.next_holder ? x22.next_holder.id : null, + personID: x22.next_holder ? x22.next_holder.id : "", name: x22.next_holder ? `${x22.next_holder.firstName} ${x22.next_holder.lastName}` - : null, + : "ว่าง", avatar: x22.next_holder && x22.next_holder.avatar != null && x22.next_holder.avatarName != null ? `${x22.next_holder.avatar}/${x22.next_holder.avatarName}` : null, - positionName: x22.next_holder ? x22.next_holder.position : null, + positionName: x22.next_holder ? x22.next_holder.position : "", positionNum: `${x22.orgChild2.orgChild2ShortName} ${x22.posMasterNo}`, positionNumInt: x22.posMasterNo, departmentName: x22.orgChild2.orgChild2Name, @@ -3994,17 +3994,17 @@ export class OrganizationController extends Controller { ) .map((x33: PosMaster) => ({ level: 5, - personID: x33.next_holder ? x33.next_holder.id : null, + personID: x33.next_holder ? x33.next_holder.id : "", name: x33.next_holder ? `${x33.next_holder.firstName} ${x33.next_holder.lastName}` - : null, + : "ว่าง", avatar: x33.next_holder && x33.next_holder.avatar != null && x33.next_holder.avatarName != null ? `${x33.next_holder.avatar}/${x33.next_holder.avatarName}` : null, - positionName: x33.next_holder ? x33.next_holder.position : null, + positionName: x33.next_holder ? x33.next_holder.position : "", positionNum: x33.orgChild3.orgChild3ShortName + x33.posMasterNo, positionNumInt: x33.posMasterNo, departmentName: x33.orgChild3.orgChild3Name, @@ -4023,19 +4023,17 @@ export class OrganizationController extends Controller { ) .map((x44: PosMaster) => ({ level: 5, - personID: x44.next_holder ? x44.next_holder.id : null, + personID: x44.next_holder ? x44.next_holder.id : "", name: x44.next_holder ? `${x44.next_holder.firstName} ${x44.next_holder.lastName}` - : null, + : "ว่าง", avatar: x44.next_holder && x44.next_holder.avatar != null && x44.next_holder.avatarName != null ? `${x44.next_holder.avatar}/${x44.next_holder.avatarName}` : null, - positionName: x44.next_holder - ? x44.next_holder.position - : null, + positionName: x44.next_holder ? x44.next_holder.position : "", positionNum: x44.orgChild4.orgChild4ShortName + x44.posMasterNo, positionNumInt: x44.posMasterNo, @@ -4046,17 +4044,17 @@ export class OrganizationController extends Controller { return { level: 4, - personID: x4.next_holder ? x4.next_holder.id : null, + personID: x4.next_holder ? x4.next_holder.id : "", name: x4.next_holder ? `${x4.next_holder.firstName} ${x4.next_holder.lastName}` - : null, + : "ว่าง", avatar: x4.next_holder && x4.next_holder.avatar != null && x4.next_holder.avatarName != null ? `${x4.next_holder.avatar}/${x4.next_holder.avatarName}` : null, - positionName: x4.next_holder ? x4.next_holder.position : null, + positionName: x4.next_holder ? x4.next_holder.position : "", positionNum: x4.orgChild4.orgChild4ShortName + x4.posMasterNo, positionNumInt: x4.posMasterNo, departmentName: x4.orgChild4.orgChild4Name, @@ -4068,17 +4066,17 @@ export class OrganizationController extends Controller { return { level: 4, - personID: x3.next_holder ? x3.next_holder.id : null, + personID: x3.next_holder ? x3.next_holder.id : "", name: x3.next_holder ? `${x3.next_holder.firstName} ${x3.next_holder.lastName}` - : null, + : "ว่าง", avatar: x3.next_holder && x3.next_holder.avatar != null && x3.next_holder.avatarName != null ? `${x3.next_holder.avatar}/${x3.next_holder.avatarName}` : null, - positionName: x3.next_holder ? x3.next_holder.position : null, + positionName: x3.next_holder ? x3.next_holder.position : "", positionNum: `${x3.orgChild3.orgChild3ShortName} ${x3.posMasterNo}`, positionNumInt: x3.posMasterNo, departmentName: x3.orgChild3.orgChild3Name, @@ -4090,17 +4088,17 @@ export class OrganizationController extends Controller { return { level: 3, - personID: x2.next_holder ? x2.next_holder.id : null, + personID: x2.next_holder ? x2.next_holder.id : "", name: x2.next_holder ? `${x2.next_holder.firstName} ${x2.next_holder.lastName}` - : null, + : "ว่าง", avatar: x2.next_holder && x2.next_holder.avatar != null && x2.next_holder.avatarName != null ? `${x2.next_holder.avatar}/${x2.next_holder.avatarName}` : null, - positionName: x2.next_holder ? x2.next_holder.position : null, + positionName: x2.next_holder ? x2.next_holder.position : "", positionNum: x2.orgChild2.orgChild2ShortName + x2.posMasterNo, positionNumInt: x2.posMasterNo, departmentName: x2.orgChild2.orgChild2Name, @@ -4112,17 +4110,17 @@ export class OrganizationController extends Controller { return { level: 2, - personID: x1.next_holder ? x1.next_holder.id : null, + personID: x1.next_holder ? x1.next_holder.id : "", name: x1.next_holder ? `${x1.next_holder.firstName} ${x1.next_holder.lastName}` - : null, + : "ว่าง", avatar: x1.next_holder && x1.next_holder.avatar != null && x1.next_holder.avatarName != null ? `${x1.next_holder.avatar}/${x1.next_holder.avatarName}` : null, - positionName: x1.next_holder ? x1.next_holder.position : null, + positionName: x1.next_holder ? x1.next_holder.position : "", positionNum: x1.orgChild1.orgChild1ShortName + x1.posMasterNo, positionNumInt: x1.posMasterNo, departmentName: x1.orgChild1.orgChild1Name,