แก้ env
This commit is contained in:
parent
3e8175d2c5
commit
19703a4f0b
3 changed files with 123 additions and 39 deletions
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
|
|
@ -9,8 +9,8 @@ env:
|
||||||
REGISTRY: docker.frappet.com
|
REGISTRY: docker.frappet.com
|
||||||
IMAGE_NAME: ehr/bma-ehr-kpi-service
|
IMAGE_NAME: ehr/bma-ehr-kpi-service
|
||||||
DEPLOY_HOST: frappet.com
|
DEPLOY_HOST: frappet.com
|
||||||
COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
||||||
# COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-kpi
|
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-kpi
|
||||||
jobs:
|
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
|
# 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:
|
release-test:
|
||||||
|
|
|
||||||
|
|
@ -690,6 +690,33 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (requestBody.status.trim().toUpperCase() == "NEW_EVALUATOR") {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ส่งข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้อนุมัติ`,
|
||||||
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ส่งข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้อนุมัติ`,
|
||||||
|
receiverUserId: kpiUserEvaluation.evaluatorId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
|
} else if (requestBody.status.trim().toUpperCase() == "EVALUATING_EVALUATOR") {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} สรุปการประเมินผลการปฏิบัติราชการระดับบุคคล`,
|
||||||
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} สรุปการประเมินผลการปฏิบัติราชการระดับบุคคล`,
|
||||||
|
receiverUserId: kpiUserEvaluation.evaluatorId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
|
}
|
||||||
kpiUserEvaluation.evaluationStatus = requestBody.status.trim().toUpperCase();
|
kpiUserEvaluation.evaluationStatus = requestBody.status.trim().toUpperCase();
|
||||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||||
|
|
@ -890,6 +917,18 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
if (item.commanderId == null || item.commanderId == "") {
|
if (item.commanderId == null || item.commanderId == "") {
|
||||||
item.evaluationStatus = "APPROVE";
|
item.evaluationStatus = "APPROVE";
|
||||||
} else {
|
} else {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${item.prefix}${item.firstName} ${item.lastName} ผู้ประเมินอนุมัติข้อตกลง`,
|
||||||
|
body: `${item.prefix}${item.firstName} ${item.lastName} ผู้ประเมินอนุมัติข้อตกลง`,
|
||||||
|
receiverUserId: item.commanderId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
item.evaluationStatus = "NEW_COMMANDER";
|
item.evaluationStatus = "NEW_COMMANDER";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -898,6 +937,18 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
if (item.commanderHighId == null || item.commanderHighId == "") {
|
if (item.commanderHighId == null || item.commanderHighId == "") {
|
||||||
item.evaluationStatus = "APPROVE";
|
item.evaluationStatus = "APPROVE";
|
||||||
} else {
|
} else {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${item.prefix}${item.firstName} ${item.lastName} ผู้บังคับบัญชาเหนือขึ้นไปอนุมัติข้อตกลง`,
|
||||||
|
body: `${item.prefix}${item.firstName} ${item.lastName} ผู้บังคับบัญชาเหนือขึ้นไปอนุมัติข้อตกลง`,
|
||||||
|
receiverUserId: item.commanderHighId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
item.evaluationStatus = "NEW_COMMANDER_HIGH";
|
item.evaluationStatus = "NEW_COMMANDER_HIGH";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1131,21 +1182,32 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
}
|
}
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
if (kpiUserEvaluation.commanderId == null) {
|
if (kpiUserEvaluation.commanderId == null) {
|
||||||
kpiUserEvaluation.evaluationStatus = "COMPLETE";
|
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(request, "org/profile/assessments", {
|
.PostData(request, "placement/noti/keycloak", {
|
||||||
date: new Date(),
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
name: kpiUserEvaluation.evaluationResults,
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
point1Total: kpiUserEvaluation.weightPoint1,
|
receiverUserId: "aec26ac3-417c-4cf9-9cbe-874939f99ecc",
|
||||||
point1: kpiUserEvaluation.totalPoint1,
|
payload: "",
|
||||||
point2Total: kpiUserEvaluation.weightPoint2,
|
isSendMail: true,
|
||||||
point2: kpiUserEvaluation.totalPoint2_1 + kpiUserEvaluation.totalPoint2_2,
|
isSendInbox: true,
|
||||||
pointSumTotal: kpiUserEvaluation.summaryWeight,
|
isSendNotification: true,
|
||||||
pointSum: kpiUserEvaluation.summaryPoint,
|
|
||||||
profileId: kpiUserEvaluation.profileId,
|
|
||||||
})
|
})
|
||||||
.then(async (x) => {});
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
|
kpiUserEvaluation.evaluationStatus = "COMPLETE";
|
||||||
} else {
|
} else {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
|
receiverUserId: kpiUserEvaluation.commanderId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
kpiUserEvaluation.evaluationStatus = "SUMMARY_COMMANDER";
|
kpiUserEvaluation.evaluationStatus = "SUMMARY_COMMANDER";
|
||||||
}
|
}
|
||||||
kpiUserEvaluation.topicEvaluator =
|
kpiUserEvaluation.topicEvaluator =
|
||||||
|
|
@ -1190,21 +1252,32 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
}
|
}
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
if (kpiUserEvaluation.commanderHighId == null) {
|
if (kpiUserEvaluation.commanderHighId == null) {
|
||||||
kpiUserEvaluation.evaluationStatus = "COMPLETE";
|
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(request, "org/profile/assessments", {
|
.PostData(request, "placement/noti/keycloak", {
|
||||||
date: new Date(),
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
name: kpiUserEvaluation.evaluationResults,
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
point1Total: kpiUserEvaluation.weightPoint1,
|
receiverUserId: "aec26ac3-417c-4cf9-9cbe-874939f99ecc",
|
||||||
point1: kpiUserEvaluation.totalPoint1,
|
payload: "",
|
||||||
point2Total: kpiUserEvaluation.weightPoint2,
|
isSendMail: true,
|
||||||
point2: kpiUserEvaluation.totalPoint2_1 + kpiUserEvaluation.totalPoint2_2,
|
isSendInbox: true,
|
||||||
pointSumTotal: kpiUserEvaluation.summaryWeight,
|
isSendNotification: true,
|
||||||
pointSum: kpiUserEvaluation.summaryPoint,
|
|
||||||
profileId: kpiUserEvaluation.profileId,
|
|
||||||
})
|
})
|
||||||
.then(async (x) => {});
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
|
kpiUserEvaluation.evaluationStatus = "COMPLETE";
|
||||||
} else {
|
} else {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
|
receiverUserId: kpiUserEvaluation.commanderHighId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
kpiUserEvaluation.evaluationStatus = "SUMMARY_COMMANDER_HIGH";
|
kpiUserEvaluation.evaluationStatus = "SUMMARY_COMMANDER_HIGH";
|
||||||
}
|
}
|
||||||
kpiUserEvaluation.isReasonCommander = requestBody.isReason;
|
kpiUserEvaluation.isReasonCommander = requestBody.isReason;
|
||||||
|
|
@ -1244,18 +1317,17 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
kpiUserEvaluation.evaluationStatus = "COMPLETE";
|
kpiUserEvaluation.evaluationStatus = "COMPLETE";
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(request, "org/profile/assessments", {
|
.PostData(request, "placement/noti/keycloak", {
|
||||||
date: new Date(),
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
name: kpiUserEvaluation.evaluationResults,
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ผู้ประเมินแสดงความเห็น`,
|
||||||
point1Total: kpiUserEvaluation.weightPoint1,
|
receiverUserId: "aec26ac3-417c-4cf9-9cbe-874939f99ecc",
|
||||||
point1: kpiUserEvaluation.totalPoint1,
|
payload: "",
|
||||||
point2Total: kpiUserEvaluation.weightPoint2,
|
isSendMail: true,
|
||||||
point2: kpiUserEvaluation.totalPoint2_1 + kpiUserEvaluation.totalPoint2_2,
|
isSendInbox: true,
|
||||||
pointSumTotal: kpiUserEvaluation.summaryWeight,
|
isSendNotification: true,
|
||||||
pointSum: kpiUserEvaluation.summaryPoint,
|
|
||||||
profileId: kpiUserEvaluation.profileId,
|
|
||||||
})
|
})
|
||||||
.then(async (x) => {});
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
kpiUserEvaluation.isReasonCommanderHigh = requestBody.isReason;
|
kpiUserEvaluation.isReasonCommanderHigh = requestBody.isReason;
|
||||||
kpiUserEvaluation.reasonCommanderHigh = requestBody.reason == null ? _null : requestBody.reason;
|
kpiUserEvaluation.reasonCommanderHigh = requestBody.reason == null ? _null : requestBody.reason;
|
||||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||||
|
|
@ -1298,6 +1370,18 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
profileId: kpiUserEvaluation.profileId,
|
profileId: kpiUserEvaluation.profileId,
|
||||||
})
|
})
|
||||||
.then(async (x) => {});
|
.then(async (x) => {});
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "placement/noti/profile", {
|
||||||
|
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ระดับผลการประเมินการปฏิบัติราชการระดับบุคคลของคุณอยู่ในเกณฑ์ ${kpiUserEvaluation.summaryPoint}`,
|
||||||
|
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ระดับผลการประเมินการปฏิบัติราชการระดับบุคคลของคุณอยู่ในเกณฑ์ ${kpiUserEvaluation.summaryPoint}`,
|
||||||
|
receiverUserId: kpiUserEvaluation.profileId,
|
||||||
|
payload: "",
|
||||||
|
isSendMail: true,
|
||||||
|
isSendInbox: true,
|
||||||
|
isSendNotification: true,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||||
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class CallAPI {
|
||||||
//Get
|
//Get
|
||||||
public async GetData(request: any, @Path() path: any) {
|
public async GetData(request: any, @Path() path: any) {
|
||||||
const token = request.headers.authorization;
|
const token = request.headers.authorization;
|
||||||
const url = process.env.API + path;
|
const url = process.env.API_URL + path;
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(url, {
|
const response = await axios.get(url, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -33,7 +33,7 @@ class CallAPI {
|
||||||
//Post
|
//Post
|
||||||
public async PostData(request: any, @Path() path: any, sendData: any) {
|
public async PostData(request: any, @Path() path: any, sendData: any) {
|
||||||
const token = request.headers.authorization;
|
const token = request.headers.authorization;
|
||||||
const url = process.env.API + path;
|
const url = process.env.API_URL + path;
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(url, sendData, {
|
const response = await axios.post(url, sendData, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue