Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
a87b03262d
3 changed files with 48 additions and 21 deletions
|
|
@ -228,14 +228,20 @@ export class ProfileController extends Controller {
|
|||
where: { profileId: id },
|
||||
order: { lastUpdatedAt: "DESC" },
|
||||
});
|
||||
const Education = 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}` : "-",
|
||||
}));
|
||||
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 = {
|
||||
// Id: profile.id,
|
||||
|
|
|
|||
|
|
@ -231,14 +231,20 @@ export class ProfileEmployeeController extends Controller {
|
|||
where: { profileEmployeeId: id },
|
||||
order: { lastUpdatedAt: "DESC" },
|
||||
});
|
||||
const Education = 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}` : "-",
|
||||
}));
|
||||
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 = {
|
||||
// Id: profile.id,
|
||||
|
|
|
|||
|
|
@ -195,6 +195,25 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
||||
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 = {
|
||||
Id: profile.id,
|
||||
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
|
||||
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
|
||||
: "",
|
||||
Education:
|
||||
profile.profileEducations.length > 0 &&
|
||||
profile.profileEducations[profile.profileEducations.length - 1].institute != null
|
||||
? profile.profileEducations[profile.profileEducations.length - 1].institute
|
||||
: "",
|
||||
Education: Education,
|
||||
AppointText: profile.dateAppoint != null ? profile.dateAppoint : "",
|
||||
SalaryDate:
|
||||
profile.profileSalary.length > 0 && profile.profileSalary[0].date != null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue