From 724e7c705c361eba571d20ac6f6d4712f62c7e51 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 29 Jan 2025 17:18:25 +0700 Subject: [PATCH] no message --- src/controllers/KpiUserEvaluationController.ts | 16 ++++++++++++++++ src/entities/kpiUserEvaluation.ts | 16 ++++++++++++++++ .../1738145829806-Updateevaaddreject2.ts | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/migration/1738145829806-Updateevaaddreject2.ts diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index c8013ec..82efe4b 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -200,6 +200,8 @@ export class KpiUserEvaluationController extends Controller { commanderId: item.commanderId, commanderHighId: item.commanderHighId, reasonReject: item.reasonReject, + actorReject: item.actorReject, + actorNameReject: item.actorNameReject, isReject: item.reasonReject ? true : false, })); return new HttpSuccess({ data: mapData, total }); @@ -1012,6 +1014,8 @@ export class KpiUserEvaluationController extends Controller { .catch(() => {}); let _null: any = null; kpiUserEvaluation.reasonReject = _null; + kpiUserEvaluation.actorReject = _null; + kpiUserEvaluation.actorNameReject = _null; } else if (requestBody.status.trim().toUpperCase() == "EVALUATING_EVALUATOR") { await new CallAPI() .PostData(request, "/placement/noti/profile", { @@ -1029,6 +1033,8 @@ export class KpiUserEvaluationController extends Controller { const before = structuredClone(kpiUserEvaluation); let _null: any = null; kpiUserEvaluation.reasonReject = _null; + kpiUserEvaluation.actorReject = _null; + kpiUserEvaluation.actorNameReject = _null; kpiUserEvaluation.evaluationStatus = requestBody.status.trim().toUpperCase(); kpiUserEvaluation.lastUpdateUserId = request.user.sub; kpiUserEvaluation.lastUpdateFullName = request.user.name; @@ -1077,6 +1083,8 @@ export class KpiUserEvaluationController extends Controller { const before = structuredClone(kpiUserEvaluation); kpiUserEvaluation.evaluationStatus = "NEW"; kpiUserEvaluation.reasonReject = requestBody.reason; + kpiUserEvaluation.actorReject = requestBody.actor; + kpiUserEvaluation.actorNameReject = request.user.name; kpiUserEvaluation.lastUpdateUserId = request.user.sub; kpiUserEvaluation.lastUpdateFullName = request.user.name; kpiUserEvaluation.lastUpdatedAt = new Date(); @@ -1139,6 +1147,8 @@ export class KpiUserEvaluationController extends Controller { kpiUserEvaluation.isReasonCommander = _null; kpiUserEvaluation.reasonCommander = _null; kpiUserEvaluation.reasonReject = requestBody.reason; + kpiUserEvaluation.actorReject = requestBody.actor; + kpiUserEvaluation.actorNameReject = request.user.name; kpiUserEvaluation.lastUpdateUserId = request.user.sub; kpiUserEvaluation.lastUpdateFullName = request.user.name; kpiUserEvaluation.lastUpdatedAt = new Date(); @@ -1269,6 +1279,8 @@ export class KpiUserEvaluationController extends Controller { child3: kpiUserEvaluation.child3, child4: kpiUserEvaluation.child4, reasonReject: kpiUserEvaluation.reasonReject, + actorReject: kpiUserEvaluation.actorReject, + actorNameReject: kpiUserEvaluation.actorNameReject, isReject: kpiUserEvaluation.reasonReject ? true : false, year: kpiUserEvaluation.kpiPeriod == null ? null : kpiUserEvaluation.kpiPeriod.year, durationKPI: @@ -1349,6 +1361,8 @@ export class KpiUserEvaluationController extends Controller { specialPoint: item.specialPoint, capacityPoint: item.capacityPoint, reasonReject: item.reasonReject, + actorReject: item.actorReject, + actorNameReject: item.actorNameReject, isReject: item.reasonReject ? true : false, year: item.kpiPeriod ? item.kpiPeriod.year : null, durationKPI: item.kpiPeriod ? item.kpiPeriod.durationKPI : null, @@ -1641,6 +1655,8 @@ export class KpiUserEvaluationController extends Controller { const before = null; let _null: any = null; item.reasonReject = _null; + item.actorReject = _null; + item.actorNameReject = _null; item.lastUpdateUserId = request.user.sub; item.lastUpdateFullName = request.user.name; item.lastUpdatedAt = new Date(); diff --git a/src/entities/kpiUserEvaluation.ts b/src/entities/kpiUserEvaluation.ts index 34bfdce..1541141 100644 --- a/src/entities/kpiUserEvaluation.ts +++ b/src/entities/kpiUserEvaluation.ts @@ -306,6 +306,22 @@ export class KpiUserEvaluation extends EntityBase { }) reasonReject: string; + @Column({ + nullable: true, + comment: "ตำแหน่งไม่อนุมัติ", + length: 255, + default: null, + }) + actorReject: string; + + @Column({ + nullable: true, + comment: "ชื่อไม่อนุมัติ", + length: 255, + default: null, + }) + actorNameReject: string; + @Column({ // "สถานะการประเมินผล ดังนี้ PENDING = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น", nullable: true, diff --git a/src/migration/1738145829806-Updateevaaddreject2.ts b/src/migration/1738145829806-Updateevaaddreject2.ts new file mode 100644 index 0000000..ff0d444 --- /dev/null +++ b/src/migration/1738145829806-Updateevaaddreject2.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class Updateevaaddreject21738145829806 implements MigrationInterface { + name = 'Updateevaaddreject21738145829806' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`actorReject\` varchar(255) NULL COMMENT 'ตำแหน่งไม่อนุมัติ'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`actorNameReject\` varchar(255) NULL COMMENT 'ชื่อไม่อนุมัติ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`actorNameReject\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`actorReject\``); + } + +}