Merge branch 'develop' into adiDev
This commit is contained in:
commit
46e23f619c
6 changed files with 62 additions and 28 deletions
|
|
@ -94,14 +94,6 @@ export class KpiUserRoleController extends Controller {
|
||||||
kpiUserRole.createdFullName = request.user.name;
|
kpiUserRole.createdFullName = request.user.name;
|
||||||
kpiUserRole.lastUpdateUserId = request.user.sub;
|
kpiUserRole.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserRole.lastUpdateFullName = request.user.name;
|
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);
|
await this.kpiUserRoleRepository.save(kpiUserRole);
|
||||||
return new HttpSuccess(kpiUserRole.id);
|
return new HttpSuccess(kpiUserRole.id);
|
||||||
}
|
}
|
||||||
|
|
@ -156,14 +148,6 @@ export class KpiUserRoleController extends Controller {
|
||||||
|
|
||||||
kpiUserRole.lastUpdateUserId = request.user.sub;
|
kpiUserRole.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserRole.lastUpdateFullName = request.user.name;
|
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);
|
this.kpiUserRoleRepository.merge(kpiUserRole, requestBody);
|
||||||
await this.kpiUserRoleRepository.save(kpiUserRole);
|
await this.kpiUserRoleRepository.save(kpiUserRole);
|
||||||
return new HttpSuccess(kpiUserRole.id);
|
return new HttpSuccess(kpiUserRole.id);
|
||||||
|
|
|
||||||
|
|
@ -84,13 +84,13 @@ export class KpiUserSpecialController extends Controller {
|
||||||
"ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ",
|
"ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
|
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
including: String(requestBody.including),
|
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);
|
const kpiSpecial = Object.assign(new KpiSpecial(), requestBody);
|
||||||
if (!kpiSpecial) {
|
if (!kpiSpecial) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
@ -105,9 +105,6 @@ export class KpiUserSpecialController extends Controller {
|
||||||
kpiUserSpecial.createdFullName = request.user.name;
|
kpiUserSpecial.createdFullName = request.user.name;
|
||||||
kpiUserSpecial.lastUpdateUserId = request.user.sub;
|
kpiUserSpecial.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserSpecial.lastUpdateFullName = request.user.name;
|
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);
|
await this.kpiUserSpecialRepository.save(kpiUserSpecial);
|
||||||
return new HttpSuccess(kpiUserSpecial.id);
|
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: {
|
where: {
|
||||||
including: String(requestBody.including),
|
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);
|
const kpiSpecial = Object.assign(new KpiSpecial(), requestBody);
|
||||||
if (!kpiSpecial) {
|
if (!kpiSpecial) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
@ -175,9 +172,6 @@ export class KpiUserSpecialController extends Controller {
|
||||||
}
|
}
|
||||||
kpiUserSpecial.lastUpdateUserId = request.user.sub;
|
kpiUserSpecial.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserSpecial.lastUpdateFullName = request.user.name;
|
kpiUserSpecial.lastUpdateFullName = request.user.name;
|
||||||
kpiUserSpecial.documentInfoEvidence = request.user.documentInfoEvidence;
|
|
||||||
kpiUserSpecial.startDate = request.user.startDate;
|
|
||||||
kpiUserSpecial.endDate = request.user.endDate;
|
|
||||||
Object.assign(kpiUserSpecial, requestBody);
|
Object.assign(kpiUserSpecial, requestBody);
|
||||||
await this.kpiUserSpecialRepository.save(kpiUserSpecial);
|
await this.kpiUserSpecialRepository.save(kpiUserSpecial);
|
||||||
return new HttpSuccess(kpiUserSpecial.id);
|
return new HttpSuccess(kpiUserSpecial.id);
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,24 @@ export class KpiUserDevelopment extends EntityBase {
|
||||||
})
|
})
|
||||||
achievement0: string;
|
achievement0: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "วิธีพัฒนา70",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isDevelopment70: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "วิธีพัฒนา20",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isDevelopment20: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "วิธีพัฒนา10",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isDevelopment10: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 40,
|
length: 40,
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,12 @@ export class KpiUserEvaluation extends EntityBase {
|
||||||
})
|
})
|
||||||
evaluationResults: string;
|
evaluationResults: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "คำขอแก้ไข",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isReqEdit: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: "double",
|
type: "double",
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
|
||||||
|
|
@ -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\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue