diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index a1a13762..5b4849bd 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -7560,13 +7560,24 @@ export class OrganizationController extends Controller { */ @Get("root/search/sort") async searchSortRootLevelType(@Request() request: RequestWithUser) { - const root = await this.orgRootRepository.find({ + const root1 = await this.orgRootRepository.find({ where: { orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + DEPARTMENT_CODE: Not("50"), }, - order: { isDeputy: "DESC", DEPARTMENT_CODE: "ASC", orgRootName: "ASC" }, + order: { isDeputy: "DESC", orgRootOrder: "ASC" }, select: ["orgRootName"], }); + const root2 = await this.orgRootRepository.find({ + where: { + orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + DEPARTMENT_CODE: "50", + }, + order: { orgRootName: "ASC" }, + select: ["orgRootName"], + }); + const root = [root1, root2]; + const child1 = await this.child1Repository.find({ where: { orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 522c06da..3bcb59ef 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -274,6 +274,12 @@ export class OrganizationDotnetController extends Controller { async GetProfileByKeycloakIdAsync(@Path() keycloakId: string) { const profile = await this.profileRepo.findOne({ relations: [ + "registrationProvince", + "registrationDistrict", + "registrationSubDistrict", + "currentProvince", + "currentDistrict", + "currentSubDistrict", "posLevel", "posType", "profileSalary", @@ -303,6 +309,12 @@ export class OrganizationDotnetController extends Controller { if (!profile) { const profile = await this.profileEmpRepo.findOne({ relations: [ + "registrationProvince", + "registrationDistrict", + "registrationSubDistrict", + "currentProvince", + "currentDistrict", + "currentSubDistrict", "posLevel", "posType", "profileSalary", @@ -524,10 +536,17 @@ export class OrganizationDotnetController extends Controller { registrationProvinceId: profile.registrationProvinceId, registrationDistrictId: profile.registrationDistrictId, registrationSubDistrictId: profile.registrationSubDistrictId, + registrationProvince: profile.registrationProvince.id, + registrationDistrict: profile.registrationDistrict.id, + registrationSubDistrict: profile.registrationSubDistrict.id, registrationZipCode: profile.registrationZipCode, currentAddress: profile.currentAddress, currentProvinceId: profile.currentProvinceId, + currentDistrictId: profile.currentDistrictId, currentSubDistrictId: profile.currentSubDistrictId, + currentProvince: profile.currentProvince.id, + currentDistrict: profile.currentDistrict.id, + currentSubDistrict: profile.currentSubDistrict.id, currentZipCode: profile.currentZipCode, dutyTimeId: profile.dutyTimeId, dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, @@ -810,10 +829,17 @@ export class OrganizationDotnetController extends Controller { registrationProvinceId: profile.registrationProvinceId, registrationDistrictId: profile.registrationDistrictId, registrationSubDistrictId: profile.registrationSubDistrictId, + registrationProvince: profile.registrationProvince.id, + registrationDistrict: profile.registrationDistrict.id, + registrationSubDistrict: profile.registrationSubDistrict.id, registrationZipCode: profile.registrationZipCode, currentAddress: profile.currentAddress, currentProvinceId: profile.currentProvinceId, + currentDistrictId: profile.currentDistrictId, currentSubDistrictId: profile.currentSubDistrictId, + currentProvince: profile.currentProvince.id, + currentDistrict: profile.currentDistrict.id, + currentSubDistrict: profile.currentSubDistrict.id, currentZipCode: profile.currentZipCode, dutyTimeId: profile.dutyTimeId, dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, @@ -3319,12 +3345,11 @@ export class OrganizationDotnetController extends Controller { where: { orgRevisionIsCurrent: true }, }); - if(body.revisionId){ + if (body.revisionId) { findRevision = await this.orgRevisionRepo.findOne({ where: { id: body.revisionId }, }); } - const profile_ = await Promise.all( profile.map((item: Profile) => { @@ -3490,12 +3515,11 @@ export class OrganizationDotnetController extends Controller { where: { orgRevisionIsCurrent: true }, }); - if(body.revisionId){ + if (body.revisionId) { findRevision = await this.orgRevisionRepo.findOne({ where: { id: body.revisionId }, }); } - const profile_ = await Promise.all( profile.map((item: Profile) => { @@ -3638,11 +3662,11 @@ export class OrganizationDotnetController extends Controller { ], }); - let findRevision = await this.orgRevisionRepo.findOne({ + let findRevision = await this.orgRevisionRepo.findOne({ where: { orgRevisionIsCurrent: true }, }); - - if(body.revisionId){ + + if (body.revisionId) { findRevision = await this.orgRevisionRepo.findOne({ where: { id: body.revisionId }, }); @@ -3791,11 +3815,11 @@ export class OrganizationDotnetController extends Controller { ], }); - let findRevision = await this.orgRevisionRepo.findOne({ + let findRevision = await this.orgRevisionRepo.findOne({ where: { orgRevisionIsCurrent: true }, }); - - if(body.revisionId){ + + if (body.revisionId) { findRevision = await this.orgRevisionRepo.findOne({ where: { id: body.revisionId }, });