แก้env

This commit is contained in:
Kittapath 2024-07-09 00:03:47 +07:00
parent 01cf95e407
commit 25fa65b3b5
4 changed files with 63 additions and 3 deletions

View file

@ -9,7 +9,8 @@ env:
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-kpi-service
DEPLOY_HOST: frappet.com
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-kpi
COMPOSE_PATH: /home/frappet/docker/bma-ehr
# COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-kpi
jobs:
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-test:

View file

@ -1234,6 +1234,49 @@ export class KpiUserEvaluationController extends Controller {
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
return new HttpSuccess(kpiUserEvaluation.id);
}
/**
* API kp7 (USER)
*
* @summary kp7 (USER)
*
* @param {string} id Guid, *Id (USER)
*/
@Post("done/kp7")
async updateKpiEvaluationTokp7(
@Body()
requestBody: {
id: string[];
},
@Request() request: { user: Record<string, any> },
) {
const kpiUserEvaluations = await this.kpiUserEvalutionRepository.find({
where: { id: In(requestBody.id) },
});
Promise.all(
kpiUserEvaluations.map(async (kpiUserEvaluation) => {
kpiUserEvaluation.evaluationStatus = "KP7";
await new CallAPI()
.PostData(request, "org/profile/assessments", {
date: new Date(),
name: kpiUserEvaluation.evaluationResults,
point1Total: kpiUserEvaluation.weightPoint1,
point1: kpiUserEvaluation.totalPoint1,
point2Total: kpiUserEvaluation.weightPoint2,
point2: kpiUserEvaluation.totalPoint2_1 + kpiUserEvaluation.totalPoint2_2,
pointSumTotal: kpiUserEvaluation.summaryWeight,
pointSum: kpiUserEvaluation.summaryPoint,
profileId: kpiUserEvaluation.profileId,
})
.then(async (x) => {});
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
kpiUserEvaluation.lastUpdateFullName = request.user.name;
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
}),
);
return new HttpSuccess();
}
/**
* API (USER)

View file

@ -311,7 +311,7 @@ export class KpiUserEvaluation extends EntityBase {
@Column({
nullable: true,
comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป",
default: false,
default: null,
})
isReasonCommander: boolean;
@ -326,7 +326,7 @@ export class KpiUserEvaluation extends EntityBase {
@Column({
nullable: true,
comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
default: false,
default: null,
})
isReasonCommanderHigh: boolean;

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddTableKpiAddBool1720326486719 implements MigrationInterface {
name = 'AddTableKpiAddBool1720326486719'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` CHANGE \`isReasonCommander\` \`isReasonCommander\` tinyint NULL COMMENT 'หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` CHANGE \`isReasonCommanderHigh\` \`isReasonCommanderHigh\` tinyint NULL COMMENT 'หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` CHANGE \`isReasonCommanderHigh\` \`isReasonCommanderHigh\` tinyint NULL COMMENT 'หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` CHANGE \`isReasonCommander\` \`isReasonCommander\` tinyint NULL COMMENT 'หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป' DEFAULT '0'`);
}
}