report kk1
This commit is contained in:
parent
dbdf136d97
commit
0baa23abcc
2 changed files with 160 additions and 116 deletions
|
|
@ -1092,7 +1092,7 @@ export class ProfileController extends Controller {
|
|||
institute: "-",
|
||||
degree: "-",
|
||||
place: "-",
|
||||
duration: "-"
|
||||
duration: "-",
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -1105,7 +1105,7 @@ export class ProfileController extends Controller {
|
|||
discipline_raw.length > 0
|
||||
? discipline_raw.map((item) => ({
|
||||
disciplineYear: item.refCommandDate
|
||||
? Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString())
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortYear(new Date(item.refCommandDate)))
|
||||
: null,
|
||||
disciplineDetail: item.detail ?? null,
|
||||
refNo: Extension.ToThaiNumber(item.refCommandNo) ?? null,
|
||||
|
|
@ -1121,21 +1121,16 @@ export class ProfileController extends Controller {
|
|||
const education_raw = await this.profileEducationRepo
|
||||
.createQueryBuilder("education")
|
||||
.where("education.profileId = :profileId", { profileId: id })
|
||||
.orderBy("CASE WHEN education.isEducation = true THEN 1 ELSE 2 END", "ASC")
|
||||
.addOrderBy("education.level", "ASC")
|
||||
.orderBy("CASE WHEN education.isEducation = true THEN 1 ELSE 2 END", "ASC")
|
||||
.addOrderBy("education.level", "ASC")
|
||||
.getMany();
|
||||
const educations =
|
||||
education_raw.length > 0
|
||||
? education_raw.map((item) => ({
|
||||
institute: item.institute,
|
||||
date:
|
||||
item.isDate
|
||||
? item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
|
||||
: ""
|
||||
: item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(new Date(item.startDate).getFullYear().toString())} - ${Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString())}`
|
||||
: "",
|
||||
date: item.isDate
|
||||
? `${item.startDate ? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate)) : ""} - ${item.endDate ? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate)) : ""}`
|
||||
: `${item.startDate ? Extension.ToThaiNumber(Extension.ToThaiShortYear(new Date(item.startDate))) : ""} - ${item.endDate ? Extension.ToThaiNumber(Extension.ToThaiShortYear(new Date(item.endDate))) : ""}`,
|
||||
degree: item.degree ? `${item.degree} ${item.field ? item.field : ""}` : "",
|
||||
}))
|
||||
: [
|
||||
|
|
@ -1173,15 +1168,20 @@ export class ProfileController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateAffect))
|
||||
: null,
|
||||
position: item.positionName != null ? Extension.ToThaiNumber(item.positionName) : null,
|
||||
posNo: item.posNoAbb && item.posNo
|
||||
? Extension.ToThaiNumber(`${item.posNoAbb}${item.posNo}`)
|
||||
: null,
|
||||
posNo:
|
||||
item.posNoAbb && item.posNo
|
||||
? Extension.ToThaiNumber(`${item.posNoAbb}${item.posNo}`)
|
||||
: null,
|
||||
salary:
|
||||
item.amount != null ? Extension.ToThaiNumber(item.amount.toLocaleString()) : null,
|
||||
rank: item.positionLevel != null ? Extension.ToThaiNumber(item.positionLevel) : null,
|
||||
refAll: item.remark ? Extension.ToThaiNumber(item.remark) : null,
|
||||
positionLevel:
|
||||
item.positionLevel != null ? Extension.ToThaiNumber(item.positionLevel) : null,
|
||||
item.positionLevel != null
|
||||
? Extension.ToThaiNumber(item.positionLevel)
|
||||
: item.positionCee != null
|
||||
? Extension.ToThaiNumber(item.positionCee)
|
||||
: null,
|
||||
positionType: item.positionType ?? null,
|
||||
positionAmount:
|
||||
item.positionSalaryAmount == null
|
||||
|
|
@ -1288,7 +1288,9 @@ export class ProfileController extends Controller {
|
|||
const leaveTypeNameKey = `leaveTypeNameLv${lvIndex}`;
|
||||
|
||||
const leaveDate = new Date(item.maxDateLeaveStart);
|
||||
const year = leaveDate ? Extension.ToThaiNumber(leaveDate.getFullYear().toString()) : "";
|
||||
const year = leaveDate
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortYear(leaveDate))
|
||||
: "";
|
||||
|
||||
let yearData = leaves.find((data) => data.year === year);
|
||||
if (!yearData) {
|
||||
|
|
@ -1362,7 +1364,7 @@ export class ProfileController extends Controller {
|
|||
childrenFirstName: item.childrenFirstName,
|
||||
childrenLastName: item.childrenLastName,
|
||||
childrenFullName: `${item.childrenPrefix}${item.childrenFirstName} ${item.childrenLastName}`,
|
||||
childrenLive: item.childrenLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
childrenLive: item.childrenLive == true ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
|
@ -1416,7 +1418,8 @@ export class ProfileController extends Controller {
|
|||
commandDateSign: item.commandDateSign
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateSign))
|
||||
: "",
|
||||
posNo: item.posNoAbb && item.posNo
|
||||
posNo:
|
||||
item.posNoAbb && item.posNo
|
||||
? Extension.ToThaiNumber(`${item.posNoAbb}${item.posNo}`)
|
||||
: "",
|
||||
position: item.positionName,
|
||||
|
|
@ -1462,7 +1465,7 @@ export class ProfileController extends Controller {
|
|||
position: item.position ? Extension.ToThaiNumber(item.position) : "",
|
||||
commandName: "รักษาการในตำแหน่ง",
|
||||
agency: "",
|
||||
document: ""
|
||||
document: "",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
|
@ -1470,7 +1473,7 @@ export class ProfileController extends Controller {
|
|||
position: "-",
|
||||
commandName: "-",
|
||||
agency: "-",
|
||||
document: "-"
|
||||
document: "-",
|
||||
},
|
||||
];
|
||||
const _assistance =
|
||||
|
|
@ -1482,9 +1485,9 @@ export class ProfileController extends Controller {
|
|||
? " - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateEnd))
|
||||
: "",
|
||||
position: "",
|
||||
commandName: item.commandName ? Extension.ToThaiNumber(item.commandName): "",
|
||||
agency: item.agency ? Extension.ToThaiNumber(item.agency): "",
|
||||
document: item.document ? Extension.ToThaiNumber(item.document): "",
|
||||
commandName: item.commandName ? Extension.ToThaiNumber(item.commandName) : "",
|
||||
agency: item.agency ? Extension.ToThaiNumber(item.agency) : "",
|
||||
document: item.document ? Extension.ToThaiNumber(item.document) : "",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
|
@ -1492,10 +1495,10 @@ export class ProfileController extends Controller {
|
|||
position: "-",
|
||||
commandName: "-",
|
||||
agency: "-",
|
||||
document: "-"
|
||||
document: "-",
|
||||
},
|
||||
];
|
||||
const actposition = [..._actposition, ..._assistance]
|
||||
const actposition = [..._actposition, ..._assistance];
|
||||
const duty_raw = await this.dutyRepository.find({
|
||||
where: { profileId: id },
|
||||
order: { createdAt: "ASC" },
|
||||
|
|
@ -1527,7 +1530,7 @@ export class ProfileController extends Controller {
|
|||
const assessments =
|
||||
assessments_raw.length > 0
|
||||
? assessments_raw.map((item) => ({
|
||||
year: item.year ? Extension.ToThaiNumber(item.year) : "",
|
||||
year: item.year ? Extension.ToThaiNumber(item.year + 543) : "",
|
||||
period: item.period && item.period == "APR" ? "เมษายน" : "ตุลาคม",
|
||||
point1: item.point1 ? Extension.ToThaiNumber(item.point1.toString()) : "",
|
||||
point1Total: item.point1Total
|
||||
|
|
@ -1610,30 +1613,38 @@ export class ProfileController extends Controller {
|
|||
).toLocaleString(),
|
||||
)
|
||||
: "";
|
||||
const fullCurrentAddress = profiles && profiles.currentAddress
|
||||
? Extension.ToThaiNumber(
|
||||
profiles.currentAddress +
|
||||
(profiles.currentSubDistrict && profiles.currentSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.currentSubDistrict.name : "") +
|
||||
(profiles.currentDistrict && profiles.currentDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.currentDistrict.name : "") +
|
||||
(profiles.currentProvince && profiles.currentProvince.name
|
||||
? " จังหวัด " + profiles.currentProvince.name : "") +
|
||||
profiles.currentZipCode,
|
||||
)
|
||||
: "";
|
||||
const fullRegistrationAddress = profiles && profiles.registrationAddress
|
||||
? Extension.ToThaiNumber(
|
||||
profiles.registrationAddress +
|
||||
(profiles.registrationSubDistrict && profiles.registrationSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.registrationSubDistrict.name : "") +
|
||||
(profiles.registrationDistrict && profiles.registrationDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.registrationDistrict.name : "") +
|
||||
(profiles.registrationProvince && profiles.registrationProvince.name
|
||||
? " จังหวัด " + profiles.registrationProvince.name : "") +
|
||||
profiles.registrationZipCode,
|
||||
)
|
||||
: "";
|
||||
const fullCurrentAddress =
|
||||
profiles && profiles.currentAddress
|
||||
? Extension.ToThaiNumber(
|
||||
profiles.currentAddress +
|
||||
(profiles.currentSubDistrict && profiles.currentSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.currentSubDistrict.name
|
||||
: "") +
|
||||
(profiles.currentDistrict && profiles.currentDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.currentDistrict.name
|
||||
: "") +
|
||||
(profiles.currentProvince && profiles.currentProvince.name
|
||||
? " จังหวัด " + profiles.currentProvince.name
|
||||
: "") +
|
||||
(profiles.currentZipCode ? " " + profiles.currentZipCode : ""),
|
||||
)
|
||||
: "";
|
||||
const fullRegistrationAddress =
|
||||
profiles && profiles.registrationAddress
|
||||
? Extension.ToThaiNumber(
|
||||
profiles.registrationAddress +
|
||||
(profiles.registrationSubDistrict && profiles.registrationSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.registrationSubDistrict.name
|
||||
: "") +
|
||||
(profiles.registrationDistrict && profiles.registrationDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.registrationDistrict.name
|
||||
: "") +
|
||||
(profiles.registrationProvince && profiles.registrationProvince.name
|
||||
? " จังหวัด " + profiles.registrationProvince.name
|
||||
: "") +
|
||||
(profiles.currentZipCode ? " " + profiles.currentZipCode : ""),
|
||||
)
|
||||
: "";
|
||||
const data = {
|
||||
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
||||
prefix: profiles?.prefix != null ? profiles.prefix : "",
|
||||
|
|
@ -1671,9 +1682,8 @@ export class ProfileController extends Controller {
|
|||
appointDate: profiles?.dateAppoint
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(profiles.dateAppoint))
|
||||
: "",
|
||||
positionDate: positionList.length > 0
|
||||
? positionList[positionList.length-1].commandDateAffect
|
||||
: "",
|
||||
positionDate:
|
||||
positionList.length > 0 ? positionList[positionList.length - 1].commandDateAffect : "",
|
||||
citizenId:
|
||||
profiles.citizenId != null ? Extension.ToThaiNumber(profiles.citizenId.toString()) : "",
|
||||
fatherFullName:
|
||||
|
|
@ -1683,7 +1693,7 @@ export class ProfileController extends Controller {
|
|||
? `${profileFamilyFather?.fatherPrefix ?? ""}${profileFamilyFather?.fatherFirstName ?? ""} ${profileFamilyFather?.fatherLastName ?? ""}`.trim()
|
||||
: null,
|
||||
fatherLive:
|
||||
profileFamilyFather && profileFamilyFather?.fatherLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
profileFamilyFather && profileFamilyFather?.fatherLive == false ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
motherFullName:
|
||||
profileFamilyMother?.motherPrefix ||
|
||||
profileFamilyMother?.motherFirstName ||
|
||||
|
|
@ -1691,7 +1701,7 @@ export class ProfileController extends Controller {
|
|||
? `${profileFamilyMother?.motherPrefix ?? ""}${profileFamilyMother?.motherFirstName ?? ""} ${profileFamilyMother?.motherLastName ?? ""}`.trim()
|
||||
: null,
|
||||
motherLive:
|
||||
profileFamilyMother && profileFamilyMother?.motherLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
profileFamilyMother && profileFamilyMother?.motherLive == false ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
coupleFullName:
|
||||
profileFamilyCouple?.couplePrefix ||
|
||||
profileFamilyCouple?.coupleFirstName ||
|
||||
|
|
@ -1700,7 +1710,7 @@ export class ProfileController extends Controller {
|
|||
: null,
|
||||
coupleLastNameOld: profileFamilyCouple?.coupleLastNameOld ?? null,
|
||||
coupleLive:
|
||||
profileFamilyCouple && profileFamilyCouple?.coupleLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
profileFamilyCouple && profileFamilyCouple?.coupleLive == false ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
currentAddress:
|
||||
profiles.currentAddress != null ? Extension.ToThaiNumber(profiles.currentAddress) : "",
|
||||
currentSubDistrict:
|
||||
|
|
@ -5857,7 +5867,7 @@ export class ProfileController extends Controller {
|
|||
_data.profileSalary[0].positionExecutive == null
|
||||
? null
|
||||
: _data.profileSalary[0].positionExecutive,
|
||||
posNo:
|
||||
posNo:
|
||||
_data.profileSalary[0].posNoAbb && _data.profileSalary[0].posNo
|
||||
? _data.profileSalary[0].posNoAbb + _data.profileSalary[0].posNo
|
||||
: _data.profileSalary[0].posNo || "",
|
||||
|
|
@ -8523,7 +8533,7 @@ export class ProfileController extends Controller {
|
|||
|
||||
const findProfile = await this.profileRepo.findOne({
|
||||
where: { keycloak: request.user.sub },
|
||||
relations: ['posLevel']
|
||||
relations: ["posLevel"],
|
||||
});
|
||||
|
||||
const findRevision = await this.orgRevisionRepo.findOne({
|
||||
|
|
@ -8567,7 +8577,15 @@ export class ProfileController extends Controller {
|
|||
orgRevisionId: findRevision?.id,
|
||||
...condition,
|
||||
},
|
||||
relations: ["current_holder","current_holder.posLevel","orgRoot","orgChild1","orgChild2","orgChild3","orgChild4"],
|
||||
relations: [
|
||||
"current_holder",
|
||||
"current_holder.posLevel",
|
||||
"orgRoot",
|
||||
"orgChild1",
|
||||
"orgChild2",
|
||||
"orgChild3",
|
||||
"orgChild4",
|
||||
],
|
||||
order: { posMasterOrder: "ASC" },
|
||||
});
|
||||
let findOSAB: PosMaster | null = null;
|
||||
|
|
@ -8649,23 +8667,23 @@ export class ProfileController extends Controller {
|
|||
.getOne();
|
||||
}
|
||||
const commanderOrg = [
|
||||
findCmd?.orgChild4?.orgChild4Name ?? null,
|
||||
findCmd?.orgChild3?.orgChild3Name ?? null,
|
||||
findCmd?.orgChild2?.orgChild2Name ?? null,
|
||||
findCmd?.orgChild1?.orgChild1Name ?? null,
|
||||
findCmd?.orgRoot?.orgRootName ?? null,
|
||||
];
|
||||
findCmd?.orgChild4?.orgChild4Name ?? null,
|
||||
findCmd?.orgChild3?.orgChild3Name ?? null,
|
||||
findCmd?.orgChild2?.orgChild2Name ?? null,
|
||||
findCmd?.orgChild1?.orgChild1Name ?? null,
|
||||
findCmd?.orgRoot?.orgRootName ?? null,
|
||||
];
|
||||
const _commanderOrg = commanderOrg
|
||||
.filter((part) => part !== undefined && part !== null)
|
||||
.join(" ");
|
||||
|
||||
const commanderAbroveOrg = [
|
||||
findOSAB?.orgChild4?.orgChild4Name ?? null,
|
||||
findOSAB?.orgChild3?.orgChild3Name ?? null,
|
||||
findOSAB?.orgChild2?.orgChild2Name ?? null,
|
||||
findOSAB?.orgChild1?.orgChild1Name ?? null,
|
||||
findOSAB?.orgRoot?.orgRootName ?? null,
|
||||
];
|
||||
findOSAB?.orgChild4?.orgChild4Name ?? null,
|
||||
findOSAB?.orgChild3?.orgChild3Name ?? null,
|
||||
findOSAB?.orgChild2?.orgChild2Name ?? null,
|
||||
findOSAB?.orgChild1?.orgChild1Name ?? null,
|
||||
findOSAB?.orgRoot?.orgRootName ?? null,
|
||||
];
|
||||
const _commanderAbroveOrg = commanderAbroveOrg
|
||||
.filter((part) => part !== undefined && part !== null)
|
||||
.join(" ");
|
||||
|
|
@ -8675,32 +8693,42 @@ export class ProfileController extends Controller {
|
|||
(findProfile?.firstName ?? "") +
|
||||
(findProfile?.firstName ? " " : "") +
|
||||
(findProfile?.lastName ?? "");
|
||||
position_ = (findProfile?.position ? findProfile?.position : "") + (findProfile?.posLevel?.posLevelName ? findProfile?.posLevel?.posLevelName : "");
|
||||
position_ =
|
||||
(findProfile?.position ? findProfile?.position : "") +
|
||||
(findProfile?.posLevel?.posLevelName ? findProfile?.posLevel?.posLevelName : "");
|
||||
commanderFullname_ =
|
||||
(findCmd?.current_holder?.prefix ?? "") +
|
||||
(findCmd?.current_holder?.firstName ?? "") +
|
||||
(findCmd?.current_holder?.firstName ? " " : "") +
|
||||
(findCmd?.current_holder?.lastName ?? "");
|
||||
commanderOrg_ = _commanderOrg;
|
||||
commanderPosition_ = (findCmd?.current_holder?.position ? findCmd?.current_holder?.position: "") + (findCmd?.current_holder?.posLevel?.posLevelName ? findCmd?.current_holder?.posLevel?.posLevelName : "");
|
||||
commanderPosition_ =
|
||||
(findCmd?.current_holder?.position ? findCmd?.current_holder?.position : "") +
|
||||
(findCmd?.current_holder?.posLevel?.posLevelName
|
||||
? findCmd?.current_holder?.posLevel?.posLevelName
|
||||
: "");
|
||||
commanderAboveFullname_ =
|
||||
(findOSAB?.current_holder?.prefix ?? "") +
|
||||
(findOSAB?.current_holder?.firstName ?? "") +
|
||||
(findOSAB?.current_holder?.firstName ? " " : "") +
|
||||
(findOSAB?.current_holder?.lastName ?? "");
|
||||
commanderAboveOrg_ = _commanderAbroveOrg;
|
||||
commanderAbovePosition_ = (findOSAB?.current_holder?.position ? findOSAB?.current_holder?.position : "") + (findOSAB?.current_holder?.posLevel?.posLevelName ? findOSAB?.current_holder?.posLevel?.posLevelName : "");
|
||||
|
||||
const commanderAbrove2Org = [
|
||||
findTSAB?.orgChild4?.orgChild4Name ?? null,
|
||||
findTSAB?.orgChild3?.orgChild3Name ?? null,
|
||||
findTSAB?.orgChild2?.orgChild2Name ?? null,
|
||||
findTSAB?.orgChild1?.orgChild1Name ?? null,
|
||||
findTSAB?.orgRoot?.orgRootName ?? null,
|
||||
];
|
||||
const _commanderAbrove2Org = commanderAbrove2Org
|
||||
.filter((part) => part !== undefined && part !== null)
|
||||
.join(" ");
|
||||
commanderAbovePosition_ =
|
||||
(findOSAB?.current_holder?.position ? findOSAB?.current_holder?.position : "") +
|
||||
(findOSAB?.current_holder?.posLevel?.posLevelName
|
||||
? findOSAB?.current_holder?.posLevel?.posLevelName
|
||||
: "");
|
||||
|
||||
const commanderAbrove2Org = [
|
||||
findTSAB?.orgChild4?.orgChild4Name ?? null,
|
||||
findTSAB?.orgChild3?.orgChild3Name ?? null,
|
||||
findTSAB?.orgChild2?.orgChild2Name ?? null,
|
||||
findTSAB?.orgChild1?.orgChild1Name ?? null,
|
||||
findTSAB?.orgRoot?.orgRootName ?? null,
|
||||
];
|
||||
const _commanderAbrove2Org = commanderAbrove2Org
|
||||
.filter((part) => part !== undefined && part !== null)
|
||||
.join(" ");
|
||||
|
||||
if (findCmd?.current_holderId == findProfile?.id) {
|
||||
commanderFullname_ =
|
||||
|
|
@ -8709,14 +8737,22 @@ export class ProfileController extends Controller {
|
|||
(findOSAB?.current_holder?.firstName ? " " : "") +
|
||||
(findOSAB?.current_holder?.lastName ?? "");
|
||||
commanderOrg_ = _commanderAbroveOrg;
|
||||
commanderPosition_ = (findOSAB?.current_holder?.position ? findOSAB?.current_holder?.position : "") + (findOSAB?.current_holder?.posLevel?.posLevelName ? findOSAB?.current_holder?.posLevel?.posLevelName : "");
|
||||
commanderPosition_ =
|
||||
(findOSAB?.current_holder?.position ? findOSAB?.current_holder?.position : "") +
|
||||
(findOSAB?.current_holder?.posLevel?.posLevelName
|
||||
? findOSAB?.current_holder?.posLevel?.posLevelName
|
||||
: "");
|
||||
commanderAboveFullname_ =
|
||||
(findTSAB?.current_holder?.prefix ?? "") +
|
||||
(findTSAB?.current_holder?.firstName ?? "") +
|
||||
(findTSAB?.current_holder?.firstName ? " " : "") +
|
||||
(findTSAB?.current_holder?.lastName ?? "");
|
||||
commanderAboveOrg_ = _commanderAbrove2Org;
|
||||
commanderAbovePosition_ = (findTSAB?.current_holder?.position ? findTSAB?.current_holder?.position : "") + (findTSAB?.current_holder?.posLevel?.posLevelName ? findTSAB?.current_holder?.posLevel?.posLevelName : "");
|
||||
commanderAbovePosition_ =
|
||||
(findTSAB?.current_holder?.position ? findTSAB?.current_holder?.position : "") +
|
||||
(findTSAB?.current_holder?.posLevel?.posLevelName
|
||||
? findTSAB?.current_holder?.posLevel?.posLevelName
|
||||
: "");
|
||||
|
||||
const formattedDataTSAB = {
|
||||
fullname: fullName_,
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
discipline_raw.length > 0
|
||||
? discipline_raw.map((item) => ({
|
||||
disciplineYear: item.refCommandDate
|
||||
? Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString())
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortYear(new Date(item.refCommandDate)))
|
||||
: null,
|
||||
disciplineDetail: item.detail ?? null,
|
||||
refNo: Extension.ToThaiNumber(item.refCommandNo) ?? null,
|
||||
|
|
@ -1127,12 +1127,8 @@ export class ProfileEmployeeController extends Controller {
|
|||
? education_raw.map((item) => ({
|
||||
institute: item.institute,
|
||||
date: item.isDate
|
||||
? item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
|
||||
: ""
|
||||
: item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(new Date(item.startDate).getFullYear().toString())} - ${Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString())}`
|
||||
: "",
|
||||
? `${item.startDate ? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate)) : ""} - ${item.endDate ? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate)) : ""}`
|
||||
: `${item.startDate ? Extension.ToThaiNumber(Extension.ToThaiShortYear(new Date(item.startDate))) : ""} - ${item.endDate ? Extension.ToThaiNumber(Extension.ToThaiShortYear(new Date(item.endDate))) : ""}`,
|
||||
degree: item.degree ? `${item.degree} ${item.field ? item.field : ""}` : "",
|
||||
}))
|
||||
: [
|
||||
|
|
@ -1179,7 +1175,11 @@ export class ProfileEmployeeController extends Controller {
|
|||
rank: item.positionLevel != null ? Extension.ToThaiNumber(item.positionLevel) : null,
|
||||
refAll: item.remark ? Extension.ToThaiNumber(item.remark) : null,
|
||||
positionLevel:
|
||||
item.positionLevel != null ? Extension.ToThaiNumber(item.positionLevel) : null,
|
||||
item.positionLevel != null
|
||||
? Extension.ToThaiNumber(item.positionLevel)
|
||||
: item.positionCee != null
|
||||
? Extension.ToThaiNumber(item.positionCee)
|
||||
: null,
|
||||
positionType: item.positionType ?? null,
|
||||
positionAmount:
|
||||
item.positionSalaryAmount == null
|
||||
|
|
@ -1286,7 +1286,9 @@ export class ProfileEmployeeController extends Controller {
|
|||
const leaveTypeNameKey = `leaveTypeNameLv${lvIndex}`;
|
||||
|
||||
const leaveDate = new Date(item.maxDateLeaveStart);
|
||||
const year = leaveDate ? Extension.ToThaiNumber(leaveDate.getFullYear().toString()) : "";
|
||||
const year = leaveDate
|
||||
? Extension.ToThaiNumber(Extension.ToThaiShortYear(leaveDate))
|
||||
: "";
|
||||
|
||||
let yearData = leaves.find((data) => data.year === year);
|
||||
if (!yearData) {
|
||||
|
|
@ -1360,7 +1362,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
childrenFirstName: item.childrenFirstName,
|
||||
childrenLastName: item.childrenLastName,
|
||||
childrenFullName: `${item.childrenPrefix}${item.childrenFirstName} ${item.childrenLastName}`,
|
||||
childrenLive: item.childrenLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
childrenLive: item.childrenLive == true ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
|
@ -1526,7 +1528,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
const assessments =
|
||||
assessments_raw.length > 0
|
||||
? assessments_raw.map((item) => ({
|
||||
year: item.year ? Extension.ToThaiNumber(item.year) : "",
|
||||
year: item.year ? Extension.ToThaiNumber(item.year + 543) : "",
|
||||
period: item.period && item.period == "APR" ? "เมษายน" : "ตุลาคม",
|
||||
point1: item.point1 ? Extension.ToThaiNumber(item.point1.toString()) : "",
|
||||
point1Total: item.point1Total
|
||||
|
|
@ -1613,26 +1615,32 @@ export class ProfileEmployeeController extends Controller {
|
|||
profiles && profiles.currentAddress
|
||||
? Extension.ToThaiNumber(
|
||||
profiles.currentAddress +
|
||||
(profiles.currentSubDistrict && profiles.currentSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.currentSubDistrict.name : "") +
|
||||
(profiles.currentDistrict && profiles.currentDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.currentDistrict.name : "") +
|
||||
(profiles.currentProvince && profiles.currentProvince.name
|
||||
? " จังหวัด " + profiles.currentProvince.name : "") +
|
||||
profiles.currentZipCode,
|
||||
(profiles.currentSubDistrict && profiles.currentSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.currentSubDistrict.name
|
||||
: "") +
|
||||
(profiles.currentDistrict && profiles.currentDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.currentDistrict.name
|
||||
: "") +
|
||||
(profiles.currentProvince && profiles.currentProvince.name
|
||||
? " จังหวัด " + profiles.currentProvince.name
|
||||
: "") +
|
||||
(profiles.currentZipCode ? " " + profiles.currentZipCode : ""),
|
||||
)
|
||||
: "";
|
||||
const fullRegistrationAddress =
|
||||
profiles && profiles.registrationAddress
|
||||
? Extension.ToThaiNumber(
|
||||
profiles.registrationAddress +
|
||||
(profiles.registrationSubDistrict && profiles.registrationSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.registrationSubDistrict.name : "") +
|
||||
(profiles.registrationDistrict && profiles.registrationDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.registrationDistrict.name : "") +
|
||||
(profiles.registrationProvince && profiles.registrationProvince.name
|
||||
? " จังหวัด " + profiles.registrationProvince.name : "") +
|
||||
profiles.registrationZipCode,
|
||||
(profiles.registrationSubDistrict && profiles.registrationSubDistrict.name
|
||||
? " ตำบล/แขวง " + profiles.registrationSubDistrict.name
|
||||
: "") +
|
||||
(profiles.registrationDistrict && profiles.registrationDistrict.name
|
||||
? " อำเภอ/เขต " + profiles.registrationDistrict.name
|
||||
: "") +
|
||||
(profiles.registrationProvince && profiles.registrationProvince.name
|
||||
? " จังหวัด " + profiles.registrationProvince.name
|
||||
: "") +
|
||||
(profiles.currentZipCode ? " " + profiles.currentZipCode : ""),
|
||||
)
|
||||
: "";
|
||||
const data = {
|
||||
|
|
@ -1683,7 +1691,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
? `${profileFamilyFather?.fatherPrefix ?? ""}${profileFamilyFather?.fatherFirstName ?? ""} ${profileFamilyFather?.fatherLastName ?? ""}`.trim()
|
||||
: null,
|
||||
fatherLive:
|
||||
profileFamilyFather && profileFamilyFather?.fatherLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
profileFamilyFather && profileFamilyFather?.fatherLive == true ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
motherFullName:
|
||||
profileFamilyMother?.motherPrefix ||
|
||||
profileFamilyMother?.motherFirstName ||
|
||||
|
|
@ -1691,7 +1699,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
? `${profileFamilyMother?.motherPrefix ?? ""}${profileFamilyMother?.motherFirstName ?? ""} ${profileFamilyMother?.motherLastName ?? ""}`.trim()
|
||||
: null,
|
||||
motherLive:
|
||||
profileFamilyMother && profileFamilyMother?.motherLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
profileFamilyMother && profileFamilyMother?.motherLive == true ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
coupleFullName:
|
||||
profileFamilyCouple?.couplePrefix ||
|
||||
profileFamilyCouple?.coupleFirstName ||
|
||||
|
|
@ -1700,7 +1708,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
: null,
|
||||
coupleLastNameOld: profileFamilyCouple?.coupleLastNameOld ?? null,
|
||||
coupleLive:
|
||||
profileFamilyCouple && profileFamilyCouple?.coupleLive == true ? "มีชีวิต" : "ถึงแก่กรรม",
|
||||
profileFamilyCouple && profileFamilyCouple?.coupleLive == true ? "ถึงแก่กรรม" : "มีชีวิต",
|
||||
currentAddress:
|
||||
profiles.currentAddress != null ? Extension.ToThaiNumber(profiles.currentAddress) : "",
|
||||
currentSubDistrict:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue