Merge branch 'develop' into adiDev
This commit is contained in:
commit
aa0270ffe1
3 changed files with 53 additions and 5 deletions
|
|
@ -202,6 +202,7 @@ export class KpiUserCapacityController extends Controller {
|
||||||
const [kpiUserCapacity, total] = await AppDataSource.getRepository(KpiUserCapacity)
|
const [kpiUserCapacity, total] = await AppDataSource.getRepository(KpiUserCapacity)
|
||||||
.createQueryBuilder("kpiUserCapacity")
|
.createQueryBuilder("kpiUserCapacity")
|
||||||
.leftJoinAndSelect("kpiUserCapacity.kpiCapacity", "kpiCapacity")
|
.leftJoinAndSelect("kpiUserCapacity.kpiCapacity", "kpiCapacity")
|
||||||
|
.leftJoinAndSelect("kpiCapacity.kpiCapacityDetails", "kpiCapacityDetails")
|
||||||
.andWhere("kpiUserCapacity.kpiUserEvaluationId = :id", { id: id })
|
.andWhere("kpiUserCapacity.kpiUserEvaluationId = :id", { id: id })
|
||||||
.andWhere(type ? "kpiCapacity.type LIKE :type" : "1=1", { type: type.toLocaleUpperCase() })
|
.andWhere(type ? "kpiCapacity.type LIKE :type" : "1=1", { type: type.toLocaleUpperCase() })
|
||||||
.orderBy("kpiUserCapacity.createdAt", "ASC")
|
.orderBy("kpiUserCapacity.createdAt", "ASC")
|
||||||
|
|
@ -214,6 +215,7 @@ export class KpiUserCapacityController extends Controller {
|
||||||
point: item.point,
|
point: item.point,
|
||||||
weight: item.weight,
|
weight: item.weight,
|
||||||
summary: item.summary,
|
summary: item.summary,
|
||||||
|
achievement: item.kpiCapacity.kpiCapacityDetails,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return new HttpSuccess({ data: mapData, total });
|
return new HttpSuccess({ data: mapData, total });
|
||||||
|
|
|
||||||
|
|
@ -156,13 +156,37 @@ export class KpiUserEvaluation extends EntityBase {
|
||||||
})
|
})
|
||||||
capacityPoint: number;
|
capacityPoint: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: "double",
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
comment: "คะแนนประเมินองค์ประกอบที่ 1",
|
||||||
|
})
|
||||||
|
totalPoint1: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: "double",
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
comment: "คะแนนประเมินองค์ประกอบที่ 2.1",
|
||||||
|
})
|
||||||
|
totalPoint2_1: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: "double",
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
comment: "คะแนนประเมินองค์ประกอบที่ 2.2",
|
||||||
|
})
|
||||||
|
totalPoint2_2: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: "double",
|
type: "double",
|
||||||
nullable: true,
|
nullable: true,
|
||||||
default: null,
|
default: null,
|
||||||
comment: "คะแนนประเมิน",
|
comment: "คะแนนประเมิน",
|
||||||
})
|
})
|
||||||
totalPoint: number;
|
summaryPoint: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -251,13 +275,13 @@ export class updateKpiUserCheckEvaluation {
|
||||||
|
|
||||||
export class updateKpiUserPointEvaluation {
|
export class updateKpiUserPointEvaluation {
|
||||||
@Column()
|
@Column()
|
||||||
plannedPoint: number | null;
|
totalPoint1?: number | null;
|
||||||
@Column()
|
@Column()
|
||||||
rolePoint: number | null;
|
totalPoint2_1?: number | null;
|
||||||
@Column()
|
@Column()
|
||||||
specialPoint: number | null;
|
totalPoint2_2?: number | null;
|
||||||
@Column()
|
@Column()
|
||||||
capacityPoint: number | null;
|
summaryPoint?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class updateKpiUserReqEditEvaluation {
|
export class updateKpiUserReqEditEvaluation {
|
||||||
|
|
|
||||||
22
src/migration/1718780152397-update_table_kpi_add_point.ts
Normal file
22
src/migration/1718780152397-update_table_kpi_add_point.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableKpiAddPoint1718780152397 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableKpiAddPoint1718780152397'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`totalPoint\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`totalPoint1\` double NULL COMMENT 'คะแนนประเมินองค์ประกอบที่ 1'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`totalPoint2_1\` double NULL COMMENT 'คะแนนประเมินองค์ประกอบที่ 2.1'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`totalPoint2_2\` double NULL COMMENT 'คะแนนประเมินองค์ประกอบที่ 2.2'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`summaryPoint\` double NULL COMMENT 'คะแนนประเมิน'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`summaryPoint\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`totalPoint2_2\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`totalPoint2_1\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`totalPoint1\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`totalPoint\` double NULL COMMENT 'คะแนนประเมิน'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue