edit searcg profile

This commit is contained in:
kittapath 2024-12-19 14:53:35 +07:00
parent 2977969bad
commit 2a63855b72
3 changed files with 21 additions and 97 deletions

View file

@ -2351,17 +2351,6 @@ export class ProfileEmployeeController extends Controller {
? null
: item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgRoot;
let salary: any = "";
if (item != null && item.profileSalary != null && item.profileSalary.length > 0) {
let _salary: any = item.profileSalary.sort(
(a, b) =>
(b.date == null ? 0 : b.date.getTime()) - (a.date == null ? 0 : a.date.getTime()),
);
if (_salary.length > 0) {
salary = _salary[0];
}
}
const rootHolder = item.current_holders?.find(
(x) => x.orgRevisionId == findRevision.id,
)?.orgRoot;
@ -2403,8 +2392,8 @@ export class ProfileEmployeeController extends Controller {
positionType: item.posTypeId,
positionTypeName: item.posType?.posTypeName,
posNo: shortName,
organization: root == null ? null : root.orgRootName,
salary: salary == "" ? "" : salary.amount,
organization: root == null ? null : root.orgRootShortName,
salary: item.amount,
root: rootHolder?.orgRootName ?? null,
rootId: rootHolder?.id ?? null,
rootShortName: rootHolder?.orgRootShortName ?? null,
@ -3927,7 +3916,7 @@ export class ProfileEmployeeController extends Controller {
citizenId: Like(`%${body.keyword}%`),
employeeClass: "PREM",
},
relations: ["posType", "posLevel", "current_holders", "profileSalary"],
relations: ["posType", "posLevel", "current_holders"],
skip,
take,
});
@ -3940,7 +3929,7 @@ export class ProfileEmployeeController extends Controller {
firstName: Like(`%${body.keyword}%`),
employeeClass: "PREM",
},
relations: ["posType", "posLevel", "current_holders", "profileSalary"],
relations: ["posType", "posLevel", "current_holders"],
skip,
take,
});
@ -3953,7 +3942,7 @@ export class ProfileEmployeeController extends Controller {
lastName: Like(`%${body.keyword}%`),
employeeClass: "PREM",
},
relations: ["posType", "posLevel", "current_holders", "profileSalary"],
relations: ["posType", "posLevel", "current_holders"],
skip,
take,
});
@ -3965,7 +3954,7 @@ export class ProfileEmployeeController extends Controller {
keycloak: IsNull(),
employeeClass: "PREM",
},
relations: ["posType", "posLevel", "current_holders", "profileSalary"],
relations: ["posType", "posLevel", "current_holders"],
skip,
take,
});
@ -4015,17 +4004,6 @@ export class ProfileEmployeeController extends Controller {
? null
: item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgRoot;
let salary: any = "";
if (item != null && item.profileSalary != null && item.profileSalary.length > 0) {
let _salary: any = item.profileSalary.sort(
(a, b) =>
(b.date == null ? 0 : b.date.getTime()) - (a.date == null ? 0 : a.date.getTime()),
);
if (_salary.length > 0) {
salary = _salary[0];
}
}
const posMasterNo = item.current_holders?.find(
(x) => x.orgRevisionId == findRevision.id,
)?.posMasterNo;
@ -4053,7 +4031,7 @@ export class ProfileEmployeeController extends Controller {
positionTypeName: item.posType?.posTypeName,
posNo: shortName,
organization: root == null ? null : root.orgRootShortName,
salary: salary == "" ? "" : salary.amount,
salary: item.amount,
posMasterNo: posMasterNo ?? null,
posTypeId: item.posTypeId,
posTypeName: item.posType?.posTypeName,