From c57553e044a46d6bcf2a71181e1018d8907c5f61 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Mon, 17 Mar 2025 10:08:23 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1dna?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/EvaluationController.ts | 30 +++++++++--------- src/entities/Evaluation.ts | 42 ++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/src/controllers/EvaluationController.ts b/src/controllers/EvaluationController.ts index 16ca3a3..11a94e7 100644 --- a/src/controllers/EvaluationController.ts +++ b/src/controllers/EvaluationController.ts @@ -96,8 +96,8 @@ export class EvaluationController { .andWhere( _data.root != undefined && _data.root != null ? _data.root[0] != null - ? `evaluation.rootId IN (:...root)` - : `evaluation.rootId is null` + ? `evaluation.rootDnaId IN (:...root)` + : `evaluation.rootDnaId is null` : "1=1", { root: _data.root, @@ -106,8 +106,8 @@ export class EvaluationController { .andWhere( _data.child1 != undefined && _data.child1 != null ? _data.child1[0] != null - ? `evaluation.child1Id IN (:...child1)` - : `evaluation.child1Id is null` + ? `evaluation.child1DnaId IN (:...child1)` + : `evaluation.child1DnaId is null` : "1=1", { child1: _data.child1, @@ -116,8 +116,8 @@ export class EvaluationController { .andWhere( _data.child2 != undefined && _data.child2 != null ? _data.child2[0] != null - ? `evaluation.child2Id IN (:...child2)` - : `evaluation.child2Id is null` + ? `evaluation.child2DnaId IN (:...child2)` + : `evaluation.child2DnaId is null` : "1=1", { child2: _data.child2, @@ -126,8 +126,8 @@ export class EvaluationController { .andWhere( _data.child3 != undefined && _data.child3 != null ? _data.child3[0] != null - ? `evaluation.child3Id IN (:...child3)` - : `evaluation.child3Id is null` + ? `evaluation.child3DnaId IN (:...child3)` + : `evaluation.child3DnaId is null` : "1=1", { child3: _data.child3, @@ -136,8 +136,8 @@ export class EvaluationController { .andWhere( _data.child4 != undefined && _data.child4 != null ? _data.child4[0] != null - ? `evaluation.child4Id IN (:...child4)` - : `evaluation.child4Id is null` + ? `evaluation.child4DnaId IN (:...child4)` + : `evaluation.child4DnaId is null` : "1=1", { child4: _data.child4, @@ -634,11 +634,11 @@ export class EvaluationController { .GetData(request, `/org/profile/keycloak/commander/${request.user.sub}`) .then(async (x) => { org = x.org; - evaluation.rootId = x.rootId; - evaluation.child1Id = x.child1Id; - evaluation.child2Id = x.child2Id; - evaluation.child3Id = x.child3Id; - evaluation.child4Id = x.child4Id; + evaluation.rootDnaId = x.rootDnaId; + evaluation.child1DnaId = x.child1DnaId; + evaluation.child2DnaId = x.child2DnaId; + evaluation.child3DnaId = x.child3DnaId; + evaluation.child4DnaId = x.child4DnaId; }) .catch(); //Evaluation diff --git a/src/entities/Evaluation.ts b/src/entities/Evaluation.ts index 5c5f12d..d6fb4c8 100644 --- a/src/entities/Evaluation.ts +++ b/src/entities/Evaluation.ts @@ -79,6 +79,46 @@ export class Evaluation extends EntityBase { }) child4Id: string; + @Column({ + nullable: true, + comment: "Dna root", + length: 255, + default: null, + }) + rootDnaId: string; + + @Column({ + nullable: true, + comment: "Dna child1", + length: 255, + default: null, + }) + child1DnaId: string; + + @Column({ + nullable: true, + comment: "Dna child2", + length: 255, + default: null, + }) + child2DnaId: string; + + @Column({ + nullable: true, + comment: "Dna child3", + length: 255, + default: null, + }) + child3DnaId: string; + + @Column({ + nullable: true, + comment: "Dna child4", + length: 255, + default: null, + }) + child4DnaId: string; + @Column({ nullable: true, comment: "เงินเดือนปัจจุบัน" }) salary: string; @@ -192,7 +232,7 @@ export class Evaluation extends EntityBase { @Column({ nullable: true, comment: "ตำแหน่งที่ได้รับมอบหมาย" }) assignedPosition: string; - @Column({ nullable: true, comment: "ผลการประเมิน", default: "PENDING" })//PENDING,PASS,NOTPASS + @Column({ nullable: true, comment: "ผลการประเมิน", default: "PENDING" }) //PENDING,PASS,NOTPASS evaluationResult: string; @OneToMany(() => EvaluationLogs, (evaluationLogs) => evaluationLogs.evaluation) From ce25a2ede13d402a0c2fa8f0da255fbcf7693385 Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 18 Mar 2025 10:25:57 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=AA=E0=B8=A3?= =?UTF-8?q?=E0=B8=B8=E0=B8=9B=E0=B8=88=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99?= =?UTF-8?q?=E0=B8=9C=E0=B8=A5=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=20(test)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index ed38751..4b4f911 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -60,7 +60,7 @@ export class ReoportController { @Get() async sumaryEvaluationReport( @Query("year") year?: string, - @Query("rootid") rootId?: string, + @Query("rootId") rootId?: string, @Query("nameOrg") nameOrg?: string, ) { try { @@ -77,6 +77,7 @@ export class ReoportController { year: yearInBE, }) .andWhere("evaluation.orgRootId = :rootId", { rootId: rootId }) + // .andWhere("evaluation.rootDnaId = :rootId", { rootId: rootId }) .andWhere("evaluation.step = :step", { step: "DONE" }) .getMany(); From bbf28f9d2ddc1ab87ba1b6f12a831756f8334596 Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 18 Mar 2025 11:32:47 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=AA=E0=B8=A3?= =?UTF-8?q?=E0=B8=B8=E0=B8=9B=E0=B8=88=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99?= =?UTF-8?q?=E0=B8=9C=E0=B8=A5=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/EvaluationController.ts | 11 +++++++++- src/controllers/ReportController.ts | 3 +-- src/entities/Evaluation.ts | 28 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/controllers/EvaluationController.ts b/src/controllers/EvaluationController.ts index 11a94e7..90a1f61 100644 --- a/src/controllers/EvaluationController.ts +++ b/src/controllers/EvaluationController.ts @@ -444,7 +444,16 @@ export class EvaluationController { } const before = null; - + await new CallAPI() + .GetData(request, `/org/profile/keycloak/commander/${request.user.sub}`) + .then(async (x) => { + evaluation.rootDnaId = x.rootDnaId; + evaluation.child1DnaId = x.child1DnaId; + evaluation.child2DnaId = x.child2DnaId; + evaluation.child3DnaId = x.child3DnaId; + evaluation.child4DnaId = x.child4DnaId; + }) + .catch(); evaluation.step = "PREPARE_DOC_V1"; evaluation.type = requestBody.type == "EXPERT" ? "EXPERT" : "SPECIAL_EXPERT"; evaluation.fullName = requestBody.fullName; diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 4b4f911..ae46f30 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -76,8 +76,7 @@ export class ReoportController { .andWhere(yearInBE && yearInBE != null ? "YEAR(createdAt) = :year" : "1=1", { year: yearInBE, }) - .andWhere("evaluation.orgRootId = :rootId", { rootId: rootId }) - // .andWhere("evaluation.rootDnaId = :rootId", { rootId: rootId }) + .andWhere("evaluation.rootDnaId = :rootId", { rootId: rootId }) .andWhere("evaluation.step = :step", { step: "DONE" }) .getMany(); diff --git a/src/entities/Evaluation.ts b/src/entities/Evaluation.ts index d6fb4c8..0d7c953 100644 --- a/src/entities/Evaluation.ts +++ b/src/entities/Evaluation.ts @@ -526,6 +526,34 @@ export class CreateEvaluationExpertise { @Column() oc?: string | null; + + @Column() + citizenId?: string | null; + + @Column() + prefix?: string | null; + + @Column() + fullName?: string | null; + + @Column() + position?: string | null; + + @Column() + salary?: string | null; + + @Column() + positionLevel?: string | null; + + @Column() + posNo?: string | null; + + @Column() + birthDate?: string | null; + + @Column() + govAge?: string | null; + } export type UpdateEvaluation = Partial;