Merge branch 'develop' of github.com:Frappet/bma-ehr-salary into develop
This commit is contained in:
commit
93ec5e374e
1 changed files with 111 additions and 112 deletions
|
|
@ -231,125 +231,124 @@ 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 _salaryPeriod1 = await this.salaryProfileRepository.find({
|
||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||
where: {
|
||||
salaryOrg: {
|
||||
snapshot: "SNAP1",
|
||||
rootId: rootId,
|
||||
salaryPeriodId: salaryPeriodId,
|
||||
group: "GROUP1",
|
||||
},
|
||||
type: "HAFT",
|
||||
},
|
||||
order: {
|
||||
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,
|
||||
);
|
||||
// const _salaryPeriod = _salaryPeriod1.concat(
|
||||
// _salaryPeriod2,
|
||||
// _salaryPeriod3,
|
||||
// _salaryPeriod4,
|
||||
// _salaryPeriod5,
|
||||
// _salaryPeriod6,
|
||||
// );
|
||||
if (!_salaryPeriod) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
|
@ -1084,8 +1083,8 @@ export class ReportController extends Controller {
|
|||
group: "GROUP2",
|
||||
},
|
||||
});
|
||||
|
||||
if (salaryPeriod.period === "APR") {
|
||||
|
||||
if (salaryOrg_Group1 && salaryPeriod.period === "APR") {
|
||||
const salaryProfileGroup1 = await this.salaryProfileRepository.find({
|
||||
where: {
|
||||
salaryOrgId: salaryOrg_Group1?.id,
|
||||
|
|
@ -1098,7 +1097,7 @@ export class ReportController extends Controller {
|
|||
type: "FULL", //หนึ่งขั้น
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
//รอบปีก่อนๆ
|
||||
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
|
|
@ -1357,9 +1356,9 @@ export class ReportController extends Controller {
|
|||
score: null, //ผลการประเมินฯ
|
||||
remark: null, //หมายเหตุ
|
||||
})),
|
||||
},
|
||||
}||{},
|
||||
});
|
||||
} else if (salaryPeriod.period === "OCT") {
|
||||
} else if (salaryOrg_Group1 &&salaryPeriod.period === "OCT") {
|
||||
// find period APR
|
||||
const salaryPeriod_APR = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue