save waith
This commit is contained in:
parent
416b8af6ea
commit
92f3c3413f
2 changed files with 13 additions and 20 deletions
|
|
@ -80,7 +80,7 @@ export class kpiReasonController extends Controller {
|
|||
|
||||
let kpiUserEvaluationReason = Object.assign(new KpiUserEvaluationReasonPlan(), requestBody);
|
||||
kpiUserEvaluationReason.type = type.trim().toUpperCase();
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const _kpiUserEvaluationReason = await this.kpiUserEvaluationReasonPlan.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserPlanned", "kpiUserPlanned.kpiUserEvaluation"],
|
||||
|
|
@ -203,7 +203,7 @@ export class kpiReasonController extends Controller {
|
|||
*/
|
||||
@Get("{type}/plan/{user}/{id}")
|
||||
async listKpiUserPlanReason(@Path() id: string, @Path() type: string, @Path() user: string) {
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonPlan.find({
|
||||
where: { kpiUserPlannedId: id, type: type.trim().toUpperCase() },
|
||||
});
|
||||
|
|
@ -267,7 +267,7 @@ export class kpiReasonController extends Controller {
|
|||
});
|
||||
let kpiUserEvaluationReason = Object.assign(new KpiUserEvaluationReasonRole(), requestBody);
|
||||
kpiUserEvaluationReason.type = type.trim().toUpperCase();
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const _kpiUserEvaluationReason = await this.kpiUserEvaluationReasonRole.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserRole", "kpiUserRole.kpiUserEvaluation"],
|
||||
|
|
@ -391,7 +391,7 @@ export class kpiReasonController extends Controller {
|
|||
*/
|
||||
@Get("{type}/role/{user}/{id}")
|
||||
async listKpiUserRoleReason(@Path() id: string, @Path() type: string, @Path() user: string) {
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonRole.find({
|
||||
where: { kpiUserRoleId: id, type: type.trim().toUpperCase() },
|
||||
});
|
||||
|
|
@ -458,7 +458,7 @@ export class kpiReasonController extends Controller {
|
|||
requestBody,
|
||||
);
|
||||
kpiUserEvaluationReason.type = type.trim().toUpperCase();
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const _kpiUserEvaluationReason = await this.kpiUserEvaluationReasonSpecial.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserSpecial", "kpiUserSpecial.kpiUserEvaluation"],
|
||||
|
|
@ -581,7 +581,7 @@ export class kpiReasonController extends Controller {
|
|||
*/
|
||||
@Get("{type}/special/{user}/{id}")
|
||||
async listKpiUserSpecialReason(@Path() id: string, @Path() type: string, @Path() user: string) {
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonSpecial.find({
|
||||
where: { kpiUserSpecialId: id, type: type.trim().toUpperCase() },
|
||||
});
|
||||
|
|
@ -648,7 +648,7 @@ export class kpiReasonController extends Controller {
|
|||
requestBody,
|
||||
);
|
||||
kpiUserEvaluationReason.type = type.trim().toUpperCase();
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const _kpiUserEvaluationReason = await this.kpiUserEvaluationReasonDevelopment.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserDevelopment", "kpiUserDevelopment.kpiUserEvaluation"],
|
||||
|
|
@ -676,11 +676,7 @@ export class kpiReasonController extends Controller {
|
|||
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||
);
|
||||
}
|
||||
kpiUserEvaluationReason.status =
|
||||
kpiUserEvaluation.kpiUserEvaluation.evaluatorId == null ||
|
||||
kpiUserEvaluation.kpiUserEvaluation.evaluatorId == ""
|
||||
? "DONE"
|
||||
: "EVALUATOR";
|
||||
kpiUserEvaluationReason.status = "DONE";
|
||||
}
|
||||
kpiUserEvaluationReason.kpiUserDevelopmentId = id;
|
||||
kpiUserEvaluationReason.createdUserId = request.user.sub;
|
||||
|
|
@ -775,7 +771,7 @@ export class kpiReasonController extends Controller {
|
|||
@Path() type: string,
|
||||
@Path() user: string,
|
||||
) {
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonDevelopment.find({
|
||||
where: { kpiUserDevelopmentId: id, type: type.trim().toUpperCase() },
|
||||
});
|
||||
|
|
@ -842,7 +838,7 @@ export class kpiReasonController extends Controller {
|
|||
requestBody,
|
||||
);
|
||||
kpiUserEvaluationReason.type = type.trim().toUpperCase();
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const _kpiUserEvaluationReason = await this.kpiUserEvaluationReasonCapacity.findOne({
|
||||
where: { id: id },
|
||||
relations: ["kpiUserCapacity", "kpiUserCapacity.kpiUserEvaluation"],
|
||||
|
|
@ -870,11 +866,7 @@ export class kpiReasonController extends Controller {
|
|||
"ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้",
|
||||
);
|
||||
}
|
||||
kpiUserEvaluationReason.status =
|
||||
kpiUserEvaluation.kpiUserEvaluation.evaluatorId == null ||
|
||||
kpiUserEvaluation.kpiUserEvaluation.evaluatorId == ""
|
||||
? "DONE"
|
||||
: "EVALUATOR";
|
||||
kpiUserEvaluationReason.status = "DONE";
|
||||
}
|
||||
kpiUserEvaluationReason.kpiUserCapacityId = id;
|
||||
kpiUserEvaluationReason.createdUserId = request.user.sub;
|
||||
|
|
@ -965,7 +957,7 @@ export class kpiReasonController extends Controller {
|
|||
*/
|
||||
@Get("{type}/capacity/{user}/{id}")
|
||||
async listKpiUserCapacityReason(@Path() id: string, @Path() type: string, @Path() user: string) {
|
||||
if (type.trim().toUpperCase() == "PROGRESS") {
|
||||
if (type.trim().toUpperCase() == "PROBLEM") {
|
||||
const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonCapacity.find({
|
||||
where: { kpiUserCapacityId: id, type: type.trim().toUpperCase() },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -449,6 +449,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
}
|
||||
}
|
||||
}
|
||||
await this.kpiUserEvalutionRepository.save(kpiUserEvaluation);
|
||||
|
||||
return new HttpSuccess(kpiUserEvaluation.id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue