เพิ่มหน่วยงาน

This commit is contained in:
Kittapath 2024-07-09 09:44:25 +07:00
parent 25fa65b3b5
commit 07ffb60d34
3 changed files with 120 additions and 0 deletions

View file

@ -300,6 +300,15 @@ export class KpiUserEvaluationController extends Controller {
kpiUserEvaluation.posTypeName = x.posTypeName;
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
kpiUserEvaluation.org = x.root;
kpiUserEvaluation.orgId = x.rootId;
kpiUserEvaluation.child1 = x.child1;
kpiUserEvaluation.child1Id = x.child1Id;
kpiUserEvaluation.child2 = x.child2;
kpiUserEvaluation.child2Id = x.child2Id;
kpiUserEvaluation.child3 = x.child3;
kpiUserEvaluation.child3Id = x.child3Id;
kpiUserEvaluation.child4 = x.child4;
kpiUserEvaluation.child4Id = x.child4Id;
})
.catch((x) => {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");
@ -317,6 +326,15 @@ export class KpiUserEvaluationController extends Controller {
kpiUserEvaluation.posTypeName = x.posTypeName;
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
kpiUserEvaluation.org = x.root;
kpiUserEvaluation.orgId = x.rootId;
kpiUserEvaluation.child1 = x.child1;
kpiUserEvaluation.child1Id = x.child1Id;
kpiUserEvaluation.child2 = x.child2;
kpiUserEvaluation.child2Id = x.child2Id;
kpiUserEvaluation.child3 = x.child3;
kpiUserEvaluation.child3Id = x.child3Id;
kpiUserEvaluation.child4 = x.child4;
kpiUserEvaluation.child4Id = x.child4Id;
})
.catch((x) => {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");

View file

@ -72,6 +72,78 @@ export class KpiUserEvaluation extends EntityBase {
})
org: string;
@Column({
nullable: true,
comment: "สังกัด",
length: 255,
default: null,
})
orgId: string;
@Column({
nullable: true,
comment: "child1",
length: 255,
default: null,
})
child1: string;
@Column({
nullable: true,
comment: "child1",
length: 255,
default: null,
})
child1Id: string;
@Column({
nullable: true,
comment: "child2",
length: 255,
default: null,
})
child2: string;
@Column({
nullable: true,
comment: "child2",
length: 255,
default: null,
})
child2Id: string;
@Column({
nullable: true,
comment: "child3",
length: 255,
default: null,
})
child3: string;
@Column({
nullable: true,
comment: "child3",
length: 255,
default: null,
})
child3Id: string;
@Column({
nullable: true,
comment: "child4",
length: 255,
default: null,
})
child4: string;
@Column({
nullable: true,
comment: "child4",
length: 255,
default: null,
})
child4Id: string;
@Column({
nullable: true,
comment: "คำนำหน้าผู้ประเมิน",

View file

@ -0,0 +1,30 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddTableKpiAddRoot1720492941912 implements MigrationInterface {
name = 'AddTableKpiAddRoot1720492941912'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`orgId\` varchar(255) NULL COMMENT 'สังกัด'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child1\` varchar(255) NULL COMMENT 'child1'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child1Id\` varchar(255) NULL COMMENT 'child1'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child2\` varchar(255) NULL COMMENT 'child2'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child2Id\` varchar(255) NULL COMMENT 'child2'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child3\` varchar(255) NULL COMMENT 'child3'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child3Id\` varchar(255) NULL COMMENT 'child3'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child4\` varchar(255) NULL COMMENT 'child4'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`child4Id\` varchar(255) NULL COMMENT 'child4'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child4Id\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child4\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child3Id\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child3\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child2Id\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child2\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child1Id\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`child1\``);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`orgId\``);
}
}