แก้env
This commit is contained in:
parent
01cf95e407
commit
25fa65b3b5
4 changed files with 63 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue