Migrate add table profileSalaryBackup & เพิ่ม insert รักษาการ และช่วยราชการ #2292

This commit is contained in:
harid 2026-02-06 14:47:13 +07:00
parent 203ec6cb84
commit 5b726e69c8
5 changed files with 406 additions and 21 deletions

View file

@ -49,7 +49,7 @@ export class ProfileSalaryEmployeeController extends Controller {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
const record = await this.salaryRepo.find({
where: { profileEmployeeId: profile.id, commandCode: In(["5", "6", "7"]) },
where: { profileEmployeeId: profile.id, commandCode: In(["5", "6", "7", "19"]) },
order: { order: "ASC" },
});
return new HttpSuccess(record);
@ -96,7 +96,7 @@ export class ProfileSalaryEmployeeController extends Controller {
if (_workflow == false)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const record = await this.salaryRepo.find({
where: { profileEmployeeId: profileId, commandCode: In(["5", "6", "7"]) },
where: { profileEmployeeId: profileId, commandCode: In(["5", "6", "7", "19"]) },
order: { order: "ASC" },
});
return new HttpSuccess(record);
@ -322,7 +322,7 @@ export class ProfileSalaryEmployeeController extends Controller {
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
const record = await this.salaryRepo.find({
where: { profileEmployeeId: profileId, commandCode: In(["5", "6", "7"]) },
where: { profileEmployeeId: profileId, commandCode: In(["5", "6", "7", "19"]) },
order: { order: "ASC" },
});
return new HttpSuccess(record);
@ -395,6 +395,7 @@ export class ProfileSalaryEmployeeController extends Controller {
if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ";
else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ";
else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ";
else if (body.commandCode == "19") body.commandName = "ไม่ได้เลื่อนเงินเดือน/ค่าจ้าง";
}
Object.assign(data, { ...body, ...meta });
const history = new ProfileSalaryHistory();
@ -528,6 +529,7 @@ export class ProfileSalaryEmployeeController extends Controller {
if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ";
else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ";
else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ";
else if (body.commandCode == "19") body.commandName = "ไม่ได้เลื่อนเงินเดือน/ค่าจ้าง";
}
Object.assign(record, body);
Object.assign(history, { ...record, id: undefined });