This commit is contained in:
Adisak 2025-11-03 10:29:25 +07:00
parent e706475d81
commit 43aeb144d4

View file

@ -572,7 +572,9 @@ export class ReportController extends Controller {
"AVG(kpiUserEvaluation.summaryPoint) as avgSummaryPoint"
])
.getRawMany();
if(!profileEvaluationNowYearIds || profileEvaluationNowYearIds.length === 0){
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรายงานการประเมินผลฯ ระดับบุคคลของบุคคลนี้");
}
// const profileEvaluations = await this.kpiUserEvaluationRepository.find({
// relations: ["kpiPeriod"],
// where: { id: In(profileEvaluationNowYearIds.map((evaluation) => evaluation.id)) },
@ -1500,6 +1502,9 @@ export class ReportController extends Controller {
.groupBy("kpiUserEvaluation.kpiPeriodId")
.select("MIN(kpiUserEvaluation.id) as id")
.getRawMany();
if(!profileEvaluationIds || profileEvaluationIds.length === 0){
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรายงานการประเมินผลฯ ระดับบุคคลของบุคคลนี้");
}
if (profileEvaluationIds.length > 0) {
userInfo = await this.kpiUserEvaluationRepository.find({
where: {
@ -1532,7 +1537,6 @@ export class ReportController extends Controller {
const dev20text = "การเรียนรู้จากผู้อื่น (Coach/Mentor/Consulting)";
const dev70text = "การลงมือปฏิบัติ (โดยผู้บังคับบัญชามอบหมาย)";
const combianText = [dev10text, dev20text, dev70text];
formattedUserDevelopmentLists = userDevelopmentLists.map(
(development: any, index: number) => ({
no: Extension.ToThaiNumber((index + 1).toString()),