From f953ba6d270bd7e50cb4e5d3b9cbf7cb25660f7d Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 13 Nov 2024 14:47:27 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=AA=E0=B9=88=E0=B8=A7=E0=B8=99?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A0?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B9=83=E0=B8=95=E0=B9=89=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B9=84?= =?UTF-8?q?=E0=B8=A1=E0=B9=88=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileController.ts | 23 +++++++++++++++- src/controllers/ProfileEmployeeController.ts | 19 ++++++++++++- .../ProfileEmployeeTempController.ts | 27 +++++++++++++++++-- 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 38634422..83559285 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -4428,6 +4428,10 @@ export class ProfileController extends Controller { "posType", "current_holders", "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "profileSalary", ], order: { @@ -4444,6 +4448,10 @@ export class ProfileController extends Controller { "posType", "current_holders", "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "profileSalary", ], order: { @@ -5287,6 +5295,10 @@ export class ProfileController extends Controller { "posType", "current_holders", "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "profileSalary", "profileEducations", ], @@ -7000,7 +7012,16 @@ export class ProfileController extends Controller { ) { const profile = await this.profileRepo.findOne({ where: { keycloak: request.user.sub }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], + relations: [ + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + ], }); if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 97b21044..20014907 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1856,6 +1856,10 @@ export class ProfileEmployeeController extends Controller { "posType", "current_holders", "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "profileSalary", ], order: { @@ -2983,7 +2987,16 @@ export class ProfileEmployeeController extends Controller { ) { const profile = await this.profileRepo.findOne({ where: { keycloak: request.user.sub }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], + relations: [ + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + ], }); if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); @@ -3838,6 +3851,10 @@ export class ProfileEmployeeController extends Controller { "posType", "current_holders", "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "profileSalary", "profileEducations" ], diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index a676e793..2ad44993 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -1563,6 +1563,10 @@ export class ProfileEmployeeTempController extends Controller { "posType", "current_holders", "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", "profileSalary", ], order: { @@ -2614,7 +2618,16 @@ export class ProfileEmployeeTempController extends Controller { ) { const profile = await this.profileRepo.findOne({ where: { keycloak: request.user.sub }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], + relations: [ + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + ], }); if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); @@ -3431,7 +3444,17 @@ export class ProfileEmployeeTempController extends Controller { // await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน const profile = await this.profileRepo.findOne({ where: { id: id }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot", "profileEducations"], + relations: [ + "posLevel", + "posType", + "current_holders", + "current_holders.orgRoot", + "current_holders.orgChild1", + "current_holders.orgChild2", + "current_holders.orgChild3", + "current_holders.orgChild4", + "profileEducations" + ], order: { profileEducations: { createdAt: "DESC"