edit import profile salary
This commit is contained in:
parent
134296b5b1
commit
444168ace2
4 changed files with 267 additions and 36 deletions
|
|
@ -309,6 +309,18 @@ export class ImportDataController extends Controller {
|
||||||
"ADMIN_NAME",
|
"ADMIN_NAME",
|
||||||
"REMARK",
|
"REMARK",
|
||||||
"ORDER_MOVE_POSITION",
|
"ORDER_MOVE_POSITION",
|
||||||
|
"SAL_POS_AMOUNT_1",
|
||||||
|
"SAL_POS_AMOUNT_2",
|
||||||
|
"SPECIAL_AMT",
|
||||||
|
"MP_COMMAND_DATE",
|
||||||
|
"FLAG_TO_NAME_CODE",
|
||||||
|
"DEPARTMENT_NAME",
|
||||||
|
"DIVISION_NAME",
|
||||||
|
"SECTION_NAME",
|
||||||
|
"JOB_NAME",
|
||||||
|
"MP_CEE",
|
||||||
|
"USER_CREATE",
|
||||||
|
"USER_UPDATE",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -364,11 +376,11 @@ export class ImportDataController extends Controller {
|
||||||
profileSalary.createdAt =
|
profileSalary.createdAt =
|
||||||
item.USER_CREATE == ""
|
item.USER_CREATE == ""
|
||||||
? new Date(item.USER_CREATE.replace(" +0700 +07:00", ""))
|
? new Date(item.USER_CREATE.replace(" +0700 +07:00", ""))
|
||||||
: null_;
|
: new Date();
|
||||||
profileSalary.lastUpdatedAt =
|
profileSalary.lastUpdatedAt =
|
||||||
item.USER_UPDATE == ""
|
item.USER_UPDATE == ""
|
||||||
? new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""))
|
? new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""))
|
||||||
: null_;
|
: new Date();
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
||||||
await this.salaryRepo.save(profileSalary);
|
await this.salaryRepo.save(profileSalary);
|
||||||
}),
|
}),
|
||||||
|
|
@ -420,6 +432,18 @@ export class ImportDataController extends Controller {
|
||||||
"ADMIN_NAME",
|
"ADMIN_NAME",
|
||||||
"REMARK",
|
"REMARK",
|
||||||
"ORDER_MOVE_POSITION",
|
"ORDER_MOVE_POSITION",
|
||||||
|
"SAL_POS_AMOUNT_1",
|
||||||
|
"SAL_POS_AMOUNT_2",
|
||||||
|
"SPECIAL_AMT",
|
||||||
|
"MP_COMMAND_DATE",
|
||||||
|
"FLAG_TO_NAME_CODE",
|
||||||
|
"DEPARTMENT_NAME",
|
||||||
|
"DIVISION_NAME",
|
||||||
|
"SECTION_NAME",
|
||||||
|
"JOB_NAME",
|
||||||
|
"MP_CEE",
|
||||||
|
"USER_CREATE",
|
||||||
|
"USER_UPDATE",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -476,11 +500,11 @@ export class ImportDataController extends Controller {
|
||||||
profileSalary.createdAt =
|
profileSalary.createdAt =
|
||||||
item.USER_CREATE == ""
|
item.USER_CREATE == ""
|
||||||
? new Date(item.USER_CREATE.replace(" +0700 +07:00", ""))
|
? new Date(item.USER_CREATE.replace(" +0700 +07:00", ""))
|
||||||
: null_;
|
: new Date();
|
||||||
profileSalary.lastUpdatedAt =
|
profileSalary.lastUpdatedAt =
|
||||||
item.USER_UPDATE == ""
|
item.USER_UPDATE == ""
|
||||||
? new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""))
|
? new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""))
|
||||||
: null_;
|
: new Date();
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
||||||
await this.salaryRepo.save(profileSalary);
|
await this.salaryRepo.save(profileSalary);
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,14 @@ export class ProfileController extends Controller {
|
||||||
"refCommandNo",
|
"refCommandNo",
|
||||||
"amount",
|
"amount",
|
||||||
"templateDoc",
|
"templateDoc",
|
||||||
"positionLine",
|
"position",
|
||||||
|
"orgRoot",
|
||||||
|
"orgChild1",
|
||||||
|
"orgChild2",
|
||||||
|
"orgChild3",
|
||||||
|
"orgChild4",
|
||||||
|
"mpCee",
|
||||||
|
"positionExecutive",
|
||||||
],
|
],
|
||||||
where: { profileId: id },
|
where: { profileId: id },
|
||||||
order: { date: "ASC" },
|
order: { date: "ASC" },
|
||||||
|
|
@ -242,24 +249,28 @@ export class ProfileController extends Controller {
|
||||||
salary_raw.length > 1
|
salary_raw.length > 1
|
||||||
? salary_raw.slice(1).map((item) => ({
|
? salary_raw.slice(1).map((item) => ({
|
||||||
date: item.date ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) : null,
|
date: item.date ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) : null,
|
||||||
positionLine: item.positionLine != null ? item.positionLine : "-",
|
position: item.position != null ? item.position : "-",
|
||||||
posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
|
posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
|
||||||
orgRoot: item.orgRoot,
|
orgRoot: item.orgRoot,
|
||||||
orgChild1: item.orgChild1,
|
orgChild1: item.orgChild1,
|
||||||
orgChild2: item.orgChild2,
|
orgChild2: item.orgChild2,
|
||||||
orgChild3: item.orgChild3,
|
orgChild3: item.orgChild3,
|
||||||
orgChild4: item.orgChild4,
|
orgChild4: item.orgChild4,
|
||||||
|
mpCee: item.mpCee,
|
||||||
|
positionExecutive: item.positionExecutive,
|
||||||
}))
|
}))
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
date: "-",
|
date: "-",
|
||||||
positionLine: "-",
|
position: "-",
|
||||||
posNo: "-",
|
posNo: "-",
|
||||||
orgRoot: null,
|
orgRoot: null,
|
||||||
orgChild1: null,
|
orgChild1: null,
|
||||||
orgChild2: null,
|
orgChild2: null,
|
||||||
orgChild3: null,
|
orgChild3: null,
|
||||||
orgChild4: null,
|
orgChild4: null,
|
||||||
|
mpCee: null,
|
||||||
|
positionExecutive: null,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -292,55 +303,63 @@ export class ProfileController extends Controller {
|
||||||
prefix: profile.prefix != null ? profile.prefix : null,
|
prefix: profile.prefix != null ? profile.prefix : null,
|
||||||
firstName: profile.firstName != null ? profile.firstName : null,
|
firstName: profile.firstName != null ? profile.firstName : null,
|
||||||
lastName: profile.lastName != null ? profile.lastName : null,
|
lastName: profile.lastName != null ? profile.lastName : null,
|
||||||
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "-",
|
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "",
|
||||||
dateOfBirth:
|
dateOfBirth:
|
||||||
profile.birthDate != null
|
profile.birthDate != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
||||||
: "-",
|
: "",
|
||||||
dateRetire:
|
dateRetire:
|
||||||
profile.dateRetire != null
|
profile.dateRetire != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
||||||
: "-",
|
: "",
|
||||||
salaryAmount:
|
salaryAmount:
|
||||||
profile.amount != null ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
profile.amount != null ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "",
|
||||||
registrationAddress: Extension.ToThaiNumber(
|
registrationAddress: Extension.ToThaiNumber(
|
||||||
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
||||||
),
|
),
|
||||||
date:
|
date:
|
||||||
salary_raw.length > 0 && salary_raw[0].date != null
|
salary_raw.length > 0 && salary_raw[0].date != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate(salary_raw[0].date))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate(salary_raw[0].date))
|
||||||
: "-",
|
: "",
|
||||||
positionName: profile.position != null ? profile.position : "-",
|
positionName: profile.position != null ? profile.position : "",
|
||||||
appointText:
|
appointText:
|
||||||
profile.dateAppoint != null
|
profile.dateAppoint != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate(profile.dateAppoint))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate(profile.dateAppoint))
|
||||||
: "-",
|
: "",
|
||||||
posNo:
|
posNo:
|
||||||
salary_raw.length > 0 && salary_raw[0].posNo != null
|
salary_raw.length > 0 && salary_raw[0].posNo != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].posNo))
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].posNo))
|
||||||
: "-",
|
: "",
|
||||||
position:
|
position:
|
||||||
salary_raw.length > 0 && salary_raw[0].position != null
|
salary_raw.length > 0 && salary_raw[0].position != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].position))
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].position))
|
||||||
: "-",
|
: "",
|
||||||
|
mpCee:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].mpCee != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].mpCee))
|
||||||
|
: "",
|
||||||
|
positionExecutive:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].positionExecutive != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionExecutive))
|
||||||
|
: "",
|
||||||
org: `${
|
org: `${
|
||||||
salary_raw.length > 0 && salary_raw[0].orgChild4 != null
|
salary_raw.length > 0 && salary_raw[0].orgChild4 && salary_raw[0].orgChild4 != "-"
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild4)) + " "
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild4)) + " "
|
||||||
: ""
|
: ""
|
||||||
}${
|
}${
|
||||||
salary_raw.length > 0 && salary_raw[0].orgChild3 != null
|
salary_raw.length > 0 && salary_raw[0].orgChild3 && salary_raw[0].orgChild3 != "-"
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild3)) + " "
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild3)) + " "
|
||||||
: ""
|
: ""
|
||||||
}${
|
}${
|
||||||
salary_raw.length > 0 && salary_raw[0].orgChild2 != null
|
salary_raw.length > 0 && salary_raw[0].orgChild2 && salary_raw[0].orgChild2 != "-"
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild2)) + " "
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild2)) + " "
|
||||||
: ""
|
: ""
|
||||||
}${
|
}${
|
||||||
salary_raw.length > 0 && salary_raw[0].orgChild1 != null
|
salary_raw.length > 0 && salary_raw[0].orgChild1 && salary_raw[0].orgChild1 != "-"
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild1)) + " "
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild1)) + " "
|
||||||
: ""
|
: ""
|
||||||
}${
|
}${
|
||||||
salary_raw.length > 0 && salary_raw[0].orgRoot != null
|
salary_raw.length > 0 && salary_raw[0].orgRoot && salary_raw[0].orgRoot != "-"
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgRoot))
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgRoot))
|
||||||
: ""
|
: ""
|
||||||
}`,
|
}`,
|
||||||
|
|
@ -349,7 +368,7 @@ export class ProfileController extends Controller {
|
||||||
salarys: salarys.map((item) => {
|
salarys: salarys.map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
org: `${item.orgChild4 != null ? item.orgChild4 + " " : ""}${item.orgChild3 != null ? item.orgChild3 + " " : ""}${item.orgChild2 != null ? item.orgChild2 + " " : ""}${item.orgChild1 != null ? item.orgChild1 + " " : ""}${item.orgRoot != null ? item.orgRoot + " " : ""}`,
|
org: `${item.orgChild4 && item.orgChild4 != "-" ? item.orgChild4 + " " : ""}${item.orgChild3 && item.orgChild3 != "-" ? item.orgChild3 + " " : ""}${item.orgChild2 && item.orgChild2 != "-" ? item.orgChild2 + " " : ""}${item.orgChild1 && item.orgChild1 != "-" ? item.orgChild1 + " " : ""}${item.orgRoot && item.orgRoot != "-" ? item.orgRoot + " " : ""}`,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`,
|
url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`,
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,58 @@ export class ProfileEmployeeController extends Controller {
|
||||||
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
||||||
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
|
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
|
||||||
|
|
||||||
|
const salary_raw = await this.salaryRepo.find({
|
||||||
|
select: [
|
||||||
|
"date",
|
||||||
|
"position",
|
||||||
|
"posNo",
|
||||||
|
"positionType",
|
||||||
|
"positionLevel",
|
||||||
|
"positionSalaryAmount",
|
||||||
|
"refCommandNo",
|
||||||
|
"amount",
|
||||||
|
"templateDoc",
|
||||||
|
"position",
|
||||||
|
"orgRoot",
|
||||||
|
"orgChild1",
|
||||||
|
"orgChild2",
|
||||||
|
"orgChild3",
|
||||||
|
"orgChild4",
|
||||||
|
"mpCee",
|
||||||
|
"positionExecutive",
|
||||||
|
],
|
||||||
|
where: { profileEmployeeId: id },
|
||||||
|
order: { date: "ASC" },
|
||||||
|
});
|
||||||
|
const salarys =
|
||||||
|
salary_raw.length > 1
|
||||||
|
? salary_raw.slice(1).map((item) => ({
|
||||||
|
date: item.date ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) : null,
|
||||||
|
position: item.position != null ? item.position : "-",
|
||||||
|
posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
|
||||||
|
orgRoot: item.orgRoot,
|
||||||
|
orgChild1: item.orgChild1,
|
||||||
|
orgChild2: item.orgChild2,
|
||||||
|
orgChild3: item.orgChild3,
|
||||||
|
orgChild4: item.orgChild4,
|
||||||
|
mpCee: item.mpCee,
|
||||||
|
positionExecutive: item.positionExecutive,
|
||||||
|
}))
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
date: "-",
|
||||||
|
position: "-",
|
||||||
|
posNo: "-",
|
||||||
|
orgRoot: null,
|
||||||
|
orgChild1: null,
|
||||||
|
orgChild2: null,
|
||||||
|
orgChild3: null,
|
||||||
|
orgChild4: null,
|
||||||
|
mpCee: null,
|
||||||
|
positionExecutive: null,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const educations = await this.profileEducationRepo.find({
|
const educations = await this.profileEducationRepo.find({
|
||||||
select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"],
|
select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"],
|
||||||
where: { profileEmployeeId: id },
|
where: { profileEmployeeId: id },
|
||||||
|
|
@ -254,19 +306,19 @@ export class ProfileEmployeeController extends Controller {
|
||||||
prefix: profile.prefix != null ? profile.prefix : null,
|
prefix: profile.prefix != null ? profile.prefix : null,
|
||||||
firstName: profile.firstName != null ? profile.firstName : null,
|
firstName: profile.firstName != null ? profile.firstName : null,
|
||||||
lastName: profile.lastName != null ? profile.lastName : null,
|
lastName: profile.lastName != null ? profile.lastName : null,
|
||||||
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "-",
|
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "",
|
||||||
dateOfBirth:
|
dateOfBirth:
|
||||||
profile.birthDate != null
|
profile.birthDate != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
||||||
: "-",
|
: "",
|
||||||
dateRetire:
|
dateRetire:
|
||||||
profile.dateRetire != null
|
profile.dateRetire != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
||||||
: "-",
|
: "",
|
||||||
salaryAmount:
|
salaryAmount:
|
||||||
profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null
|
profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null
|
||||||
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
|
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
|
||||||
: "-",
|
: "",
|
||||||
registrationAddress: Extension.ToThaiNumber(
|
registrationAddress: Extension.ToThaiNumber(
|
||||||
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
||||||
),
|
),
|
||||||
|
|
@ -275,14 +327,57 @@ export class ProfileEmployeeController extends Controller {
|
||||||
? Extension.ToThaiNumber(
|
? Extension.ToThaiNumber(
|
||||||
Extension.ToThaiShortDate_monthYear(profile.profileSalary[0].date),
|
Extension.ToThaiShortDate_monthYear(profile.profileSalary[0].date),
|
||||||
)
|
)
|
||||||
: "-",
|
: "",
|
||||||
positionName: profile.position != null ? profile.position : "-",
|
positionName: profile.position != null ? profile.position : "",
|
||||||
appointText:
|
appointText:
|
||||||
profile.dateAppoint != null
|
profile.dateAppoint != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
|
||||||
: "-",
|
: "",
|
||||||
|
posNo:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].posNo != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].posNo))
|
||||||
|
: "",
|
||||||
|
position:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].position != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].position))
|
||||||
|
: "",
|
||||||
|
mpCee:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].mpCee != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].mpCee))
|
||||||
|
: "",
|
||||||
|
positionExecutive:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].positionExecutive != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionExecutive))
|
||||||
|
: "",
|
||||||
|
org: `${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild4 && salary_raw[0].orgChild4 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild4)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild3 && salary_raw[0].orgChild3 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild3)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild2 && salary_raw[0].orgChild2 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild2)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild1 && salary_raw[0].orgChild1 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild1)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgRoot && salary_raw[0].orgRoot != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgRoot))
|
||||||
|
: ""
|
||||||
|
}`,
|
||||||
ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||||
educations: Education,
|
educations: Education,
|
||||||
|
salarys: salarys.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
org: `${item.orgChild4 && item.orgChild4 != "-" ? item.orgChild4 + " " : ""}${item.orgChild3 && item.orgChild3 != "-" ? item.orgChild3 + " " : ""}${item.orgChild2 && item.orgChild2 != "-" ? item.orgChild2 + " " : ""}${item.orgChild1 && item.orgChild1 != "-" ? item.orgChild1 + " " : ""}${item.orgRoot && item.orgRoot != "-" ? item.orgRoot + " " : ""}`,
|
||||||
|
};
|
||||||
|
}),
|
||||||
url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`,
|
url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,56 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
||||||
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
|
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
|
||||||
|
|
||||||
|
const salary_raw = await this.salaryRepo.find({
|
||||||
|
select: [
|
||||||
|
"date",
|
||||||
|
"position",
|
||||||
|
"posNo",
|
||||||
|
"positionType",
|
||||||
|
"positionLevel",
|
||||||
|
"positionSalaryAmount",
|
||||||
|
"refCommandNo",
|
||||||
|
"amount",
|
||||||
|
"templateDoc",
|
||||||
|
"orgRoot",
|
||||||
|
"orgChild1",
|
||||||
|
"orgChild2",
|
||||||
|
"orgChild3",
|
||||||
|
"orgChild4",
|
||||||
|
"mpCee",
|
||||||
|
"positionExecutive",
|
||||||
|
],
|
||||||
|
where: { profileEmployeeId: id },
|
||||||
|
order: { date: "ASC" },
|
||||||
|
});
|
||||||
|
const salarys =
|
||||||
|
salary_raw.length > 1
|
||||||
|
? salary_raw.slice(1).map((item) => ({
|
||||||
|
date: item.date ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) : null,
|
||||||
|
position: item.position != null ? item.position : "-",
|
||||||
|
posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
|
||||||
|
orgRoot: item.orgRoot,
|
||||||
|
orgChild1: item.orgChild1,
|
||||||
|
orgChild2: item.orgChild2,
|
||||||
|
orgChild3: item.orgChild3,
|
||||||
|
orgChild4: item.orgChild4,
|
||||||
|
mpCee: item.mpCee,
|
||||||
|
positionExecutive: item.positionExecutive,
|
||||||
|
}))
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
date: "-",
|
||||||
|
position: "-",
|
||||||
|
posNo: "-",
|
||||||
|
orgRoot: null,
|
||||||
|
orgChild1: null,
|
||||||
|
orgChild2: null,
|
||||||
|
orgChild3: null,
|
||||||
|
orgChild4: null,
|
||||||
|
mpCee: null,
|
||||||
|
positionExecutive: null,
|
||||||
|
},
|
||||||
|
];
|
||||||
const educations = await this.profileEducationRepo.find({
|
const educations = await this.profileEducationRepo.find({
|
||||||
select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"],
|
select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"],
|
||||||
where: { profileEmployeeId: id },
|
where: { profileEmployeeId: id },
|
||||||
|
|
@ -251,19 +301,19 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
prefix: profile.prefix != null ? profile.prefix : null,
|
prefix: profile.prefix != null ? profile.prefix : null,
|
||||||
firstName: profile.firstName != null ? profile.firstName : null,
|
firstName: profile.firstName != null ? profile.firstName : null,
|
||||||
lastName: profile.lastName != null ? profile.lastName : null,
|
lastName: profile.lastName != null ? profile.lastName : null,
|
||||||
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "-",
|
citizenId: profile.citizenId != null ? Extension.ToThaiNumber(profile.citizenId) : "",
|
||||||
dateOfBirth:
|
dateOfBirth:
|
||||||
profile.birthDate != null
|
profile.birthDate != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.birthDate))
|
||||||
: "-",
|
: "",
|
||||||
dateRetire:
|
dateRetire:
|
||||||
profile.dateRetire != null
|
profile.dateRetire != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateRetire))
|
||||||
: "-",
|
: "",
|
||||||
salaryAmount:
|
salaryAmount:
|
||||||
profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null
|
profile.profileSalary.length > 0 && profile.profileSalary[0].amount != null
|
||||||
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
|
? Extension.ToThaiNumber(profile.profileSalary[0].amount.toLocaleString())
|
||||||
: "-",
|
: "",
|
||||||
registrationAddress: Extension.ToThaiNumber(
|
registrationAddress: Extension.ToThaiNumber(
|
||||||
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
`${_regisAddres}${_subDistrict}${_district}${_province}${registrationZipCode}`,
|
||||||
),
|
),
|
||||||
|
|
@ -272,14 +322,57 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
? Extension.ToThaiNumber(
|
? Extension.ToThaiNumber(
|
||||||
Extension.ToThaiShortDate_monthYear(profile.profileSalary[0].date),
|
Extension.ToThaiShortDate_monthYear(profile.profileSalary[0].date),
|
||||||
)
|
)
|
||||||
: "-",
|
: "",
|
||||||
positionName: profile.position != null ? profile.position : "-",
|
positionName: profile.position != null ? profile.position : "",
|
||||||
appointText:
|
appointText:
|
||||||
profile.dateAppoint != null
|
profile.dateAppoint != null
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate_monthYear(profile.dateAppoint))
|
||||||
: "-",
|
: "",
|
||||||
|
posNo:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].posNo != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].posNo))
|
||||||
|
: "",
|
||||||
|
position:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].position != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].position))
|
||||||
|
: "",
|
||||||
|
mpCee:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].mpCee != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].mpCee))
|
||||||
|
: "",
|
||||||
|
positionExecutive:
|
||||||
|
salary_raw.length > 0 && salary_raw[0].positionExecutive != null
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionExecutive))
|
||||||
|
: "",
|
||||||
|
org: `${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild4 && salary_raw[0].orgChild4 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild4)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild3 && salary_raw[0].orgChild3 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild3)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild2 && salary_raw[0].orgChild2 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild2)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgChild1 && salary_raw[0].orgChild1 != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild1)) + " "
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
salary_raw.length > 0 && salary_raw[0].orgRoot && salary_raw[0].orgRoot != "-"
|
||||||
|
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgRoot))
|
||||||
|
: ""
|
||||||
|
}`,
|
||||||
ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
|
||||||
educations: Education,
|
educations: Education,
|
||||||
|
salarys: salarys.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
org: `${item.orgChild4 && item.orgChild4 != "-" ? item.orgChild4 + " " : ""}${item.orgChild3 && item.orgChild3 != "-" ? item.orgChild3 + " " : ""}${item.orgChild2 && item.orgChild2 != "-" ? item.orgChild2 + " " : ""}${item.orgChild1 && item.orgChild1 != "-" ? item.orgChild1 + " " : ""}${item.orgRoot && item.orgRoot != "-" ? item.orgRoot + " " : ""}`,
|
||||||
|
};
|
||||||
|
}),
|
||||||
url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`,
|
url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue