Merge branch 'develop' into adiDev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s

This commit is contained in:
Adisak 2026-05-11 13:02:25 +07:00
commit b000e8b531
20 changed files with 10943 additions and 261 deletions

View file

@ -83,7 +83,6 @@ import { ProfileChildren } from "../entities/ProfileChildren";
import { ProfileDuty } from "../entities/ProfileDuty";
import { CreatePosMasterHistoryEmployee, getTopDegrees } from "../services/PositionService";
import { ProfileLeaveService } from "../services/ProfileLeaveService";
import { PostRetireToExprofile } from "./ExRetirementController";
import { CommandCode } from "../entities/CommandCode";
@Route("api/v1/org/profile-employee")
@Tags("ProfileEmployee")
@ -1961,11 +1960,17 @@ export class ProfileEmployeeController extends Controller {
});
// มีคำสั่งพ้นราชการหรือไม่
if (salaries.length > 0 && salaries.some((s) => s.commandCode &&
retireCommandCodes.includes(s.commandCode))) {
if (
salaries.length > 0 &&
salaries.some((s) => s.commandCode && retireCommandCodes.includes(s.commandCode))
) {
// กรองข้อมูลซ้ำตาม commandDateAffect
const uniqueSalaries = salaries.filter((item, index, self) =>
index === self.findIndex((t) => t.commandDateAffect?.getTime() === item.commandDateAffect?.getTime())
const uniqueSalaries = salaries.filter(
(item, index, self) =>
index ===
self.findIndex(
(t) => t.commandDateAffect?.getTime() === item.commandDateAffect?.getTime(),
),
);
// วนลูปหาคู่ของ "ออกราชการ" และ "กลับเข้าราชการ"
@ -2017,7 +2022,7 @@ export class ProfileEmployeeController extends Controller {
retires.push({
date: `${startDateStr} - ${endDateStr}`,
detail: detail || "-",
day: daysCount > 0 ? Extension.ToThaiNumber(daysCount.toLocaleString()) : "-"
day: daysCount > 0 ? Extension.ToThaiNumber(daysCount.toLocaleString()) : "-",
});
}
}
@ -5794,20 +5799,6 @@ export class ProfileEmployeeController extends Controller {
].filter(Boolean);
organizeName = names.join(" ");
}
PostRetireToExprofile(
request,
profile.citizenId ?? "",
profile.prefix ?? "",
profile.firstName ?? "",
profile.lastName ?? "",
requestBody.dateLeave?.getFullYear().toString() ?? "",
profile.position,
profile.posType?.posTypeName ?? "",
`${profile.posType?.posTypeShortName} ${profile.posLevel?.posLevelName}`,
requestBody.dateLeave ?? new Date(),
organizeName,
"ถึงแก่กรรม",
);
return new HttpSuccess();
}