sort step and fix return report kp7 , kk1 and kk1-emp
This commit is contained in:
parent
af38addf46
commit
e3bcb0c52c
3 changed files with 171 additions and 180 deletions
|
|
@ -237,54 +237,59 @@ export class ProfileController extends Controller {
|
|||
order: { lastUpdatedAt: "DESC" },
|
||||
});
|
||||
const Education = educations.map((item) => ({
|
||||
Institute: item.institute ? item.institute : "-",
|
||||
Date:
|
||||
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}` : "-",
|
||||
degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
|
||||
}));
|
||||
|
||||
const mapData = {
|
||||
Id: profile.id,
|
||||
CitizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "-",
|
||||
Prefix: profile.prefix != null ? profile.prefix : null,
|
||||
FirstName: profile.firstName != null ? profile.firstName : null,
|
||||
LastName: profile.lastName != null ? profile.lastName : null,
|
||||
DateOfBirth:
|
||||
// Id: profile.id,
|
||||
fullName: `${profile?.prefix}${profile?.firstName} ${profile?.lastName}`,
|
||||
prefix: profile.prefix != null ? profile.prefix : null,
|
||||
firstName: profile.firstName != null ? profile.firstName : null,
|
||||
lastName: profile.lastName != null ? profile.lastName : null,
|
||||
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "-",
|
||||
dateOfBirth:
|
||||
profile.birthDate != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
||||
: "-",
|
||||
DateRetire:
|
||||
dateRetire:
|
||||
profile.dateRetire != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
||||
: "-",
|
||||
RegistrationAddress: Extension.ToThaiNumber(
|
||||
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
||||
),
|
||||
SalaryAmount:
|
||||
salaryAmount:
|
||||
profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null
|
||||
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
|
||||
: "-",
|
||||
Education: Education,
|
||||
AppointText:
|
||||
profile.dateAppoint != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
|
||||
: "-",
|
||||
SalaryDate:
|
||||
registrationAddress: Extension.ToThaiNumber(
|
||||
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
||||
),
|
||||
salaryDate:
|
||||
profile.profileSalary.length > 0 && profile.profileSalary[0].date != null
|
||||
? Extension.ToThaiNumber(
|
||||
Extension.ToThaiShortDate_monthYear(profile.profileSalary[0].date),
|
||||
)
|
||||
: "-",
|
||||
PositionName: profile.position != null ? profile.position : "-",
|
||||
OcFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||
ImgUrl: ImgUrl
|
||||
positionName: profile.position != null ? profile.position : "-",
|
||||
appointText:
|
||||
profile.dateAppoint != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
|
||||
: "-",
|
||||
ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||
educations: Education,
|
||||
url: ImgUrl
|
||||
? ImgUrl
|
||||
: `https://bma-ehr.frappet.synology.me/assets/avatar_user-89f22423.jpg`,
|
||||
};
|
||||
|
||||
return new HttpSuccess(mapData);
|
||||
return new HttpSuccess({
|
||||
template: "kp7",
|
||||
reportName: "docx-report",
|
||||
data: mapData,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue