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

This commit is contained in:
kittapath 2024-11-11 14:53:21 +07:00
commit a87b03262d
3 changed files with 48 additions and 21 deletions

View file

@ -228,14 +228,20 @@ export class ProfileController extends Controller {
where: { profileId: id }, where: { profileId: id },
order: { lastUpdatedAt: "DESC" }, order: { lastUpdatedAt: "DESC" },
}); });
const Education = educations.map((item) => ({ const Education = educations && educations.length > 0
institute: item.institute ? item.institute : "-", ? educations.map((item) => ({
date: institute: item.institute ? item.institute : "-",
item.startDate && item.endDate date:
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}` item.startDate && item.endDate
: "-", ? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-", : "-",
})); degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
}))
: [{
institute: "-",
date: "-",
degree: "-",
}]
const mapData = { const mapData = {
// Id: profile.id, // Id: profile.id,

View file

@ -231,14 +231,20 @@ export class ProfileEmployeeController extends Controller {
where: { profileEmployeeId: id }, where: { profileEmployeeId: id },
order: { lastUpdatedAt: "DESC" }, order: { lastUpdatedAt: "DESC" },
}); });
const Education = educations.map((item) => ({ const Education = educations && educations.length > 0
Institute: item.institute ? item.institute : "-", ? educations.map((item) => ({
Date: institute: item.institute ? item.institute : "-",
item.startDate && item.endDate date:
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}` item.startDate && item.endDate
: "-", ? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
Degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-", : "-",
})); degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
}))
: [{
institute: "-",
date: "-",
degree: "-",
}]
const mapData = { const mapData = {
// Id: profile.id, // Id: profile.id,

View file

@ -195,6 +195,25 @@ export class ProfileEmployeeTempController extends Controller {
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`; let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
const educations = await this.educationRepository.find({
select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"],
where: { profileEmployeeId: id },
order: { lastUpdatedAt: "DESC" },
});
const Education = educations && educations.length > 0
? educations.map((item) => ({
institute: item.institute ? item.institute : "-",
date:
item.startDate && item.endDate
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
: "-",
degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
}))
: [{
institute: "-",
date: "-",
degree: "-",
}]
const mapData = { const mapData = {
Id: profile.id, Id: profile.id,
CitizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "", CitizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "",
@ -214,11 +233,7 @@ export class ProfileEmployeeTempController extends Controller {
profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString()) ? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
: "", : "",
Education: Education: Education,
profile.profileEducations.length > 0 &&
profile.profileEducations[profile.profileEducations.length - 1].institute != null
? profile.profileEducations[profile.profileEducations.length - 1].institute
: "",
AppointText: profile.dateAppoint != null ? profile.dateAppoint : "", AppointText: profile.dateAppoint != null ? profile.dateAppoint : "",
SalaryDate: SalaryDate:
profile.profileSalary.length > 0 && profile.profileSalary[0].date != null profile.profileSalary.length > 0 && profile.profileSalary[0].date != null