ประวัติ reject
This commit is contained in:
parent
6f1b3f9216
commit
e2f3234e2d
4 changed files with 136 additions and 2 deletions
|
|
@ -1048,7 +1048,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
@Put("reject-agreement/{id}")
|
||||
async updateKpiUserStatusRejectAgreementEvaluation(
|
||||
@Path() id: string,
|
||||
@Body() requestBody: { reason: string },
|
||||
@Body() requestBody: { reason: string; actor: string },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({
|
||||
|
|
@ -1081,7 +1081,11 @@ export class KpiUserEvaluationController extends Controller {
|
|||
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||
kpiUserEvaluation.lastUpdatedAt = new Date();
|
||||
let kpiReject = {
|
||||
kpiUserEvaluationId: kpiUserEvaluation.id,
|
||||
reason: requestBody.reason,
|
||||
actor: requestBody.actor,
|
||||
fullname: `${kpiUserEvaluation.prefixEvaluator}${kpiUserEvaluation.firstNameEvaluator} ${kpiUserEvaluation.lastNameEvaluator}`,
|
||||
profileId: kpiUserEvaluation.evaluatorId,
|
||||
createdUserId: request.user.sub,
|
||||
createdFullName: request.user.name,
|
||||
lastUpdateUserId: request.user.sub,
|
||||
|
|
@ -1105,7 +1109,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
@Put("reject-result/{id}")
|
||||
async updateKpiUserStatusRejectResultEvaluation(
|
||||
@Path() id: string,
|
||||
@Body() requestBody: { reason: string },
|
||||
@Body() requestBody: { reason: string; actor: string },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({
|
||||
|
|
@ -1131,12 +1135,19 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.catch(() => {});
|
||||
const before = structuredClone(kpiUserEvaluation);
|
||||
kpiUserEvaluation.evaluationStatus = "EVALUATING_EVALUATOR";
|
||||
let _null: any = null;
|
||||
kpiUserEvaluation.isReasonCommander = _null;
|
||||
kpiUserEvaluation.reasonCommander = _null;
|
||||
kpiUserEvaluation.reasonReject = requestBody.reason;
|
||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||
kpiUserEvaluation.lastUpdatedAt = new Date();
|
||||
let kpiReject = {
|
||||
kpiUserEvaluationId: kpiUserEvaluation.id,
|
||||
reason: requestBody.reason,
|
||||
actor: requestBody.actor,
|
||||
fullname: `${kpiUserEvaluation.prefixEvaluator}${kpiUserEvaluation.firstNameEvaluator} ${kpiUserEvaluation.lastNameEvaluator}`,
|
||||
profileId: kpiUserEvaluation.evaluatorId,
|
||||
createdUserId: request.user.sub,
|
||||
createdFullName: request.user.name,
|
||||
lastUpdateUserId: request.user.sub,
|
||||
|
|
@ -1150,6 +1161,61 @@ export class KpiUserEvaluationController extends Controller {
|
|||
return new HttpSuccess(kpiUserEvaluation.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* API แก้ไขสถานะประเมิน (USER)
|
||||
*
|
||||
* @summary แก้ไขคนประเมิน (USER)
|
||||
*
|
||||
* @param {string} id Guid, *Id คนประเมิน (USER)
|
||||
*/
|
||||
@Get("reject-agreement/{id}")
|
||||
async listKpiUserStatusRejectAgreementEvaluation(
|
||||
@Path() id: string,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserRejectAgreements"],
|
||||
order: { kpiUserRejectAgreements: { createdAt: "ASC" } },
|
||||
});
|
||||
if (!kpiUserEvaluation) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||
);
|
||||
}
|
||||
kpiUserEvaluation.kpiUserRejectAgreements;
|
||||
return new HttpSuccess(kpiUserEvaluation.kpiUserRejectAgreements);
|
||||
}
|
||||
|
||||
/**
|
||||
* API แก้ไขสถานะประเมิน (USER)
|
||||
*
|
||||
* @summary แก้ไขคนประเมิน (USER)
|
||||
*
|
||||
* @param {string} id Guid, *Id คนประเมิน (USER)
|
||||
*/
|
||||
@Get("reject-result/{id}")
|
||||
async listKpiUserStatusRejectResultEvaluation(
|
||||
@Path() id: string,
|
||||
@Body() requestBody: { reason: string },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserRejectResults"],
|
||||
order: { kpiUserRejectResults: { createdAt: "ASC" } },
|
||||
});
|
||||
if (!kpiUserEvaluation) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||
);
|
||||
}
|
||||
kpiUserEvaluation.kpiUserRejectResults;
|
||||
return new HttpSuccess(kpiUserEvaluation.kpiUserRejectResults);
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการประเมินผลการปฏิบัติราชการระดับบุคคล (USER)
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue