ปรับลำดับแสดงในreportให้ตรงกับหน้าเว็บ

This commit is contained in:
Bright 2024-04-09 16:20:53 +07:00
parent f078d02462
commit 9132d4cd99

View file

@ -230,21 +230,125 @@ export class ReportController extends Controller {
if (!salaryPeriod) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
}
const _salaryPeriod = await this.salaryProfileRepository.find({
// const _salaryPeriod = await this.salaryProfileRepository.find({
// relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
// where: {
// salaryOrg: {
// snapshot: "SNAP1",
// rootId: rootId,
// salaryPeriodId: salaryPeriodId,
// },
// },
// order: {
// orgShortName: "ASC",
// posMasterNo: "ASC",
// },
// });
const _salaryPeriod1 = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
snapshot: "SNAP1",
rootId: rootId,
salaryPeriodId: salaryPeriodId,
group: "GROUP1",
},
type: "HAFT"
},
order: {
orgShortName: "ASC",
posMasterNo: "ASC",
citizenId: "ASC",
isReserve: "ASC",
},
});
const _salaryPeriod2 = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
snapshot: "SNAP1",
rootId: rootId,
salaryPeriodId: salaryPeriodId,
group: "GROUP1",
},
type: "FULL"
},
order: {
citizenId: "ASC",
isReserve: "ASC",
},
});
const _salaryPeriod3 = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
snapshot: "SNAP1",
rootId: rootId,
salaryPeriodId: salaryPeriodId,
group: "GROUP1",
},
type: "NONE"
},
order: {
citizenId: "ASC",
isReserve: "ASC",
},
});
const _salaryPeriod4 = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
snapshot: "SNAP1",
rootId: rootId,
salaryPeriodId: salaryPeriodId,
group: "GROUP2",
},
type: "HAFT"
},
order: {
citizenId: "ASC",
isReserve: "ASC",
},
});
const _salaryPeriod5 = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
snapshot: "SNAP1",
rootId: rootId,
salaryPeriodId: salaryPeriodId,
group: "GROUP2",
},
type: "FULL"
},
order: {
citizenId: "ASC",
isReserve: "ASC",
},
});
const _salaryPeriod6 = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
snapshot: "SNAP1",
rootId: rootId,
salaryPeriodId: salaryPeriodId,
group: "GROUP2",
},
type: "NONE"
},
order: {
citizenId: "ASC",
isReserve: "ASC",
},
});
const _salaryPeriod = _salaryPeriod1.concat(
_salaryPeriod2,
_salaryPeriod3,
_salaryPeriod4,
_salaryPeriod5,
_salaryPeriod6
);
if (!_salaryPeriod) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}