add noti and test
This commit is contained in:
parent
fd00030357
commit
7ada384b83
1 changed files with 70 additions and 0 deletions
|
|
@ -1125,6 +1125,25 @@ export class KpiUserEvaluationController extends Controller {
|
|||
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||
);
|
||||
}
|
||||
if (requestBody.status.trim().toUpperCase() == "EVALUATOR") {
|
||||
await new CallAPI()
|
||||
.PostData(request, "/placement/noti/profiles", {
|
||||
subject: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ส่งคำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้พิจารณา`,
|
||||
body: `${kpiUserEvaluation.prefix}${kpiUserEvaluation.firstName} ${kpiUserEvaluation.lastName} ส่งคำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้พิจารณา`,
|
||||
receiverUserIds: [
|
||||
{
|
||||
receiverUserId: kpiUserEvaluation.evaluatorId,
|
||||
notiLink: `${process.env.VITE_URL_USER}/KPI-evaluator/${kpiUserEvaluation.id}`,
|
||||
},
|
||||
],
|
||||
payload: "",
|
||||
isSendMail: true,
|
||||
isSendInbox: true,
|
||||
isSendNotification: true,
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {});
|
||||
}
|
||||
const before = structuredClone(kpiUserEvaluation);
|
||||
kpiUserEvaluation.evaluationReqEdit = requestBody.status.trim().toUpperCase();
|
||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||
|
|
@ -1838,6 +1857,23 @@ export class KpiUserEvaluationController extends Controller {
|
|||
item.evaluationStatus = "NEW";
|
||||
} else {
|
||||
item.evaluationReqEdit = "COMMANDER";
|
||||
await new CallAPI()
|
||||
.PostData(request, "/placement/noti/profiles", {
|
||||
subject: `${item.prefix}${item.firstName} ${item.lastName} ส่งคำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้พิจารณา`,
|
||||
body: `${item.prefix}${item.firstName} ${item.lastName} ส่งคำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้พิจารณา`,
|
||||
receiverUserIds: [
|
||||
{
|
||||
receiverUserId: item.commanderId,
|
||||
notiLink: `${process.env.VITE_URL_USER}/KPI-evaluator/${item.id}`,
|
||||
},
|
||||
],
|
||||
payload: "",
|
||||
isSendMail: true,
|
||||
isSendInbox: true,
|
||||
isSendNotification: true,
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
} else if (role == "COMMANDER") {
|
||||
|
|
@ -1847,11 +1883,45 @@ export class KpiUserEvaluationController extends Controller {
|
|||
item.evaluationStatus = "NEW";
|
||||
} else {
|
||||
item.evaluationReqEdit = "COMMANDER_HIGH";
|
||||
await new CallAPI()
|
||||
.PostData(request, "/placement/noti/profiles", {
|
||||
subject: `${item.prefix}${item.firstName} ${item.lastName} ส่งคำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้พิจารณา`,
|
||||
body: `${item.prefix}${item.firstName} ${item.lastName} ส่งคำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลให้พิจารณา`,
|
||||
receiverUserIds: [
|
||||
{
|
||||
receiverUserId: item.commanderHighId,
|
||||
notiLink: `${process.env.VITE_URL_USER}/KPI-evaluator/${item.id}`,
|
||||
},
|
||||
],
|
||||
payload: "",
|
||||
isSendMail: true,
|
||||
isSendInbox: true,
|
||||
isSendNotification: true,
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
item.evaluationReqEdit = requestBody.status.trim().toUpperCase();
|
||||
item.evaluationStatus = "NEW";
|
||||
await new CallAPI()
|
||||
.PostData(request, "/placement/noti/profiles", {
|
||||
subject: `คำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลได้รับการพิจารณาแล้ว`,
|
||||
body: `คำขออนุมัติแก้ไขข้อตกลงการประเมินผลการปฏิบัติราชการระดับบุคคลได้รับการพิจารณาแล้ว`,
|
||||
receiverUserIds: [
|
||||
{
|
||||
receiverUserId: item.profileId,
|
||||
notiLink: `${process.env.VITE_URL_USER}/KPI-evaluator/${item.id}`,
|
||||
},
|
||||
],
|
||||
payload: "",
|
||||
isSendMail: true,
|
||||
isSendInbox: true,
|
||||
isSendNotification: true,
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {});
|
||||
}
|
||||
} else {
|
||||
item.evaluationReqEdit = requestBody.status.trim().toUpperCase();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue