Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop

This commit is contained in:
kittapath 2024-09-25 11:17:52 +07:00
commit e2939cae3a
3 changed files with 28 additions and 4 deletions

View file

@ -3190,7 +3190,12 @@ export class ProfileController extends Controller {
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
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", "profileSalary"],
order: {
profileSalary: {
order: "DESC",
}
}
});
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
@ -3299,6 +3304,9 @@ export class ProfileController extends Controller {
child4ShortName: child4 == null ? null : child4.orgChild4ShortName,
node: null,
nodeId: null,
salary: profile && profile.profileSalary.length > 0
? profile.profileSalary[0].amount
: null
};
if (_profile.child4Id != null) {

View file

@ -1741,7 +1741,12 @@ export class ProfileEmployeeController extends Controller {
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
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", "profileSalarys"],
order: {
profileSalarys: {
order: "DESC",
}
}
});
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
@ -1840,7 +1845,10 @@ export class ProfileEmployeeController extends Controller {
? null
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
.orgChild4Name,
};
salary: profile && profile.profileSalarys.length > 0
? profile.profileSalarys[0].amount
: null
};
return new HttpSuccess(_profile);
}

View file

@ -1538,7 +1538,12 @@ export class ProfileEmployeeTempController extends Controller {
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
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","profileSalarys"],
order: {
profileSalarys: {
order: "DESC",
}
}
});
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
@ -1637,6 +1642,9 @@ export class ProfileEmployeeTempController extends Controller {
? null
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
.orgChild4Name,
salary: profile && profile.profileSalarys.length > 0
? profile.profileSalarys[0].amount
: null
};
return new HttpSuccess(_profile);
}