แก้สถานะผลประเมิน
This commit is contained in:
parent
e43feb4964
commit
dddb53ae7f
2 changed files with 35 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ import {
|
||||||
updateKpiUserPointEvaluation,
|
updateKpiUserPointEvaluation,
|
||||||
updateKpiUserStatusEvaluation,
|
updateKpiUserStatusEvaluation,
|
||||||
updateKpiUserReqEditEvaluation,
|
updateKpiUserReqEditEvaluation,
|
||||||
|
updateKpiUserResultEvaluation,
|
||||||
} from "../entities/kpiUserEvaluation";
|
} from "../entities/kpiUserEvaluation";
|
||||||
import { Like, In, Brackets } from "typeorm";
|
import { Like, In, Brackets } from "typeorm";
|
||||||
import CallAPI from "../interfaces/call-api";
|
import CallAPI from "../interfaces/call-api";
|
||||||
|
|
@ -316,7 +317,35 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
kpiUserEvaluation.evaluationReqEdit = requestBody.status.trim().toUpperCase();
|
kpiUserEvaluation.evaluationReqEdit = requestBody.status.trim().toUpperCase();
|
||||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||||
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||||
// Object.assign(kpiUserEvaluation, requestBody);
|
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
||||||
|
return new HttpSuccess(kpiUserEvaluation.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API แก้ไขสถานะประเมิน (USER)
|
||||||
|
*
|
||||||
|
* @summary แก้ไขคนประเมิน (USER)
|
||||||
|
*
|
||||||
|
* @param {string} id Guid, *Id คนประเมิน (USER)
|
||||||
|
*/
|
||||||
|
@Put("result/{id}")
|
||||||
|
async updateKpiUserResultEvaluation(
|
||||||
|
@Path() id: string,
|
||||||
|
@Body() requestBody: updateKpiUserResultEvaluation,
|
||||||
|
@Request() request: { user: Record<string, any> },
|
||||||
|
) {
|
||||||
|
const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (!kpiUserEvaluation) {
|
||||||
|
throw new HttpError(
|
||||||
|
HttpStatusCode.NOT_FOUND,
|
||||||
|
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
kpiUserEvaluation.evaluationResults = requestBody.status.trim().toUpperCase();
|
||||||
|
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||||
|
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||||
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
||||||
return new HttpSuccess(kpiUserEvaluation.id);
|
return new HttpSuccess(kpiUserEvaluation.id);
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +375,6 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
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;
|
||||||
// Object.assign(kpiUserEvaluation, requestBody);
|
|
||||||
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
||||||
return new HttpSuccess(kpiUserEvaluation.id);
|
return new HttpSuccess(kpiUserEvaluation.id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -213,3 +213,8 @@ export class updateKpiUserStatusEvaluation {
|
||||||
@Column()
|
@Column()
|
||||||
status: string;
|
status: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class updateKpiUserResultEvaluation {
|
||||||
|
@Column()
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue