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"