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:
`${kpiUserEvaluation.prefixCommanderHigh}${kpiUserEvaluation.firstNameCommanderHigh} ${kpiUserEvaluation.lastNameCommanderHigh}`,
positionCommanderHigh: kpiUserEvaluation.positionCommanderHigh ? kpiUserEvaluation.positionCommanderHigh : "-",
planneds: kpiUserEvaluation.kpiUserPlanneds
.map(
x => ({
name: Plan.find(y => y.id === x.kpiPlanId)?.includingName || "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
),
roles: kpiUserEvaluation.kpiUserRoles
.map(
x => ({
name: Role.find(y => y.id === x.kpiRoleId)?.includingName || "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
),
specials: kpiUserEvaluation.kpiUserSpecials
.map(
x => ({
name: x.includingName ?? "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
),
develops: kpiUserEvaluation.kpiUserDevelopments
.map(
x => ({
name: x.name ?? "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
achievement10: x.point == 10 ? `🗹 ${x.achievement10}` : `${x.achievement10}`,
achievement5: x.point == 5 ? `🗹 ${x.achievement5}` : `${x.achievement5}`,
achievement0: x.point == 0 ? `🗹 ${x.achievement0}` : `${x.achievement0}`,
isDevelopment70: x.isDevelopment70 == true ? `🗹 ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)` : `☐ ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)`,
isDevelopment20: x.isDevelopment20 == true ? `🗹 ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting` : `☐ ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting`,
isDevelopment10: x.isDevelopment10 == true ? `🗹 ๑๐ การฝึกอบรมอื่น ๆ` : `☐ ๑๐ การฝึกอบรมอื่น ๆ`,
point: x.point ? Extension.ToThaiNumber(x.point.toLocaleString()) : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
),
headCaps: 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()) : "-",
})
),
executiveCaps: 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()) : "-",
})
),
groupCaps: 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()) : "-",
})
),
planneds: kpiUserEvaluation.kpiUserPlanneds.length != 0
? kpiUserEvaluation.kpiUserPlanneds
.map(
x => ({
name: Plan.find(y => y.id === x.kpiPlanId)?.includingName || "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
target: "-",
point1: "-",
point2: "-",
point3: "-",
point4: "-",
point5: "-",
weight: "-",
achievement: "-",
summary: "-",
}],
roles: kpiUserEvaluation.kpiUserRoles.length != 0
? kpiUserEvaluation.kpiUserRoles
.map(
x => ({
name: Role.find(y => y.id === x.kpiRoleId)?.includingName || "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
target: "-",
point1: "-",
point2: "-",
point3: "-",
point4: "-",
point5: "-",
weight: "-",
achievement: "-",
summary: "-",
}],
specials: kpiUserEvaluation.kpiUserSpecials.length != 0
? kpiUserEvaluation.kpiUserSpecials
.map(
x => ({
name: x.includingName ?? "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
point1: x.point == 1 ? "✔" : "-",
point2: x.point == 2 ? "✔" : "-",
point3: x.point == 3 ? "✔" : "-",
point4: x.point == 4 ? "✔" : "-",
point5: x.point == 5 ? "✔" : "-",
weight: x.weight ? Extension.ToThaiNumber(x.weight.toLocaleString()) : "-",
achievement: Extension.ToThaiNumber(`ระดับ ${x.point}`),
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
target: "-",
point1: "-",
point2: "-",
point3: "-",
point4: "-",
point5: "-",
weight: "-",
achievement: "-",
summary: "-",
}],
develops: kpiUserEvaluation.kpiUserDevelopments.length != 0
? kpiUserEvaluation.kpiUserDevelopments
.map(
x => ({
name: x.name ?? "-",
target: x.target ? Extension.ToThaiNumber(x.target.toLocaleString()) : "-",
achievement10: x.point == 10 ? `🗹 ${x.achievement10}` : `${x.achievement10}`,
achievement5: x.point == 5 ? `🗹 ${x.achievement5}` : `${x.achievement5}`,
achievement0: x.point == 0 ? `🗹 ${x.achievement0}` : `${x.achievement0}`,
isDevelopment70: x.isDevelopment70 == true ? `🗹 ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)` : `☐ ๗๐ การลงมือปฏิบัติ(โดยผู้บังคับบัญชามอบหมาย)`,
isDevelopment20: x.isDevelopment20 == true ? `🗹 ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting` : `☐ ๒๐ การเรียนรู้จากผู้อื่น Coach/Mentor/Consulting`,
isDevelopment10: x.isDevelopment10 == true ? `🗹 ๑๐ การฝึกอบรมอื่น ๆ` : `☐ ๑๐ การฝึกอบรมอื่น ๆ`,
point: x.point ? Extension.ToThaiNumber(x.point.toLocaleString()) : "-",
summary: x.summary ? Extension.ToThaiNumber(x.summary.toLocaleString()) : "-",
})
)
: [{
name: "-",
target: "-",
achievement10: "-",
// achievement5: "-",
// 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({