filter รักษาการ

This commit is contained in:
mamoss 2025-07-18 16:33:09 +07:00
parent d9a92eda9d
commit 3ae17c23e2
3 changed files with 52 additions and 80 deletions

View file

@ -1178,7 +1178,9 @@ export class ProfileController extends Controller {
salary:
item.amount != null ? Extension.ToThaiNumber(item.amount.toLocaleString()) : null,
special:
item.amountSpecial != null ? Extension.ToThaiNumber(item.amountSpecial.toLocaleString()) : null,
item.amountSpecial != null
? Extension.ToThaiNumber(item.amountSpecial.toLocaleString())
: null,
rank: item.positionLevel != null ? Extension.ToThaiNumber(item.positionLevel) : null,
refAll: item.remark ? Extension.ToThaiNumber(item.remark) : null,
positionLevel: item.positionLevel
@ -7667,7 +7669,7 @@ export class ProfileController extends Controller {
"current_holders.orgChild4",
"profileSalary",
"profileEducations",
"profileActpositions"
"profileActpositions",
],
order: {
// profileSalary: {
@ -7677,8 +7679,8 @@ export class ProfileController extends Controller {
level: "ASC",
},
profileActpositions: {
createdAt: "ASC"
}
createdAt: "ASC",
},
},
});
if (!profile) {
@ -7816,30 +7818,25 @@ export class ProfileController extends Controller {
// );
const data = await Promise.all(
profile.profileActpositions
.filter(x => x.status)
.filter((x) => x.status)
.map(async (item) => {
const commandRef = await this.commandReciveRepository.findOne({
where: { commandId: item.commandId }
where: { commandId: item.commandId },
});
const posMasterActs = await this.posMasterActRepository.findOne({
where: {
where: {
id: commandRef?.refId,
posMaster: {
orgRevisionId: orgRevisionPublish.id,
}
},
statusReport: "DONE",
},
relations: [
"posMaster",
"posMaster.current_holder"
],
relations: ["posMaster", "posMaster.current_holder"],
});
const _profileAct = await this.profileRepo.findOne({
where: { id: posMasterActs?.posMaster.current_holderId ?? "" },
relations: [
"posLevel",
"posType"
]
})
relations: ["posLevel", "posType"],
});
return {
id: item.id,
posMasterOrder: posMasterActs?.posMasterOrder,
@ -7852,8 +7849,8 @@ export class ProfileController extends Controller {
posType: _profileAct?.posType.posTypeName ?? null,
position: item.position ?? null,
posNo: item.posNo ?? null,
}
})
};
}),
);
const permissionProflile = await this.permissionProflileRepository.findOne({
relations: ["orgRootTree"],
@ -8122,7 +8119,8 @@ export class ProfileController extends Controller {
? `${profile.profileEducations[0].degree ?? ""} ${profile.profileEducations[0].field ?? ""}`
: "",
dateAppoint: profile.dateAppoint,
avatarUrl: profile.avatar && profile.avatarName ? `${profile.avatar}/${profile.avatarName}` : null
avatarUrl:
profile.avatar && profile.avatarName ? `${profile.avatar}/${profile.avatarName}` : null,
};
if (_profile.child4Id != null) {