แก้รายงานแบบย่อ

This commit is contained in:
kittapath 2025-03-05 16:58:11 +07:00
parent 1a39c0bfb1
commit cf03109db1
3 changed files with 83 additions and 59 deletions

View file

@ -236,23 +236,23 @@ export class ProfileController extends Controller {
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
const salary_raw = await this.salaryRepo.find({ const salary_raw = await this.salaryRepo.find({
select: [ // select: [
"commandDateAffect", // "commandDateAffect",
"positionName", // "positionName",
"posNo", // "posNo",
"positionType", // "positionType",
"positionLevel", // "positionLevel",
"positionSalaryAmount", // "positionSalaryAmount",
"commandNo", // "commandNo",
"amount", // "amount",
"remark", // "remark",
"orgRoot", // "orgRoot",
"orgChild1", // "orgChild1",
"orgChild2", // "orgChild2",
"orgChild3", // "orgChild3",
"orgChild4", // "orgChild4",
"positionExecutive", // "positionExecutive",
], // ],
where: { where: {
profileId: id, profileId: id,
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]), commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
@ -266,7 +266,11 @@ export class ProfileController extends Controller {
date: item.commandDateAffect date: item.commandDateAffect
? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect)) ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect))
: null, : 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, posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
orgRoot: item.orgRoot, orgRoot: item.orgRoot,
orgChild1: item.orgChild1, orgChild1: item.orgChild1,
@ -349,7 +353,11 @@ export class ProfileController extends Controller {
: "", : "",
position: position:
salary_raw.length > 0 && salary_raw[0].positionName != null 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: positionCee:
salary_raw.length > 0 && salary_raw[0].positionCee != null salary_raw.length > 0 && salary_raw[0].positionCee != null

View file

@ -228,24 +228,24 @@ export class ProfileEmployeeController extends Controller {
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
const salary_raw = await this.salaryRepo.find({ const salary_raw = await this.salaryRepo.find({
select: [ // select: [
"commandDateAffect", // "commandDateAffect",
"posNo", // "posNo",
"positionType", // "positionType",
"positionLevel", // "positionLevel",
"positionSalaryAmount", // "positionSalaryAmount",
"commandNo", // "commandNo",
"amount", // "amount",
"remark", // "remark",
"positionName", // "positionName",
"orgRoot", // "orgRoot",
"orgChild1", // "orgChild1",
"orgChild2", // "orgChild2",
"orgChild3", // "orgChild3",
"orgChild4", // "orgChild4",
"positionCee", // "positionCee",
"positionExecutive", // "positionExecutive",
], // ],
where: { where: {
profileEmployeeId: id, profileEmployeeId: id,
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]), commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
@ -258,7 +258,11 @@ export class ProfileEmployeeController extends Controller {
date: item.commandDateAffect date: item.commandDateAffect
? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect)) ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect))
: null, : 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, posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
orgRoot: item.orgRoot, orgRoot: item.orgRoot,
orgChild1: item.orgChild1, orgChild1: item.orgChild1,
@ -341,7 +345,11 @@ export class ProfileEmployeeController extends Controller {
: "", : "",
position: position:
salary_raw.length > 0 && salary_raw[0].positionName != null 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: positionCee:
salary_raw.length > 0 && salary_raw[0].positionCee != null salary_raw.length > 0 && salary_raw[0].positionCee != null

View file

@ -223,24 +223,24 @@ export class ProfileEmployeeTempController extends Controller {
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`; let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
const salary_raw = await this.salaryRepo.find({ const salary_raw = await this.salaryRepo.find({
select: [ // select: [
"commandDateAffect", // "commandDateAffect",
"positionName", // "positionName",
"posNo", // "posNo",
"positionType", // "positionType",
"positionLevel", // "positionLevel",
"positionSalaryAmount", // "positionSalaryAmount",
"commandNo", // "commandNo",
"amount", // "amount",
"remark", // "remark",
"orgRoot", // "orgRoot",
"orgChild1", // "orgChild1",
"orgChild2", // "orgChild2",
"orgChild3", // "orgChild3",
"orgChild4", // "orgChild4",
"positionCee", // "positionCee",
"positionExecutive", // "positionExecutive",
], // ],
where: { where: {
profileEmployeeId: id, profileEmployeeId: id,
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]), commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
@ -253,7 +253,11 @@ export class ProfileEmployeeTempController extends Controller {
date: item.commandDateAffect date: item.commandDateAffect
? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect)) ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.commandDateAffect))
: null, : 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, posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
orgRoot: item.orgRoot, orgRoot: item.orgRoot,
orgChild1: item.orgChild1, orgChild1: item.orgChild1,
@ -335,7 +339,11 @@ export class ProfileEmployeeTempController extends Controller {
: "", : "",
position: position:
salary_raw.length > 0 && salary_raw[0].positionName != null 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: positionCee:
salary_raw.length > 0 && salary_raw[0].positionCee != null salary_raw.length > 0 && salary_raw[0].positionCee != null