no message

This commit is contained in:
Bright 2024-03-18 16:11:13 +07:00
parent 596efe624a
commit 7c85fad2de
2 changed files with 117 additions and 19 deletions

View file

@ -130,8 +130,10 @@ export class ReportController extends Controller {
* @summary 1
*
*/
@Get("1/1/{rootId}/{salaryPeriodId}")
async SalaryReport1(@Path() rootId: string, @Path() salaryPeriodId: string) {
@Get("gov1-01/{rootId}/{salaryPeriodId}")
async SalaryReport1(
@Path() rootId: string,
@Path() salaryPeriodId: string) {
const salaryPeriodAPR = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
@ -192,17 +194,17 @@ export class ReportController extends Controller {
* @summary
*
*/
@Get("1/2/{rootId}/{salaryPeriodId}/{salaryOrgId}")
@Get("gov1-02/{rootId}/{salaryPeriodId}")
async SalaryReport2(
@Path() rootId: string,
@Path() salaryPeriodId: string,
@Path() salaryOrgId: string,
// @Path() salaryOrgId: string,
) {
const statistics = await this.salaryProfileRepository.find({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: {
salaryOrg: {
id: salaryOrgId,
// id: salaryOrgId,
snapshot: "SNAP1",
group: "GROUP2",
rootId: rootId,
@ -240,10 +242,8 @@ export class ReportController extends Controller {
* @param {string} rootId Guid, *Id Root
* @param {string} salaryPeriodId Guid, *Id Period
*/
@Get("1/3/{rootId}/{salaryPeriodId}")
@Get("gov1-03/{rootId}/{salaryPeriodId}")
async SalaryReport3(
// @Path() rootId : string = "c6164a42-539d-401a-b289-653282c08e37",
// @Path() salaryPeriodId: string = "31cfc7de-b93b-4998-bbf1-25c21f141ac2",
@Path() rootId: string,
@Path() salaryPeriodId: string,
) {
@ -327,10 +327,8 @@ export class ReportController extends Controller {
* @param {string} rootId Guid, *Id Root
* @param {string} salaryPeriodId Guid, *Id Period
*/
@Get("1/4/{rootId}/{salaryPeriodId}")
@Get("gov1-04/{rootId}/{salaryPeriodId}")
async SalaryReport4(
// @Path() rootId : string = "c6164a42-539d-401a-b289-653282c08e37",
// @Path() salaryPeriodId: string = "31cfc7de-b93b-4998-bbf1-25c21f141ac2",
@Path() rootId: string,
@Path() salaryPeriodId: string,
) {
@ -359,7 +357,10 @@ export class ReportController extends Controller {
});
const salaryProfile = await this.salaryProfileRepository.find({
where: { salaryOrgId: salaryOrg?.id },
where: {
salaryOrgId: salaryOrg?.id,
type: Not("NONE") //ทุก Type ยกเว้นไม่ได้เลื่อน
},
select: [
"id",
"prefix",
@ -407,6 +408,107 @@ export class ReportController extends Controller {
return mapData;
}
/**
* API 2
*
* @summary 2
*
* @param {string} rootId Guid, *Id Root
* @param {string} salaryPeriodId Guid, *Id Period
*/
@Get("gov1-05/{rootId}/{salaryPeriodId}")
async SalaryReport5(
@Path() rootId: string,
@Path() salaryPeriodId: string,
){
const salaryPeriod = await this.salaryPeriodRepository.findOne({
where: {
id: salaryPeriodId,
period: "APR",
isActive: true,
},
});
if (!salaryPeriod) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบรอบการขึ้นเงินเดือน");
}
const salaryOrg = await this.salaryOrgRepository.findOne({
where: {
salaryPeriodId: salaryPeriodId,
rootId: rootId,
snapshot: "SNAP2",
},
order: {
group: "ASC",
},
relations: ["salaryProfiles"],
});
const salaryProfile = await this.salaryProfileRepository.find({
where: {
salaryOrgId: salaryOrg?.id,
type: "NONE" //ไม่ได้เลื่อน
},
select: [
"id",
"prefix",
"firstName",
"lastName",
"root",
"position",
"posType",
"posLevel",
"orgShortName",
"posMasterNo",
"amount",
"amountSpecial",
],
});
const mapData = {
effectiveDate: salaryPeriod?.effectiveDate,
root: salaryProfile[0]?.root,
profile: salaryProfile.map((item, index) => ({
no: Extension.ToThaiNumber(String(index + 1)),
fullname: item.prefix + item.firstName + " " + item.lastName,
position:
item.position +
"/" +
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
(item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") +
(item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") +
(item.root == undefined && item.root == null ? "" : item.root),
posLevel: item.posLevel,
orgShortName: item.orgShortName + Extension.ToThaiNumber(String(item.posMasterNo)),
amount:
item.amount == undefined || item.amount == null
? ""
: Extension.ToThaiNumber(String(item.amount)),
amountSpecial:
item.amountSpecial == undefined || item.amountSpecial == null
? ""
: Extension.ToThaiNumber(String(item.amountSpecial)),
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
remark: null, //หมายเหตุ
})),
};
return mapData;
}
// /* API แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก
// *
// * @summary แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก
// *
// * @param {string} rootId Guid, *Id Root
// * @param {string} salaryPeriodId Guid, *Id Period
// */
// @Get("gov1-06/{rootId}/{salaryPeriodId}")
// async SalaryReport6(){
// }
/**
* API
*
@ -415,10 +517,8 @@ export class ReportController extends Controller {
* @param {string} rootId Guid, *Id Root
* @param {string} salaryPeriodId Guid, *Id Period
*/
@Get("1/7/{rootId}/{salaryPeriodId}")
@Get("gov1-07/{rootId}/{salaryPeriodId}")
async SalaryReport7(
// @Path() rootId : string = "c6164a42-539d-401a-b289-653282c08e37",
// @Path() salaryPeriodId: string = "31cfc7de-b93b-4998-bbf1-25c21f141ac2",
@Path() rootId: string,
@Path() salaryPeriodId: string,
) {
@ -501,10 +601,8 @@ export class ReportController extends Controller {
* @param {string} rootId Guid, *Id Root
* @param {string} salaryPeriodId Guid, *Id Period
*/
@Get("1/8/{rootId}/{salaryPeriodId}")
@Get("gov1-08/{rootId}/{salaryPeriodId}")
async SalaryReport8(
// @Path() rootId : string = "c6164a42-539d-401a-b289-653282c08e37",
// @Path() salaryPeriodId: string = "31cfc7de-b93b-4998-bbf1-25c21f141ac2",
@Path() rootId: string,
@Path() salaryPeriodId: string,
) {

View file

@ -36,7 +36,7 @@
"name": "SalaryRank", "description": "อัตราเงินเดือน"
},
{
"name": "Report", "description": "รายงานเงินเดือนข้าราชการ รอบเดือนเมษายน"
"name": "Report", "description": "รายงานเงินเดือนข้าราชการ"
}
]
},