diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index a18aca6c..32da2951 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -236,23 +236,23 @@ export class ProfileController extends Controller { let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; const salary_raw = await this.salaryRepo.find({ - select: [ - "commandDateAffect", - "positionName", - "posNo", - "positionType", - "positionLevel", - "positionSalaryAmount", - "commandNo", - "amount", - "remark", - "orgRoot", - "orgChild1", - "orgChild2", - "orgChild3", - "orgChild4", - "positionExecutive", - ], + // select: [ + // "commandDateAffect", + // "positionName", + // "posNo", + // "positionType", + // "positionLevel", + // "positionSalaryAmount", + // "commandNo", + // "amount", + // "remark", + // "orgRoot", + // "orgChild1", + // "orgChild2", + // "orgChild3", + // "orgChild4", + // "positionExecutive", + // ], where: { profileId: id, commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]), @@ -266,7 +266,11 @@ export class ProfileController extends Controller { date: item.commandDateAffect ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect)) : null, - position: item.positionName != null ? item.positionName : "-", + position: Extension.ToThaiNumber( + Extension.ToThaiNumber( + `${item.positionName != null ? item.positionName : "-"} ${item.positionType == null ? item.positionCee : (item.positionType == "อำนวยการ" || item.positionType == "บริหาร" ? item.positionType : "") + item.positionLevel}`, + ), + ), posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null, orgRoot: item.orgRoot, orgChild1: item.orgChild1, @@ -349,7 +353,11 @@ export class ProfileController extends Controller { : "", position: salary_raw.length > 0 && salary_raw[0].positionName != null - ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionName)) + ? Extension.ToThaiNumber( + Extension.ToThaiNumber( + `${salary_raw[0].positionName != null ? salary_raw[0].positionName : "-"} ${salary_raw[0].positionType == null ? salary_raw[0].positionCee : (salary_raw[0].positionType == "อำนวยการ" || salary_raw[0].positionType == "บริหาร" ? salary_raw[0].positionType : "") + salary_raw[0].positionLevel}`, + ), + ) : "", positionCee: salary_raw.length > 0 && salary_raw[0].positionCee != null diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index e1a1f707..c54ad861 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -228,24 +228,24 @@ export class ProfileEmployeeController extends Controller { let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; const salary_raw = await this.salaryRepo.find({ - select: [ - "commandDateAffect", - "posNo", - "positionType", - "positionLevel", - "positionSalaryAmount", - "commandNo", - "amount", - "remark", - "positionName", - "orgRoot", - "orgChild1", - "orgChild2", - "orgChild3", - "orgChild4", - "positionCee", - "positionExecutive", - ], + // select: [ + // "commandDateAffect", + // "posNo", + // "positionType", + // "positionLevel", + // "positionSalaryAmount", + // "commandNo", + // "amount", + // "remark", + // "positionName", + // "orgRoot", + // "orgChild1", + // "orgChild2", + // "orgChild3", + // "orgChild4", + // "positionCee", + // "positionExecutive", + // ], where: { profileEmployeeId: id, commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]), @@ -258,7 +258,11 @@ export class ProfileEmployeeController extends Controller { date: item.commandDateAffect ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect)) : null, - position: item.positionName != null ? item.positionName : "-", + position: Extension.ToThaiNumber( + Extension.ToThaiNumber( + `${item.positionName != null ? item.positionName : "-"} ${item.positionType == null ? item.positionCee : (item.positionType == "อำนวยการ" || item.positionType == "บริหาร" ? item.positionType : "") + item.positionLevel}`, + ), + ), posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null, orgRoot: item.orgRoot, orgChild1: item.orgChild1, @@ -341,7 +345,11 @@ export class ProfileEmployeeController extends Controller { : "", position: salary_raw.length > 0 && salary_raw[0].positionName != null - ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionName)) + ? Extension.ToThaiNumber( + Extension.ToThaiNumber( + `${salary_raw[0].positionName != null ? salary_raw[0].positionName : "-"} ${salary_raw[0].positionType == null ? salary_raw[0].positionCee : (salary_raw[0].positionType == "อำนวยการ" || salary_raw[0].positionType == "บริหาร" ? salary_raw[0].positionType : "") + salary_raw[0].positionLevel}`, + ), + ) : "", positionCee: salary_raw.length > 0 && salary_raw[0].positionCee != null diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index eb090a7d..6d98310d 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -223,24 +223,24 @@ export class ProfileEmployeeTempController extends Controller { let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; const salary_raw = await this.salaryRepo.find({ - select: [ - "commandDateAffect", - "positionName", - "posNo", - "positionType", - "positionLevel", - "positionSalaryAmount", - "commandNo", - "amount", - "remark", - "orgRoot", - "orgChild1", - "orgChild2", - "orgChild3", - "orgChild4", - "positionCee", - "positionExecutive", - ], + // select: [ + // "commandDateAffect", + // "positionName", + // "posNo", + // "positionType", + // "positionLevel", + // "positionSalaryAmount", + // "commandNo", + // "amount", + // "remark", + // "orgRoot", + // "orgChild1", + // "orgChild2", + // "orgChild3", + // "orgChild4", + // "positionCee", + // "positionExecutive", + // ], where: { profileEmployeeId: id, commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]), @@ -253,7 +253,11 @@ export class ProfileEmployeeTempController extends Controller { date: item.commandDateAffect ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect)) : null, - position: item.positionName != null ? item.positionName : "-", + position: Extension.ToThaiNumber( + Extension.ToThaiNumber( + `${item.positionName != null ? item.positionName : "-"} ${item.positionType == null ? item.positionCee : (item.positionType == "อำนวยการ" || item.positionType == "บริหาร" ? item.positionType : "") + item.positionLevel}`, + ), + ), posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null, orgRoot: item.orgRoot, orgChild1: item.orgChild1, @@ -335,7 +339,11 @@ export class ProfileEmployeeTempController extends Controller { : "", position: salary_raw.length > 0 && salary_raw[0].positionName != null - ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionName)) + ? Extension.ToThaiNumber( + Extension.ToThaiNumber( + `${salary_raw[0].positionName != null ? salary_raw[0].positionName : "-"} ${salary_raw[0].positionType == null ? salary_raw[0].positionCee : (salary_raw[0].positionType == "อำนวยการ" || salary_raw[0].positionType == "บริหาร" ? salary_raw[0].positionType : "") + salary_raw[0].positionLevel}`, + ), + ) : "", positionCee: salary_raw.length > 0 && salary_raw[0].positionCee != null