no message

This commit is contained in:
Bright 2025-02-17 10:27:26 +07:00
parent 3161ccce3d
commit 8de7931d4f

View file

@ -1869,114 +1869,205 @@ export class ReportController extends Controller {
fullnameCommanderHigh: fullnameCommanderHigh:
`${kpiUserEvaluation.prefixCommanderHigh}${kpiUserEvaluation.firstNameCommanderHigh} ${kpiUserEvaluation.lastNameCommanderHigh}`, `${kpiUserEvaluation.prefixCommanderHigh}${kpiUserEvaluation.firstNameCommanderHigh} ${kpiUserEvaluation.lastNameCommanderHigh}`,
positionCommanderHigh: kpiUserEvaluation.positionCommanderHigh ? kpiUserEvaluation.positionCommanderHigh : "-", positionCommanderHigh: kpiUserEvaluation.positionCommanderHigh ? kpiUserEvaluation.positionCommanderHigh : "-",
planneds: kpiUserEvaluation.kpiUserPlanneds planneds: kpiUserEvaluation.kpiUserPlanneds.length != 0
.map( ? kpiUserEvaluation.kpiUserPlanneds
x => ({ .map(
name: Plan.find(y => y.id === x.kpiPlanId)?.includingName || "-", x => ({
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-", name: Plan.find(y => y.id === x.kpiPlanId)?.includingName || "-",
point1: x.point == 1 ? "✔" : "-", target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point2: x.point == 2 ? "✔" : "-", point1: x.point == 1 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-", point2: x.point == 2 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-", point3: x.point == 3 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-", point4: x.point == 4 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-", point5: x.point == 5 ? "✔" : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`), weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
}) summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
), })
roles: kpiUserEvaluation.kpiUserRoles )
.map( : [{
x => ({ name: "-",
name: Role.find(y => y.id === x.kpiRoleId)?.includingName || "-", target: "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-", point1: "-",
point1: x.point == 1 ? "✔" : "-", point2: "-",
point2: x.point == 2 ? "✔" : "-", point3: "-",
point3: x.point == 3 ? "✔" : "-", point4: "-",
point4: x.point == 4 ? "✔" : "-", point5: "-",
point5: x.point == 5 ? "✔" : "-", weight: "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-", achievement: "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`), summary: "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", }],
}) roles: kpiUserEvaluation.kpiUserRoles.length != 0
), ? kpiUserEvaluation.kpiUserRoles
specials: kpiUserEvaluation.kpiUserSpecials .map(
.map( x => ({
x => ({ name: Role.find(y => y.id === x.kpiRoleId)?.includingName || "-",
name: x.includingName ?? "-", target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-", point1: x.point == 1 ? "✔" : "-",
point1: x.point == 1 ? "✔" : "-", point2: x.point == 2 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-", point3: x.point == 3 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-", point4: x.point == 4 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-", point5: x.point == 5 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-", weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-", achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`), summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", })
}) )
), : [{
develops: kpiUserEvaluation.kpiUserDevelopments name: "-",
.map( target: "-",
x => ({ point1: "-",
name: x.name ?? "-", point2: "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-", point3: "-",
achievement10: x.point == 10 ? `🗹 ${x.achievement10}` : `${x.achievement10}`, point4: "-",
achievement5: x.point == 5 ? `🗹 ${x.achievement5}` : `${x.achievement5}`, point5: "-",
achievement0: x.point == 0 ? `🗹 ${x.achievement0}` : `${x.achievement0}`, weight: "-",
isDevelopment70: x.isDevelopment70 == true ? `🗹 ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)` : `☐ ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)`, achievement: "-",
isDevelopment20: x.isDevelopment20 == true ? `🗹 ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting` : `☐ ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting`, summary: "-",
isDevelopment10: x.isDevelopment10 == true ? `🗹 ๑๐ การฝึกอบรมอื่น ๆ` : `☐ ๑๐ การฝึกอบรมอื่น ๆ`, }],
point: x.point ? Extension.ToThaiNumber(x.point.toLocaleString()) : "-", specials: kpiUserEvaluation.kpiUserSpecials.length != 0
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", ? kpiUserEvaluation.kpiUserSpecials
}) .map(
), x => ({
headCaps: kpiUserEvaluation.kpiUserCapacitys name: x.includingName ?? "-",
.filter( target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
x => Capacitys.some(y => y.id === x.kpiCapacityId && y.type === "HEAD") point1: x.point == 1 ? "✔" : "-",
).map( point2: x.point == 2 ? "✔" : "-",
x => ({ point3: x.point == 3 ? "✔" : "-",
name: `- ${Capacitys.find(y => y.id === x.kpiCapacityId)?.name}`, point4: x.point == 4 ? "✔" : "-",
level: x.level ? Extension.ToThaiNumber(x.level.toLocaleString()) : "-", point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-", weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-", achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
point2: x.point == 2 ? "✔" : "-", summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
point3: x.point == 3 ? "✔" : "-", })
point4: x.point == 4 ? "✔" : "-", )
point5: x.point == 5 ? "✔" : "-", : [{
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", name: "-",
}) target: "-",
), point1: "-",
executiveCaps: kpiUserEvaluation.kpiUserCapacitys point2: "-",
.filter( point3: "-",
x => Capacitys.some(y => y.id === x.kpiCapacityId && y.type === "EXECUTIVE") point4: "-",
).map( point5: "-",
x => ({ weight: "-",
name: `- ${Capacitys.find(y => y.id === x.kpiCapacityId)?.name}`, achievement: "-",
level: x.level ? Extension.ToThaiNumber(x.level.toLocaleString()) : "-", summary: "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-", }],
point1: x.point == 1 ? "✔" : "-", develops: kpiUserEvaluation.kpiUserDevelopments.length != 0
point2: x.point == 2 ? "✔" : "-", ? kpiUserEvaluation.kpiUserDevelopments
point3: x.point == 3 ? "✔" : "-", .map(
point4: x.point == 4 ? "✔" : "-", x => ({
point5: x.point == 5 ? "✔" : "-", name: x.name ?? "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
}) achievement10: x.point == 10 ? `🗹 ${x.achievement10}` : `${x.achievement10}`,
), achievement5: x.point == 5 ? `🗹 ${x.achievement5}` : `${x.achievement5}`,
groupCaps: kpiUserEvaluation.kpiUserCapacitys achievement0: x.point == 0 ? `🗹 ${x.achievement0}` : `${x.achievement0}`,
.filter( isDevelopment70: x.isDevelopment70 == true ? `🗹 ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)` : `☐ ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)`,
x => Capacitys.some(y => y.id === x.kpiCapacityId && y.type === "GROUP") isDevelopment20: x.isDevelopment20 == true ? `🗹 ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting` : `☐ ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting`,
).map( isDevelopment10: x.isDevelopment10 == true ? `🗹 ๑๐ การฝึกอบรมอื่น ๆ` : `☐ ๑๐ การฝึกอบรมอื่น ๆ`,
x => ({ point: x.point ? Extension.ToThaiNumber(x.point.toLocaleString()) : "-",
name: `- ${Capacitys.find(y => y.id === x.kpiCapacityId)?.name}`, summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
level: x.level ? Extension.ToThaiNumber(x.level.toLocaleString()) : "-", })
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-", )
point1: x.point == 1 ? "✔" : "-", : [{
point2: x.point == 2 ? "✔" : "-", name: "-",
point3: x.point == 3 ? "✔" : "-", target: "-",
point4: x.point == 4 ? "✔" : "-", achievement10: "-",
point5: x.point == 5 ? "✔" : "-", // achievement5: "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-", // achievement0: "-",
}) isDevelopment70: "-",
), // isDevelopment20: "-",
// isDevelopment10: "-",
point: "-",
summary: "-",
}],
headCaps: kpiUserEvaluation.kpiUserCapacitys.length != 0
//&& Capacitys.filter(cap => cap.type === "HEAD" && cap.id == kpiUserEvaluation.kpiUserCapacitys[0].kpiCapacityId).length != 0
? kpiUserEvaluation.kpiUserCapacitys
.filter(
x => Capacitys.some(y => y.id === x.kpiCapacityId && y.type === "HEAD")
).map(
x => ({
name: `- ${Capacitys.find(y => y.id === x.kpiCapacityId)?.name}`,
level: x.level ? Extension.ToThaiNumber(x.level.toLocaleString()) : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
level: "-",
weight: "-",
point1: "-",
point2: "-",
point3: "-",
point4: "-",
point5: "-",
summary: "-",
}],
executiveCaps: kpiUserEvaluation.kpiUserCapacitys.length != 0
//&& Capacitys.filter(cap => cap.type === "EXECUTIVE" && cap.id == kpiUserEvaluation.kpiUserCapacitys[0].kpiCapacityId).length != 0
? kpiUserEvaluation.kpiUserCapacitys
.filter(
x => Capacitys.some(y => y.id === x.kpiCapacityId && y.type === "EXECUTIVE")
).map(
x => ({
name: `- ${Capacitys.find(y => y.id === x.kpiCapacityId)?.name}`,
level: x.level ? Extension.ToThaiNumber(x.level.toLocaleString()) : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
level: "-",
weight: "-",
point1: "-",
point2: "-",
point3: "-",
point4: "-",
point5: "-",
summary: "-",
}],
groupCaps: kpiUserEvaluation.kpiUserCapacitys.length != 0
//&& Capacitys.filter(cap => cap.type === "GROUP" && cap.id == kpiUserEvaluation.kpiUserCapacitys[0].kpiCapacityId).length != 0
? kpiUserEvaluation.kpiUserCapacitys
.filter(
x => Capacitys.some(y => y.id === x.kpiCapacityId && y.type === "GROUP")
).map(
x => ({
name: `- ${Capacitys.find(y => y.id === x.kpiCapacityId)?.name}`,
level: x.level ? Extension.ToThaiNumber(x.level.toLocaleString()) : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
level: "-",
weight: "-",
point1: "-",
point2: "-",
point3: "-",
point4: "-",
point5: "-",
summary: "-",
}],
}; };
return new HttpSuccess({ return new HttpSuccess({