แก้บันทึกผลประวัติตำแหน่ง

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2025-03-10 12:53:11 +07:00
parent 3db68cd99c
commit 1fe092da16

View file

@ -1119,7 +1119,7 @@ export class ReportController extends Controller {
salaryPeriodId: salaryPeriodIncrease2_APR?.id, salaryPeriodId: salaryPeriodIncrease2_APR?.id,
// rootId: rootId, // rootId: rootId,
// root: rootName?.root, // root: rootName?.root,
rootId:salaryOrg?.rootDnaId, rootId: salaryOrg?.rootDnaId,
snapshot: "SNAP1", snapshot: "SNAP1",
group: convertGroup, group: convertGroup,
}, },
@ -1133,7 +1133,7 @@ export class ReportController extends Controller {
salaryPeriodId: salaryPeriodIncrease2_OCT?.id, salaryPeriodId: salaryPeriodIncrease2_OCT?.id,
// rootId: rootId, // rootId: rootId,
// root: rootName?.root, // root: rootName?.root,
rootId:salaryOrg?.rootDnaId, rootId: salaryOrg?.rootDnaId,
snapshot: "SNAP1", snapshot: "SNAP1",
group: convertGroup, group: convertGroup,
}, },
@ -1170,7 +1170,7 @@ export class ReportController extends Controller {
salaryPeriodId: salaryPeriodIncrease1_APR?.id, salaryPeriodId: salaryPeriodIncrease1_APR?.id,
// rootId: rootId, // rootId: rootId,
// root: rootName?.root, // root: rootName?.root,
rootId:salaryOrg2_APR?.rootDnaId, rootId: salaryOrg2_APR?.rootDnaId,
snapshot: "SNAP1", snapshot: "SNAP1",
group: convertGroup, group: convertGroup,
}, },
@ -1184,7 +1184,7 @@ export class ReportController extends Controller {
salaryPeriodId: salaryPeriodIncrease1_OCT?.id, salaryPeriodId: salaryPeriodIncrease1_OCT?.id,
// rootId: rootId, // rootId: rootId,
// root: rootName?.root, // root: rootName?.root,
rootId:salaryOrg2_APR?.rootDnaId, rootId: salaryOrg2_APR?.rootDnaId,
snapshot: "SNAP1", snapshot: "SNAP1",
group: convertGroup, group: convertGroup,
}, },
@ -2503,7 +2503,6 @@ export class ReportController extends Controller {
@Path() salaryPeriodId: string, @Path() salaryPeriodId: string,
@Path() group: string, @Path() group: string,
) { ) {
const salaryPeriod = await this.salaryPeriodRepository.findOne({ const salaryPeriod = await this.salaryPeriodRepository.findOne({
where: { where: {
id: salaryPeriodId, id: salaryPeriodId,
@ -2577,53 +2576,53 @@ export class ReportController extends Controller {
const formattedData = salaryProfile.map((item, index) => ({ const formattedData = salaryProfile.map((item, index) => ({
no: Extension.ToThaiNumber(String(index + 1)), no: Extension.ToThaiNumber(String(index + 1)),
fullname: item.prefix + item.firstName + " " + item.lastName, fullname: item.prefix + item.firstName + " " + item.lastName,
root: item.root??"-", root: item.root ?? "-",
position: item.position??"-", position: item.position ?? "-",
posMasterNo: posMasterNo:
Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo)), Extension.ToThaiNumber(item.orgShortName) +
posTypeCurrent: item.posType??"-", Extension.ToThaiNumber(String(item.posMasterNo)),
posLevelCurrent: item.posLevel??"-", posTypeCurrent: item.posType ?? "-",
amountCurrent: item.amount? Extension.ToThaiNumber(item.amount.toLocaleString()):"-", posLevelCurrent: item.posLevel ?? "-",
posTypePrevious: salaryProfilePrevious.length > 0 amountCurrent: item.amount ? Extension.ToThaiNumber(item.amount.toLocaleString()) : "-",
posTypePrevious:
salaryProfilePrevious.length > 0
? (() => { ? (() => {
const filteredType = salaryProfilePrevious const filteredType = salaryProfilePrevious
.filter((profile) => profile.citizenId === item.citizenId) .filter((profile) => profile.citizenId === item.citizenId)
.map((profile) => profile.posType); .map((profile) => profile.posType);
const posType = filteredType[0]; const posType = filteredType[0];
return posType return posType ? posType : "-";
? posType : "-";
})() })()
: "-", : "-",
posLevelPrevious: salaryProfilePrevious.length > 0 posLevelPrevious:
salaryProfilePrevious.length > 0
? (() => { ? (() => {
const filteredLevel = salaryProfilePrevious const filteredLevel = salaryProfilePrevious
.filter((profile) => profile.citizenId === item.citizenId) .filter((profile) => profile.citizenId === item.citizenId)
.map((profile) => profile.posLevel); .map((profile) => profile.posLevel);
const posLevel = filteredLevel[0]; const posLevel = filteredLevel[0];
return posLevel return posLevel ? posLevel : "-";
? posLevel : "-";
})() })()
: "-", : "-",
amountPrevious: salaryProfilePrevious.length > 0 amountPrevious:
salaryProfilePrevious.length > 0
? (() => { ? (() => {
const filteredAmount = salaryProfilePrevious const filteredAmount = salaryProfilePrevious
.filter((profile) => profile.citizenId === item.citizenId) .filter((profile) => profile.citizenId === item.citizenId)
.map((profile) => profile.amount); .map((profile) => profile.amount);
const amount = filteredAmount[0]; const amount = filteredAmount[0];
return amount return amount ? Extension.ToThaiNumber(amount.toLocaleString()) : "-";
? Extension.ToThaiNumber(amount.toLocaleString()):"-"
})() })()
: "-", : "-",
deduction: "-", //เงินปรับลด deduction: "-", //เงินปรับลด
promote: item.amountUse?Extension.ToThaiNumber(item.amountUse.toLocaleString()):"-", //เงินเลื่อนขั้น promote: item.amountUse ? Extension.ToThaiNumber(item.amountUse.toLocaleString()) : "-", //เงินเลื่อนขั้น
qualification: "-", //เงินปรับวุฒิ qualification: "-", //เงินปรับวุฒิ
adjustRate: "-", //เงินปรับอัตรา adjustRate: "-", //เงินปรับอัตรา
newRate: "-", //อัตราตั้งใหม่ newRate: "-", //อัตราตั้งใหม่
specialPromote: "-", //ลำดับการเลื่อนกรณีพิเศษ specialPromote: "-", //ลำดับการเลื่อนกรณีพิเศษ
remark: item.remark??"-", remark: item.remark ?? "-",
temporaryPayment: "-", //ถือจ่ายชั่วคราวขั้น temporaryPayment: "-", //ถือจ่ายชั่วคราวขั้น
})) }));
return new HttpSuccess({ return new HttpSuccess({
template: "gov2-10", template: "gov2-10",
@ -7984,11 +7983,11 @@ export class ReportController extends Controller {
positionLevel: salary.posLevel, positionLevel: salary.posLevel,
commandId: v.commandId, commandId: v.commandId,
remark: v.remark, remark: v.remark,
orgRoot: salary.root, orgRootName: salary.root,
orgChild1: salary.child1, orgChild1Name: salary.child1,
orgChild2: salary.child2, orgChild2Name: salary.child2,
orgChild3: salary.child3, orgChild3Name: salary.child3,
orgChild4: salary.child4, orgChild4Name: salary.child4,
commandCode: v.commandCode, commandCode: v.commandCode,
commandName: v.commandName, commandName: v.commandName,
commandNo: v.commandNo, commandNo: v.commandNo,
@ -8024,7 +8023,7 @@ export class ReportController extends Controller {
refId: string; refId: string;
// commandAffectDate: Date | null;//เก่า // commandAffectDate: Date | null;//เก่า
commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG) commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG)
commandDateSign?: Date | null commandDateSign?: Date | null;
commandNo: string | null; commandNo: string | null;
commandYear: number | null; commandYear: number | null;
commandId: string | null; commandId: string | null;
@ -8061,11 +8060,11 @@ export class ReportController extends Controller {
amountSpecial: v.amountSpecial, amountSpecial: v.amountSpecial,
positionSalaryAmount: v.positionSalaryAmount, positionSalaryAmount: v.positionSalaryAmount,
mouthSalaryAmount: v.mouthSalaryAmount, mouthSalaryAmount: v.mouthSalaryAmount,
posNo: salary.posMasterNo != null?salary.posMasterNo.toString():null, posNo: salary.posMasterNo != null ? salary.posMasterNo.toString() : null,
posNoAbb: salary.orgShortName, posNoAbb: salary.orgShortName,
positionName: salary.position, positionName: salary.position,
positionType: salary.posType, positionType: salary.posType,
positionLevel: salary.posLevel != null?salary.posLevel.toString():null, positionLevel: salary.posLevel != null ? salary.posLevel.toString() : null,
remark: v.remark, remark: v.remark,
orgRoot: salary.root, orgRoot: salary.root,
orgChild1: salary.child1, orgChild1: salary.child1,