fix delete file and report
This commit is contained in:
parent
35b06d8c67
commit
3ce799f9be
3 changed files with 95 additions and 80 deletions
|
|
@ -22,7 +22,7 @@ import {
|
||||||
listFile,
|
listFile,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from "../services/edm";
|
} from "../services/edm";
|
||||||
import { s3DownloadFile, s3ListFile, s3UploadFile } from "../services/minio";
|
import { s3DeleteFile, s3DownloadFile, s3ListFile, s3UploadFile } from "../services/minio";
|
||||||
|
|
||||||
@Route("api/v1/salary/file/{name}/{group}")
|
@Route("api/v1/salary/file/{name}/{group}")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
|
|
@ -337,6 +337,20 @@ export class FileController extends Controller {
|
||||||
@Path() id: string,
|
@Path() id: string,
|
||||||
@Path() file: string,
|
@Path() file: string,
|
||||||
) {
|
) {
|
||||||
|
if (name !== "ระบบประเมิน"){
|
||||||
|
const rawPath = [
|
||||||
|
name,
|
||||||
|
group,
|
||||||
|
id,
|
||||||
|
file
|
||||||
|
];
|
||||||
|
const fullPath = rawPath
|
||||||
|
.filter((path) => path !== undefined && path !== null)
|
||||||
|
.join("/");
|
||||||
|
|
||||||
|
const path = fullPath;
|
||||||
|
return await s3DeleteFile(path);
|
||||||
|
}
|
||||||
const result = await deleteFile([name, group, id], file);
|
const result = await deleteFile([name, group, id], file);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|
|
||||||
|
|
@ -2009,13 +2009,13 @@ export class ReportController extends Controller {
|
||||||
return {
|
return {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullname: profile.prefix + profile.firstName + " " + profile.lastName,
|
fullname: profile.prefix + profile.firstName + " " + profile.lastName,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
posLevel: profile.posLevel,
|
posLevel: profile.posLevel,
|
||||||
posNumber:
|
posNumber: profile.orgShortName || profile.posMasterNo ?
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()) : "-",
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
||||||
reason: null, //เหตุผล
|
reason: null, //เหตุผล
|
||||||
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
||||||
remark: profile.remark, //หมายเหตุ
|
remark: profile.remark, //หมายเหตุ
|
||||||
|
|
@ -2074,6 +2074,7 @@ export class ReportController extends Controller {
|
||||||
const salaryProfile = await this.salaryProfileRepository.find({
|
const salaryProfile = await this.salaryProfileRepository.find({
|
||||||
where: {
|
where: {
|
||||||
type: Not(In(["NONE","PENDING"])),
|
type: Not(In(["NONE","PENDING"])),
|
||||||
|
isReserve : Not(true),
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
|
|
@ -2103,7 +2104,7 @@ export class ReportController extends Controller {
|
||||||
const formattedData = salaryProfile.map((item, index) => ({
|
const formattedData = salaryProfile.map((item, index) => ({
|
||||||
no: Extension.ToThaiNumber(String(index + 1)),
|
no: Extension.ToThaiNumber(String(index + 1)),
|
||||||
fullname: item.prefix + item.firstName + " " + item.lastName,
|
fullname: item.prefix + item.firstName + " " + item.lastName,
|
||||||
position: item.position,
|
position: item.position??"-",
|
||||||
affiliation:
|
affiliation:
|
||||||
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
||||||
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
|
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
|
||||||
|
|
@ -2130,11 +2131,12 @@ export class ReportController extends Controller {
|
||||||
(item.amountSpecial > 0
|
(item.amountSpecial > 0
|
||||||
? `(${Extension.ToThaiNumber(String(item.positionSalaryAmount))})`
|
? `(${Extension.ToThaiNumber(String(item.positionSalaryAmount))})`
|
||||||
: ""),
|
: ""),
|
||||||
remark:
|
remark: [
|
||||||
`${item.type === "FULL" ? "หนึ่งขั้น" : ""}\n` +
|
item.type === "FULL" ? "หนึ่งขั้น" : "",
|
||||||
`${item.type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : ""}\n` +
|
item.type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "",
|
||||||
`${item.amountSpecial > 0 ? "ได้รับค่าตอบแทนพิเศษ\n" : ""}` +
|
item.amountSpecial > 0 ? "ได้รับค่าตอบแทนพิเศษ" : "",
|
||||||
`${item.isNext === true ? "(ได้รับเงินเดือนสูงกว่าขั้นสูงฯ)" : ""}`,
|
item.isNext === true ? "(ได้รับเงินเดือนสูงกว่าขั้นสูงฯ)" : ""
|
||||||
|
].filter(Boolean).join("\n")
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
|
|
@ -2648,11 +2650,11 @@ export class ReportController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: null,
|
: "-",
|
||||||
posNumber:
|
posNumber: profile.orgShortName || profile.posMasterNo ?
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()) : "-",
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
||||||
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-",
|
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-",
|
||||||
reason: profile.remark,
|
reason: profile.remark,
|
||||||
};
|
};
|
||||||
|
|
@ -2778,6 +2780,7 @@ export class ReportController extends Controller {
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
type: In(["HAFT", "FULL", "FULLHAFT"]),
|
type: In(["HAFT", "FULL", "FULLHAFT"]),
|
||||||
|
amountSpecial: MoreThan(0),
|
||||||
isNext: true,
|
isNext: true,
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
|
|
@ -2814,13 +2817,13 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: "-",
|
: "-",
|
||||||
posNumber:
|
posNumber: profile.orgShortName || profile.posMasterNo ?
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()) : "-",
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
||||||
positionSalaryAmount: profile.positionSalaryAmount
|
positionSalaryAmount: profile.positionSalaryAmount
|
||||||
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
||||||
|
|
@ -2828,11 +2831,11 @@ export class ReportController extends Controller {
|
||||||
amountSpecialFormated:
|
amountSpecialFormated:
|
||||||
profile.amountSpecial > 0
|
profile.amountSpecial > 0
|
||||||
? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")"
|
? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")"
|
||||||
: "",
|
: "-",
|
||||||
amountSpecial:
|
amountSpecial:
|
||||||
profile.amountSpecial > 0
|
profile.amountSpecial > 0
|
||||||
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
||||||
: "",
|
: "-",
|
||||||
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
||||||
reason: profile.remark,
|
reason: profile.remark,
|
||||||
};
|
};
|
||||||
|
|
@ -2902,18 +2905,18 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: "-",
|
: "-",
|
||||||
posNumber:
|
posNumber:profile.orgShortName || profile.posMasterNo ?
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()): "-",
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
||||||
positionSalaryAmount: profile.positionSalaryAmount
|
positionSalaryAmount: profile.positionSalaryAmount
|
||||||
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
||||||
: "-",
|
: "-",
|
||||||
reasonSign: "-",
|
reasonSign: "",
|
||||||
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
||||||
reason: profile.remark, //เหตุผลที่ไม่สมควรหรือไม่อาจเลื่อนขั้นค่าจ้าง
|
reason: profile.remark, //เหตุผลที่ไม่สมควรหรือไม่อาจเลื่อนขั้นค่าจ้าง
|
||||||
};
|
};
|
||||||
|
|
@ -2984,7 +2987,7 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: "-",
|
: "-",
|
||||||
|
|
@ -2997,7 +3000,7 @@ export class ReportController extends Controller {
|
||||||
positionSalaryAmount: profile.positionSalaryAmount
|
positionSalaryAmount: profile.positionSalaryAmount
|
||||||
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
||||||
: "-",
|
: "-",
|
||||||
reasonSign: "-",
|
reasonSign: "",
|
||||||
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
score: profile.result ? Extension.ToThaiNumber(profile.result) : "-", //สรุปผลการประเมินฯ ระดับและคะแนน
|
||||||
reason: profile.remark, //เหตุผลที่ไม่สมควรหรือไม่อาจเลื่อนขั้นค่าจ้าง
|
reason: profile.remark, //เหตุผลที่ไม่สมควรหรือไม่อาจเลื่อนขั้นค่าจ้าง
|
||||||
};
|
};
|
||||||
|
|
@ -3125,7 +3128,7 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -4398,12 +4401,12 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
posLevel: Extension.ToThaiNumber(profile.posLevel.toLocaleString()),
|
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):"-",
|
||||||
posNumber:
|
posNumber: profile.orgShortName || profile.posMasterNo ?
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()) : "-",
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
||||||
//เมษา ปีก่อนหน้า
|
//เมษา ปีก่อนหน้า
|
||||||
typeOld2:
|
typeOld2:
|
||||||
aprPreviousYear2 && aprPreviousYearProfile2.length > 0
|
aprPreviousYear2 && aprPreviousYearProfile2.length > 0
|
||||||
|
|
@ -4422,7 +4425,7 @@ export class ReportController extends Controller {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
})()
|
})()
|
||||||
: null,
|
: "-",
|
||||||
yearOld:
|
yearOld:
|
||||||
octPreviousYear == null ? null : Extension.ToThaiNumber(octPreviousYear.year.toString()),
|
octPreviousYear == null ? null : Extension.ToThaiNumber(octPreviousYear.year.toString()),
|
||||||
//ตุลา ปีก่อนหน้า
|
//ตุลา ปีก่อนหน้า
|
||||||
|
|
@ -4443,7 +4446,7 @@ export class ReportController extends Controller {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
})()
|
})()
|
||||||
: null,
|
: "-",
|
||||||
typeOld:
|
typeOld:
|
||||||
aprPreviousYearProfileCurrent.length > 0
|
aprPreviousYearProfileCurrent.length > 0
|
||||||
? (() => {
|
? (() => {
|
||||||
|
|
@ -4460,7 +4463,7 @@ export class ReportController extends Controller {
|
||||||
? "๑.๕ ขั้น"
|
? "๑.๕ ขั้น"
|
||||||
: "ไม่ได้เลื่อนขั้นฯ";
|
: "ไม่ได้เลื่อนขั้นฯ";
|
||||||
})()
|
})()
|
||||||
: null, //เมษา
|
: "-", //เมษา
|
||||||
type:
|
type:
|
||||||
profile.type === "HAFT"
|
profile.type === "HAFT"
|
||||||
? "๐.๕ ขั้น"
|
? "๐.๕ ขั้น"
|
||||||
|
|
@ -4469,8 +4472,8 @@ export class ReportController extends Controller {
|
||||||
: profile.type === "FULLHAFT"
|
: profile.type === "FULLHAFT"
|
||||||
? "๑.๕ ขั้น"
|
? "๑.๕ ขั้น"
|
||||||
: "ไม่ได้เลื่อนขั้นฯ",
|
: "ไม่ได้เลื่อนขั้นฯ",
|
||||||
score1: profile.result,
|
score1: profile.result?? "-",
|
||||||
score2: null,
|
score2: "-",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -4564,8 +4567,8 @@ export class ReportController extends Controller {
|
||||||
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
||||||
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
||||||
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: "-",
|
: "-",
|
||||||
posNumber:
|
posNumber:
|
||||||
profile.orgShortName || profile.posMasterNo
|
profile.orgShortName || profile.posMasterNo
|
||||||
|
|
@ -5301,8 +5304,8 @@ export class ReportController extends Controller {
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: null,
|
: "-",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -5695,17 +5698,17 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position,
|
position: profile.position??"-",
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
: null,
|
: "-",
|
||||||
posNumber:
|
posNumber: profile.orgShortName || profile.posMasterNo ?
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()):"-",
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "-",
|
||||||
positionSalaryAmount: profile.positionSalaryAmount
|
positionSalaryAmount: profile.positionSalaryAmount
|
||||||
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
||||||
: null,
|
: "-",
|
||||||
reason: null,
|
reason: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -5776,25 +5779,13 @@ export class ReportController extends Controller {
|
||||||
.filter((part) => part !== undefined && part !== null)
|
.filter((part) => part !== undefined && part !== null)
|
||||||
.join("/");
|
.join("/");
|
||||||
|
|
||||||
const positionParts = [
|
|
||||||
profile.position,
|
|
||||||
profile.child4,
|
|
||||||
profile.child3,
|
|
||||||
profile.child2,
|
|
||||||
profile.child1,
|
|
||||||
profile.root,
|
|
||||||
];
|
|
||||||
|
|
||||||
const position = positionParts
|
|
||||||
.filter((part) => part !== undefined && part !== null)
|
|
||||||
.join("/");
|
|
||||||
const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`;
|
const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: position,
|
position: profile.position?profile.position:"-",
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
: "-",
|
: "-",
|
||||||
|
|
@ -5841,6 +5832,8 @@ export class ReportController extends Controller {
|
||||||
const _salaryProfileEmp = await this.salaryProfileEmployeeRepository.find({
|
const _salaryProfileEmp = await this.salaryProfileEmployeeRepository.find({
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
|
type: Not(In(["NONE","PENDING"])),
|
||||||
|
amountSpecial: MoreThan(0),
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
|
|
@ -5848,6 +5841,7 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
|
type: "DESC",
|
||||||
orgShortName: "ASC",
|
orgShortName: "ASC",
|
||||||
posMasterNo: "ASC",
|
posMasterNo: "ASC",
|
||||||
},
|
},
|
||||||
|
|
@ -5871,41 +5865,48 @@ export class ReportController extends Controller {
|
||||||
const affiliation = fullNameParts
|
const affiliation = fullNameParts
|
||||||
.filter((part) => part !== undefined && part !== null)
|
.filter((part) => part !== undefined && part !== null)
|
||||||
.join("/");
|
.join("/");
|
||||||
|
|
||||||
|
const positionParts = [
|
||||||
|
profile.position,
|
||||||
|
profile.child4,
|
||||||
|
profile.child3,
|
||||||
|
profile.child2,
|
||||||
|
profile.child1,
|
||||||
|
profile.root,
|
||||||
|
];
|
||||||
|
|
||||||
|
const position = positionParts
|
||||||
|
.filter((part) => part !== undefined && part !== null)
|
||||||
|
.join("/");
|
||||||
|
|
||||||
const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`;
|
const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position:
|
position: position,
|
||||||
profile.position +
|
|
||||||
"/" +
|
|
||||||
(profile.child4 == undefined && profile.child4 == null ? "" : profile.child4 + "/") +
|
|
||||||
(profile.child3 == undefined && profile.child3 == null ? "" : profile.child3 + "/") +
|
|
||||||
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
|
||||||
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
|
||||||
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
: null,
|
: "-",
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
positionSalaryAmount: profile.positionSalaryAmount
|
positionSalaryAmount: profile.positionSalaryAmount
|
||||||
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
||||||
: null,
|
: "-",
|
||||||
precentTwo:
|
precentTwo:
|
||||||
profile.positionSalaryAmount == 0.02
|
profile.positionSalaryAmountPer == 0.02
|
||||||
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
||||||
: null, //ร้อยละ 2
|
: "-", //ร้อยละ 2
|
||||||
precentFour:
|
precentFour:
|
||||||
profile.positionSalaryAmount == 0.04
|
profile.positionSalaryAmountPer == 0.04
|
||||||
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
||||||
: null, //ร้อยละ 4
|
: "-", //ร้อยละ 4
|
||||||
precentSix:
|
precentSix:
|
||||||
profile.positionSalaryAmount == 0.06
|
profile.positionSalaryAmountPer == 0.06
|
||||||
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
||||||
: null, //ร้อยละ 6
|
: "-", //ร้อยละ 6
|
||||||
reason: null,
|
reason: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -5981,8 +5982,8 @@ export class ReportController extends Controller {
|
||||||
affiliation: affiliation,
|
affiliation: affiliation,
|
||||||
position: profile.position ?? "-",
|
position: profile.position ?? "-",
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: "-",
|
: "-",
|
||||||
posNumber:
|
posNumber:
|
||||||
profile.orgShortName || profile.posMasterNo
|
profile.orgShortName || profile.posMasterNo
|
||||||
? Extension.ToThaiNumber(profile.orgShortName) +
|
? Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,11 @@ export async function setFile(path: string, exp = 6 * 60 * 60) {
|
||||||
return await minio.presignedPutObject(MINIO_BUCKET, path, exp);
|
return await minio.presignedPutObject(MINIO_BUCKET, path, exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteFile(path: string) {
|
export async function s3DeleteFile(path: string) {
|
||||||
await minio.removeObject(MINIO_BUCKET, path, { forceDelete: true });
|
await minio.removeObject(MINIO_BUCKET, path, { forceDelete: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteFolder(path: string) {
|
export async function s3DeleteFolder(path: string) {
|
||||||
new Promise<string[]>((resolve, reject) => {
|
new Promise<string[]>((resolve, reject) => {
|
||||||
const item: string[] = [];
|
const item: string[] = [];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue