no message

This commit is contained in:
kittapath 2025-01-29 17:18:25 +07:00
parent ae9fd6aa33
commit 724e7c705c
3 changed files with 48 additions and 0 deletions

View file

@ -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();

View file

@ -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,

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Updateevaaddreject21738145829806 implements MigrationInterface {
name = 'Updateevaaddreject21738145829806'
public async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`actorNameReject\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`actorReject\``);
}
}