From 857b0624f496cf8076873ac01132636bc790e028 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 29 May 2024 15:04:42 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=E0=B8=A5=E0=B9=88=E0=B8=B2=E0=B8=AA=E0=B8=B8?= =?UTF-8?q?=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationDotnetController.ts | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 5ff254b4..d921b77a 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -168,11 +168,67 @@ export class OrganizationDotnetController extends Controller { relations: { posLevel: true, posType: true, + profileSalary: true }, where: { keycloak: keycloakId }, + order:{ + profileSalary:{ + date: "DESC" + } + } }); if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); - return new HttpSuccess(profile); + + const mapProfile = { + id: profile.id, + avatar: profile.avatar, + avatarName: profile.avatarName, + rank: profile.rank, + prefix: profile.prefix, + firstName: profile.firstName, + lastName: profile.lastName, + citizenId: profile.citizenId, + position: profile.position, + posLevelId: profile.posLevelId, + email: profile.email, + phone: profile.phone, + keycloak: profile.keycloak, + isProbation: profile.isProbation, + isLeave: profile.isLeave, + leaveReason: profile.leaveReason, + dateRetire: profile.dateRetire, + dateAppoint: profile.dateAppoint, + dateRetireLaw: profile.dateRetireLaw, + dateStart: profile.dateStart, + govAgeAbsent: profile.govAgeAbsent, + govAgePlus: profile.govAgePlus, + birthDate: profile.birthDate, + reasonSameDate: profile.reasonSameDate, + telephoneNumber: profile.telephoneNumber, + nationality: profile.nationality, + gender: profile.gender, + relationship: profile.relationship, + religion: profile.religion, + bloodGroup: profile.bloodGroup, + registrationAddress: profile.registrationAddress, + registrationProvinceId: profile.registrationProvinceId, + registrationDistrictId: profile.registrationDistrictId, + registrationSubDistrictId: profile.registrationSubDistrictId, + registrationZipCode: profile.registrationZipCode, + currentAddress: profile.currentAddress, + currentProvinceId: profile.currentProvinceId, + currentSubDistrictId: profile.currentSubDistrictId, + currentZipCode: profile.currentZipCode, + dutyTimeId: profile.dutyTimeId, + dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, + posLevel: profile.posLevel? profile.posLevel : null, + posType: profile.posType? profile.posType : null, + profileSalary: profile.profileSalary.length > 0 + ? profile.profileSalary[0] + : null + } + + return new HttpSuccess(mapProfile); } /**