Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
e2939cae3a
3 changed files with 28 additions and 4 deletions
|
|
@ -3190,7 +3190,12 @@ export class ProfileController extends Controller {
|
||||||
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
|
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { keycloak: request.user.sub },
|
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) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
|
|
@ -3299,6 +3304,9 @@ export class ProfileController extends Controller {
|
||||||
child4ShortName: child4 == null ? null : child4.orgChild4ShortName,
|
child4ShortName: child4 == null ? null : child4.orgChild4ShortName,
|
||||||
node: null,
|
node: null,
|
||||||
nodeId: null,
|
nodeId: null,
|
||||||
|
salary: profile && profile.profileSalary.length > 0
|
||||||
|
? profile.profileSalary[0].amount
|
||||||
|
: null
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_profile.child4Id != null) {
|
if (_profile.child4Id != null) {
|
||||||
|
|
|
||||||
|
|
@ -1741,7 +1741,12 @@ export class ProfileEmployeeController extends Controller {
|
||||||
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
|
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { keycloak: request.user.sub },
|
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) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
|
|
@ -1840,7 +1845,10 @@ export class ProfileEmployeeController extends Controller {
|
||||||
? null
|
? null
|
||||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
|
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
|
||||||
.orgChild4Name,
|
.orgChild4Name,
|
||||||
};
|
salary: profile && profile.profileSalarys.length > 0
|
||||||
|
? profile.profileSalarys[0].amount
|
||||||
|
: null
|
||||||
|
};
|
||||||
return new HttpSuccess(_profile);
|
return new HttpSuccess(_profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1538,7 +1538,12 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
|
async getProfileByKeycloak(@Request() request: { user: Record<string, any> }) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { keycloak: request.user.sub },
|
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) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
|
|
@ -1637,6 +1642,9 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
? null
|
? null
|
||||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
|
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
|
||||||
.orgChild4Name,
|
.orgChild4Name,
|
||||||
|
salary: profile && profile.profileSalarys.length > 0
|
||||||
|
? profile.profileSalarys[0].amount
|
||||||
|
: null
|
||||||
};
|
};
|
||||||
return new HttpSuccess(_profile);
|
return new HttpSuccess(_profile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue