This commit is contained in:
AdisakKanthawilang 2025-04-28 13:47:46 +07:00
parent ac5c3daf7b
commit ac2e9e2006

View file

@ -7236,7 +7236,7 @@ export class ReportController extends Controller {
let conditionGroup = "";
if (body.type.trim().toUpperCase() == "GROUP1.1") {
conditionGroup =
"(salaryProfile.posType = 'ทั่วไป' AND salaryProfile.posLevel = 'ชำนาญงาน') OR (salaryProfile.posType = 'ทั่วไป' AND salaryProfile.posLevel = 'ปฏิบัติงาน') OR (salaryProfile.posType = 'วิชาการ' AND salaryProfile.posLevel = 'ปฏิบัติการ') OR (salaryProfile.posType = 'วิชาการ' AND salaryProfile.posLevel = 'ชำนาญการ')";
"(salaryProfile.posType = 'ทั่วไป' AND salaryProfile.posLevel = 'ชำนาญงาน') OR (salaryProfile.posType = 'ทั่วไป' AND salaryProfile.posLevel = 'ปฏิบัติงาน') OR (salaryProfile.posType = 'ทั่วไป' AND salaryProfile.posLevel = 'อาวุโส') OR (salaryProfile.posType = 'วิชาการ' AND salaryProfile.posLevel = 'ปฏิบัติการ') OR (salaryProfile.posType = 'วิชาการ' AND salaryProfile.posLevel = 'ชำนาญการ') OR (salaryProfile.posType = 'วิชาการ' AND salaryProfile.posLevel = 'ชำนาญการพิเศษ') OR (salaryProfile.posType = 'อำนวยการ' AND salaryProfile.posLevel = 'ต้น')";
} else if (body.type.trim().toUpperCase() == "GROUP1.2") {
conditionGroup =
"(salaryProfile.posType = 'ทั่วไป' AND salaryProfile.posLevel = 'อาวุโส') OR (salaryProfile.posType = 'วิชาการ' AND salaryProfile.posLevel = 'ชำนาญการพิเศษ') OR (salaryProfile.posType = 'อำนวยการ' AND salaryProfile.posLevel = 'ต้น')";
@ -7255,7 +7255,6 @@ export class ReportController extends Controller {
const salaryOrgs = await this.salaryOrgRepository.find({
where: { salaryPeriodId: salary.id, snapshot: "SNAP2" },
});
let salaryRank = await AppDataSource.getRepository(SalaryProfile)
.createQueryBuilder("salaryProfile")
.andWhere("salaryProfile.rootId LIKE :rootId", {
@ -7296,7 +7295,7 @@ export class ReportController extends Controller {
.addOrderBy("salaryProfile.child4Order", "ASC")
.addOrderBy("salaryProfile.posMasterNo", "ASC")
.getMany();
const _salaryRank = salaryRank.map((item) => ({
id: item.id,
posMasterNo: `${item.orgShortName} ${item.posMasterNo}`,