Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2024-05-08 17:06:52 +07:00
commit 46e23f619c
6 changed files with 62 additions and 28 deletions

View file

@ -94,14 +94,6 @@ export class KpiUserRoleController extends Controller {
kpiUserRole.createdFullName = request.user.name;
kpiUserRole.lastUpdateUserId = request.user.sub;
kpiUserRole.lastUpdateFullName = request.user.name;
kpiUserRole.documentInfoEvidence = request.user.documentInfoEvidence;
kpiUserRole.startDate = request.user.startDate;
kpiUserRole.endDate = request.user.endDate;
kpiUserRole.achievement1 = request.user.achievement1;
kpiUserRole.achievement2 = request.user.achievement2;
kpiUserRole.achievement3 = request.user.achievement3;
kpiUserRole.achievement4 = request.user.achievement4;
kpiUserRole.achievement5 = request.user.achievement5;
await this.kpiUserRoleRepository.save(kpiUserRole);
return new HttpSuccess(kpiUserRole.id);
}
@ -156,14 +148,6 @@ export class KpiUserRoleController extends Controller {
kpiUserRole.lastUpdateUserId = request.user.sub;
kpiUserRole.lastUpdateFullName = request.user.name;
kpiUserRole.documentInfoEvidence = request.user.documentInfoEvidence;
kpiUserRole.startDate = request.user.startDate;
kpiUserRole.endDate = request.user.endDate;
kpiUserRole.achievement1 = request.user.achievement1;
kpiUserRole.achievement2 = request.user.achievement2;
kpiUserRole.achievement3 = request.user.achievement3;
kpiUserRole.achievement4 = request.user.achievement4;
kpiUserRole.achievement5 = request.user.achievement5;
this.kpiUserRoleRepository.merge(kpiUserRole, requestBody);
await this.kpiUserRoleRepository.save(kpiUserRole);
return new HttpSuccess(kpiUserRole.id);

View file

@ -84,13 +84,13 @@ export class KpiUserSpecialController extends Controller {
"ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ",
);
}
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
where: {
including: String(requestBody.including),
includingName: String(requestBody.includingName)
includingName: String(requestBody.includingName),
},
});
if(!chk_kpiSpecial){
if (!chk_kpiSpecial) {
const kpiSpecial = Object.assign(new KpiSpecial(), requestBody);
if (!kpiSpecial) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
@ -105,9 +105,6 @@ export class KpiUserSpecialController extends Controller {
kpiUserSpecial.createdFullName = request.user.name;
kpiUserSpecial.lastUpdateUserId = request.user.sub;
kpiUserSpecial.lastUpdateFullName = request.user.name;
kpiUserSpecial.documentInfoEvidence = request.user.documentInfoEvidence;
kpiUserSpecial.startDate = request.user.startDate;
kpiUserSpecial.endDate = request.user.endDate;
await this.kpiUserSpecialRepository.save(kpiUserSpecial);
return new HttpSuccess(kpiUserSpecial.id);
}
@ -156,13 +153,13 @@ export class KpiUserSpecialController extends Controller {
"ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ",
);
}
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
where: {
including: String(requestBody.including),
includingName: String(requestBody.includingName)
includingName: String(requestBody.includingName),
},
});
if(!chk_kpiSpecial){
if (!chk_kpiSpecial) {
const kpiSpecial = Object.assign(new KpiSpecial(), requestBody);
if (!kpiSpecial) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
@ -175,9 +172,6 @@ export class KpiUserSpecialController extends Controller {
}
kpiUserSpecial.lastUpdateUserId = request.user.sub;
kpiUserSpecial.lastUpdateFullName = request.user.name;
kpiUserSpecial.documentInfoEvidence = request.user.documentInfoEvidence;
kpiUserSpecial.startDate = request.user.startDate;
kpiUserSpecial.endDate = request.user.endDate;
Object.assign(kpiUserSpecial, requestBody);
await this.kpiUserSpecialRepository.save(kpiUserSpecial);
return new HttpSuccess(kpiUserSpecial.id);

View file

@ -47,6 +47,24 @@ export class KpiUserDevelopment extends EntityBase {
})
achievement0: string;
@Column({
comment: "วิธีพัฒนา70",
default: false,
})
isDevelopment70: boolean;
@Column({
comment: "วิธีพัฒนา20",
default: false,
})
isDevelopment20: boolean;
@Column({
comment: "วิธีพัฒนา10",
default: false,
})
isDevelopment10: boolean;
@Column({
nullable: true,
length: 40,

View file

@ -85,6 +85,12 @@ export class KpiUserEvaluation extends EntityBase {
})
evaluationResults: string;
@Column({
comment: "คำขอแก้ไข",
default: false,
})
isReqEdit: boolean;
@Column({
type: "double",
nullable: true,

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableKpiUserEvaluationAddIsReqEdit1715161033009 implements MigrationInterface {
name = 'UpdateTableKpiUserEvaluationAddIsReqEdit1715161033009'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`isReqEdit\` tinyint NOT NULL COMMENT 'คำขอแก้ไข' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`isReqEdit\``);
}
}

View file

@ -0,0 +1,18 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableKpiUserEvaluationAddIsReqEdit11715161401755 implements MigrationInterface {
name = 'UpdateTableKpiUserEvaluationAddIsReqEdit11715161401755'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` ADD \`isDevelopment70\` tinyint NOT NULL COMMENT 'วิธีพัฒนา70' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` ADD \`isDevelopment20\` tinyint NOT NULL COMMENT 'วิธีพัฒนา20' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` ADD \`isDevelopment10\` tinyint NOT NULL COMMENT 'วิธีพัฒนา10' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` DROP COLUMN \`isDevelopment10\``);
await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` DROP COLUMN \`isDevelopment20\``);
await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` DROP COLUMN \`isDevelopment70\``);
}
}