report kk1

This commit is contained in:
mamoss 2025-05-13 11:48:45 +07:00
parent dbdf136d97
commit 0baa23abcc
2 changed files with 160 additions and 116 deletions

View file

@ -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: