From 03084ca224cc1485432794c647b3487de821629e Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Wed, 14 May 2025 23:28:00 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=94=E0=B8=B1=E0=B8=9A=E0=B8=A5=E0=B8=B9=E0=B8=81?= =?UTF-8?q?=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationDotnetController.ts | 67 +++++++++---------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index feb87bbd..7cd02310 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -677,7 +677,7 @@ export class OrganizationDotnetController extends Controller { posLevel: (profile.posType == null || profile.posType?.posTypeShortName == null ? "" - : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? null), + : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? null, profileSalary: profile.profileSalary.length > 0 ? profile.profileSalary[0] : null, profileInsignia: profile.profileInsignias.length > 0 ? profile.profileInsignias[0] : null, @@ -1391,9 +1391,10 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsCurrent == true, )?.orgChild4?.ancestorDNA ?? null, commander: fullname, - posLevel: profile.posType?.posTypeShortName && profile.posLevel?.posLevelName - ? `${profile.posType.posTypeShortName} ${profile.posLevel.posLevelName}` - : profile.posType?.posTypeShortName || profile.posLevel?.posLevelName || "", + posLevel: + (profile.posType == null || profile.posType?.posTypeShortName == null + ? "" + : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? null, profileSalary: profile.profileSalary.length > 0 ? profile.profileSalary[0] : null, profileInsignia: profile.profileInsignias.length > 0 ? profile.profileInsignias[0] : null, @@ -2566,16 +2567,10 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsCurrent == true, )?.orgChild4?.ancestorDNA ?? null, posNo: shortName ?? "", - markDiscipline: profile.profileDisciplines.length > 0 - ? true - : false, + markDiscipline: profile.profileDisciplines.length > 0 ? true : false, markLeave: false, - markRate: profile.profileAssessments.length > 0 - ? true - : false, - markInsignia: profile.profileInsignias.length > 0 - ? true - : false, + markRate: profile.profileAssessments.length > 0 ? true : false, + markInsignia: profile.profileInsignias.length > 0 ? true : false, }; }); @@ -2690,9 +2685,10 @@ export class OrganizationDotnetController extends Controller { currentZipCode: profile.currentZipCode, // dutyTimeId: profile.dutyTimeId, // dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, - posLevel: profile.posType?.posTypeShortName && profile.posLevel?.posLevelName - ? `${profile.posType.posTypeShortName} ${profile.posLevel.posLevelName}` - : profile.posType?.posTypeShortName || profile.posLevel?.posLevelName || "", + posLevel: + (profile.posType == null || profile.posType?.posTypeShortName == null + ? "" + : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? "", profileSalary: profile.profileSalary, profileInsignia: profile.profileInsignias.map((x) => { @@ -2846,9 +2842,10 @@ export class OrganizationDotnetController extends Controller { currentZipCode: profile.currentZipCode, // dutyTimeId: profile.dutyTimeId, // dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, - posLevel: profile.posType?.posTypeShortName && profile.posLevel?.posLevelName - ? `${profile.posType.posTypeShortName} ${profile.posLevel.posLevelName}` - : profile.posType?.posTypeShortName || profile.posLevel?.posLevelName || "", + posLevel: + (profile.posType == null || profile.posType?.posTypeShortName == null + ? "" + : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? "", profileSalary: profile.profileSalary.map((x) => { return { ...x, date: x.commandDateAffect ?? new Date() }; @@ -2951,16 +2948,10 @@ export class OrganizationDotnetController extends Controller { x.orgRevision?.orgRevisionIsCurrent == true, )?.orgChild4?.ancestorDNA ?? null, posNo: shortName ?? "", - markDiscipline: profile.profileDisciplines.length > 0 - ? true - : false, + markDiscipline: profile.profileDisciplines.length > 0 ? true : false, markLeave: false, - markRate: profile.profileAssessments.length > 0 - ? true - : false, - markInsignia: profile.profileInsignias.length > 0 - ? true - : false, + markRate: profile.profileAssessments.length > 0 ? true : false, + markInsignia: profile.profileInsignias.length > 0 ? true : false, }; }); @@ -3946,9 +3937,10 @@ export class OrganizationDotnetController extends Controller { keycloak: item.keycloak, posNo: shortName, position: item.position, - positionLevel: item.posLevel - ? `${item.posType.posTypeShortName} ${item.posLevel.posLevelName}` - : "-", + positionLevel: + (item.posType == null || item.posType?.posTypeShortName == null + ? "" + : item.posType?.posTypeShortName + " ") + (item.posLevel?.posLevelName ?? ""), positionType: item.posType?.posTypeName ?? null, oc: Oc, }; @@ -4099,9 +4091,10 @@ export class OrganizationDotnetController extends Controller { keycloak: item.keycloak, posNo: shortName, position: item.position, - positionLevel: item.posLevel - ? `${item.posType.posTypeShortName} ${item.posLevel.posLevelName}` - : "-", + positionLevel: + (item.posType == null || item.posType?.posTypeShortName == null + ? "" + : item.posType?.posTypeShortName + " ") + (item.posLevel?.posLevelName ?? ""), positionType: item.posType?.posTypeName ?? null, oc: Oc, }; @@ -4328,9 +4321,9 @@ export class OrganizationDotnetController extends Controller { telephoneNumber: profile.telephoneNumber ?? "-", positionName: profile.position ?? "-", posLevel: - profile.posType && profile.posLevel - ? `${profile.posType?.posTypeShortName} ${profile.posLevel?.posLevelName}` - : "-", + (profile.posType == null || profile.posType?.posTypeShortName == null + ? "" + : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? "-", currentAddress: profile && profile.currentAddress