Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
aee012fa3f
4 changed files with 290 additions and 21 deletions
|
|
@ -177,11 +177,11 @@ export class ProfileController extends Controller {
|
|||
LastName: profile.lastName != null ? profile.lastName : "",
|
||||
DateOfBirth:
|
||||
profile.birthDate != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate(profile.birthDate))
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_perfixMonthYear(profile.birthDate))
|
||||
: "",
|
||||
DateRetire:
|
||||
profile.dateRetire != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate(profile.dateRetire))
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_perfixMonthYear(profile.dateRetire))
|
||||
: "",
|
||||
RegistrationAddress: Extension.ToThaiNumber(
|
||||
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
||||
|
|
@ -197,11 +197,13 @@ export class ProfileController extends Controller {
|
|||
: "",
|
||||
AppointText:
|
||||
profile.dateAppoint != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate(profile.dateAppoint))
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_perfixMonthYear(profile.dateAppoint))
|
||||
: "",
|
||||
SalaryDate:
|
||||
profile.profileSalary.length > 0 && profile.profileSalary[0].date != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate(profile.profileSalary[0].date))
|
||||
? Extension.ToThaiNumber(
|
||||
Extension.ToThaiShortDate_perfixMonthYear(profile.profileSalary[0].date),
|
||||
)
|
||||
: "",
|
||||
PositionName: profile.position != null ? profile.position : "",
|
||||
OcFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||
|
|
@ -307,13 +309,15 @@ export class ProfileController extends Controller {
|
|||
Prefix: profiles?.prefix != null ? profiles.prefix : "",
|
||||
FirstName: profiles?.firstName != null ? profiles.firstName : "",
|
||||
LastName: profiles?.lastName != null ? profiles.lastName : "",
|
||||
FullName: `${profiles?.prefix} ${profiles?.firstName} ${profiles?.lastName}`,
|
||||
FullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
||||
BirthDay: profiles?.birthDate
|
||||
? Extension.ToThaiNumber(new Date(profiles.birthDate).getDate().toString())
|
||||
: null,
|
||||
BirthDayText:
|
||||
profiles.birthDate != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate(profiles.birthDate).toString())
|
||||
? Extension.ToThaiNumber(
|
||||
Extension.ToThaiShortDate_noPrefix(profiles.birthDate).toString(),
|
||||
)
|
||||
: "",
|
||||
BirthMonth: profiles?.birthDate
|
||||
? Extension.ToThaiNumber(new Date(profiles.birthDate).getMonth() + (1).toString())
|
||||
|
|
@ -323,7 +327,9 @@ export class ProfileController extends Controller {
|
|||
: null,
|
||||
BirthYearText:
|
||||
profiles.birthDate != null
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate(profiles.birthDate).toString())
|
||||
? Extension.ToThaiNumber(
|
||||
Extension.ToThaiShortDate_noPrefix(profiles.birthDate).toString(),
|
||||
)
|
||||
: "",
|
||||
Address: "",
|
||||
District: "",
|
||||
|
|
@ -336,21 +342,21 @@ export class ProfileController extends Controller {
|
|||
profileFamilyCouple?.couplePrefix ||
|
||||
profileFamilyCouple?.coupleFirstName ||
|
||||
profileFamilyCouple?.coupleLastNameOld
|
||||
? `${profileFamilyCouple?.couplePrefix ?? ""} ${profileFamilyCouple?.coupleFirstName ?? ""} ${profileFamilyCouple?.coupleLastNameOld ?? ""}`.trim()
|
||||
? `${profileFamilyCouple?.couplePrefix ?? ""}${profileFamilyCouple?.coupleFirstName ?? ""} ${profileFamilyCouple?.coupleLastNameOld ?? ""}`.trim()
|
||||
: null,
|
||||
FatherPrefix: profileFamilyFather?.fatherPrefix ?? "",
|
||||
FatherFullName:
|
||||
profileFamilyFather?.fatherPrefix ||
|
||||
profileFamilyFather?.fatherFirstName ||
|
||||
profileFamilyFather?.fatherLastName
|
||||
? `${profileFamilyFather?.fatherPrefix ?? ""} ${profileFamilyFather?.fatherFirstName ?? ""} ${profileFamilyFather?.fatherLastName ?? ""}`.trim()
|
||||
? `${profileFamilyFather?.fatherPrefix ?? ""}${profileFamilyFather?.fatherFirstName ?? ""} ${profileFamilyFather?.fatherLastName ?? ""}`.trim()
|
||||
: null,
|
||||
MotherPrefix: profileFamilyMother?.motherPrefix ?? "",
|
||||
MotherFullName:
|
||||
profileFamilyMother?.motherPrefix ||
|
||||
profileFamilyMother?.motherFirstName ||
|
||||
profileFamilyMother?.motherLastName
|
||||
? `${profileFamilyMother?.motherPrefix ?? ""} ${profileFamilyMother?.motherFirstName ?? ""} ${profileFamilyMother?.motherLastName ?? ""}`.trim()
|
||||
? `${profileFamilyMother?.motherPrefix ?? ""}${profileFamilyMother?.motherFirstName ?? ""} ${profileFamilyMother?.motherLastName ?? ""}`.trim()
|
||||
: null,
|
||||
OcFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||
Division: "",
|
||||
|
|
@ -358,7 +364,7 @@ export class ProfileController extends Controller {
|
|||
StartDate: profiles?.dateStart,
|
||||
AppointDate: profiles?.dateAppoint ?? "",
|
||||
BirthDate: profiles?.birthDate
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate(profiles.birthDate))
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(profiles.birthDate))
|
||||
: null,
|
||||
RetireDate:
|
||||
profiles.dateRetireLaw != null
|
||||
|
|
@ -375,7 +381,7 @@ export class ProfileController extends Controller {
|
|||
CertificateType: item.certificateType ?? null,
|
||||
Issuer: item.issuer ?? null,
|
||||
CertificateNo: Extension.ToThaiNumber(item.certificateNo) ?? null,
|
||||
IssueDate: Extension.ToThaiNumber(Extension.ToThaiShortDate(item.issueDate)) ?? null,
|
||||
IssueDate: Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.issueDate)) ?? null,
|
||||
}));
|
||||
const trainings = await this.trainingRepository.find({
|
||||
select: ["startDate", "endDate", "place", "department", "name"],
|
||||
|
|
@ -386,12 +392,14 @@ export class ProfileController extends Controller {
|
|||
Start:
|
||||
item.startDate == null
|
||||
? ""
|
||||
: Extension.ToThaiNumber(Extension.ToThaiShortDate(item.startDate)),
|
||||
: Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.startDate)),
|
||||
End:
|
||||
item.endDate == null ? "" : Extension.ToThaiNumber(Extension.ToThaiShortDate(item.endDate)),
|
||||
item.endDate == null
|
||||
? ""
|
||||
: Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.endDate)),
|
||||
Date:
|
||||
item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiShortDate(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiShortDate(item.endDate))}`
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.endDate))}`
|
||||
: "",
|
||||
Level: "",
|
||||
Degree: item.name,
|
||||
|
|
@ -425,7 +433,7 @@ export class ProfileController extends Controller {
|
|||
: Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString()),
|
||||
Date:
|
||||
item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiShortDate(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiShortDate(item.endDate))}`
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.endDate))}`
|
||||
: "",
|
||||
Level: item.educationLevel ?? "",
|
||||
Degree: item.degree && item.field ? `${item.degree} ${item.field}` : "",
|
||||
|
|
@ -445,7 +453,7 @@ export class ProfileController extends Controller {
|
|||
});
|
||||
|
||||
const Salary = salarys.map((item) => ({
|
||||
SalaryDate: Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) ?? null,
|
||||
SalaryDate: Extension.ToThaiNumber(Extension.ToThaiShortDate_noPrefix(item.date)) ?? null,
|
||||
Position: item.position ?? null,
|
||||
PosNo: item.posNo ?? null,
|
||||
Salary: "",
|
||||
|
|
@ -457,7 +465,7 @@ export class ProfileController extends Controller {
|
|||
item.positionSalaryAmount == null
|
||||
? null
|
||||
: Extension.ToThaiNumber(item.positionSalaryAmount.toString()),
|
||||
FullName: `${profiles?.prefix} ${profiles?.firstName} ${profiles?.lastName}`,
|
||||
FullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
||||
OcFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||
}));
|
||||
return new HttpSuccess({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue