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