checkpoint
This commit is contained in:
parent
44f669b5b1
commit
f12dbfcbee
3 changed files with 76 additions and 79 deletions
|
|
@ -119,40 +119,38 @@ export class KpiUserPlannedController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * API รายละเอียดงานตามแผนปฏิบัติราชการประจำปี
|
* API รายละเอียดงานตามแผนปฏิบัติราชการประจำปี
|
||||||
// *
|
*
|
||||||
// * @summary - รายละเอียดงานตามแผนปฏิบัติราชการประจำปี #51
|
* @summary - รายละเอียดงานตามแผนปฏิบัติราชการประจำปี #51
|
||||||
// *
|
*
|
||||||
// * @param {string} id Id งานตามแผนปฏิบัติราชการประจำปี
|
* @param {string} id Id งานตามแผนปฏิบัติราชการประจำปี
|
||||||
// */
|
*/
|
||||||
// @Get("{id}")
|
@Get("{id}")
|
||||||
// async GetKpiUserPlannedDetail(@Path() id: string) {
|
async GetKpiUserPlannedDetail(@Path() id: string) {
|
||||||
// const getKpiUserPlanned = await this.kpiUserPlannedRepository.findOne({
|
const getKpiUserPlanned = await this.kpiUserPlannedRepository.findOne({
|
||||||
// select: ["id", "kpiUserPlannedName", "kpiUserPlannedRank"],
|
relations: ["kpiPlan","kpiUserEvaluation"],
|
||||||
// relations: ["posLevels"],
|
where: { id: id },
|
||||||
// where: { id: id },
|
});
|
||||||
// });
|
if (!getKpiUserPlanned) {
|
||||||
// if (!getKpiUserPlanned) {
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลงานตามแผนปฏิบัติราชการประจำปีนี้");
|
||||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลงานตามแผนปฏิบัติราชการประจำปีนี้");
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// const mapGetKpiUserPlanned = {
|
const mapGetKpiUserPlanned = ({
|
||||||
// id: getKpiUserPlanned.id,
|
id: getKpiUserPlanned.id,
|
||||||
// kpiUserPlannedName: getKpiUserPlanned.kpiUserPlannedName,
|
evaluationId: getKpiUserPlanned.kpiUserEvaluation.id,
|
||||||
// kpiUserPlannedRank: getKpiUserPlanned.kpiUserPlannedRank,
|
kpiRoleId: getKpiUserPlanned.kpiPlan.id,
|
||||||
// posLevels: getKpiUserPlanned.posLevels
|
including: getKpiUserPlanned.kpiPlan.including, //รหัสตัวชี้วัด
|
||||||
// .sort((a, b) => a.posLevelRank - b.posLevelRank)
|
includingName: getKpiUserPlanned.kpiPlan.includingName, //ชื่อตัวชี้วัด
|
||||||
// .map((posLevel) => ({
|
target: getKpiUserPlanned.target,
|
||||||
// id: posLevel.id,
|
weight: getKpiUserPlanned.weight,
|
||||||
// posLevelName: posLevel.posLevelName,
|
unit: getKpiUserPlanned.unit,
|
||||||
// posLevelRank: posLevel.posLevelRank,
|
meaning: getKpiUserPlanned.meaning,
|
||||||
// posLevelAuthority: posLevel.posLevelAuthority,
|
formula: getKpiUserPlanned.formula,
|
||||||
// })),
|
});
|
||||||
// };
|
|
||||||
|
|
||||||
// return new HttpSuccess(mapGetKpiUserPlanned);
|
return new HttpSuccess(mapGetKpiUserPlanned);
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API รายการงานตามแผนปฏิบัติราชการประจำปี
|
* API รายการงานตามแผนปฏิบัติราชการประจำปี
|
||||||
|
|
@ -161,14 +159,17 @@ export class KpiUserPlannedController extends Controller {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Get()
|
@Get()
|
||||||
async GetKpiUserPlanned() {
|
async GetKpiUserPlanned(
|
||||||
|
@Query("id") id: string ,
|
||||||
|
) {
|
||||||
const kpiUserPlanned = await this.kpiUserPlannedRepository.find({
|
const kpiUserPlanned = await this.kpiUserPlannedRepository.find({
|
||||||
|
where:{
|
||||||
|
kpiUserEvaluationId:id
|
||||||
|
},
|
||||||
relations: ["kpiPlan","kpiUserEvaluation"],
|
relations: ["kpiPlan","kpiUserEvaluation"],
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
});
|
});
|
||||||
// if (!kpiUserPlanned) {
|
|
||||||
// return new HttpSuccess([]);
|
|
||||||
// }
|
|
||||||
const mapKpiUserPlanned = kpiUserPlanned.map((item) => ({
|
const mapKpiUserPlanned = kpiUserPlanned.map((item) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
evaluationId: item.kpiUserEvaluation.id,
|
evaluationId: item.kpiUserEvaluation.id,
|
||||||
|
|
@ -183,8 +184,8 @@ export class KpiUserPlannedController extends Controller {
|
||||||
achievement: item.point === 1 ? "ระดับ 1" :
|
achievement: item.point === 1 ? "ระดับ 1" :
|
||||||
item.point === 2 ? "ระดับ 2" :
|
item.point === 2 ? "ระดับ 2" :
|
||||||
item.point === 3 ? "ระดับ 3" :
|
item.point === 3 ? "ระดับ 3" :
|
||||||
item.point === 3 ? "ระดับ 4" :
|
item.point === 4 ? "ระดับ 4" :
|
||||||
item.point === 3 ? "ระดับ 5" : null,
|
item.point === 5 ? "ระดับ 5" : null,
|
||||||
achievement1: item.kpiPlan.achievement1,
|
achievement1: item.kpiPlan.achievement1,
|
||||||
achievement2: item.kpiPlan.achievement2,
|
achievement2: item.kpiPlan.achievement2,
|
||||||
achievement3: item.kpiPlan.achievement3,
|
achievement3: item.kpiPlan.achievement3,
|
||||||
|
|
|
||||||
|
|
@ -132,40 +132,38 @@ export class KpiUserRoleController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * API รายละเอียดงานตามหน้าที่ความรับผิดชอบหลัก
|
* API รายละเอียดงานตามหน้าที่ความรับผิดชอบหลัก
|
||||||
// *
|
*
|
||||||
// * @summary - รายละเอียดงานตามหน้าที่ความรับผิดชอบหลัก #51
|
* @summary - รายละเอียดงานตามหน้าที่ความรับผิดชอบหลัก #51
|
||||||
// *
|
*
|
||||||
// * @param {string} id Id งานตามหน้าที่ความรับผิดชอบหลัก
|
* @param {string} id Id งานตามหน้าที่ความรับผิดชอบหลัก
|
||||||
// */
|
*/
|
||||||
// @Get("{id}")
|
@Get("{id}")
|
||||||
// async GetKpiUserRoleDetail(@Path() id: string) {
|
async GetKpiUserRoleDetail(@Path() id: string) {
|
||||||
// const getKpiUserRole = await this.kpiUserRoleRepository.findOne({
|
const getKpiUserRole = await this.kpiUserRoleRepository.findOne({
|
||||||
// select: ["id", "kpiUserRoleName", "kpiUserRoleRank"],
|
relations: ["kpiRole","kpiUserEvaluation"],
|
||||||
// relations: ["posLevels"],
|
where: { id: id },
|
||||||
// where: { id: id },
|
});
|
||||||
// });
|
if (!getKpiUserRole) {
|
||||||
// if (!getKpiUserRole) {
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลงานตามหน้าที่ความรับผิดชอบหลักนี้");
|
||||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลงานตามหน้าที่ความรับผิดชอบหลักนี้");
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// const mapGetKpiUserRole = {
|
const mapKpiUserRole = ({
|
||||||
// id: getKpiUserRole.id,
|
id: getKpiUserRole.id,
|
||||||
// kpiUserRoleName: getKpiUserRole.kpiUserRoleName,
|
evaluationId: getKpiUserRole.kpiUserEvaluation.id,
|
||||||
// kpiUserRoleRank: getKpiUserRole.kpiUserRoleRank,
|
kpiRoleId: getKpiUserRole.kpiRole.id,
|
||||||
// posLevels: getKpiUserRole.posLevels
|
including: getKpiUserRole.kpiRole.including,
|
||||||
// .sort((a, b) => a.posLevelRank - b.posLevelRank)
|
includingName: getKpiUserRole.kpiRole.includingName,
|
||||||
// .map((posLevel) => ({
|
target: getKpiUserRole.target,
|
||||||
// id: posLevel.id,
|
weight: getKpiUserRole.weight,
|
||||||
// posLevelName: posLevel.posLevelName,
|
unit: getKpiUserRole.unit,
|
||||||
// posLevelRank: posLevel.posLevelRank,
|
meaning: getKpiUserRole.meaning,
|
||||||
// posLevelAuthority: posLevel.posLevelAuthority,
|
formula: getKpiUserRole.formula,
|
||||||
// })),
|
});
|
||||||
// };
|
|
||||||
|
|
||||||
// return new HttpSuccess(mapGetKpiUserRole);
|
return new HttpSuccess(mapKpiUserRole);
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API รายการงานตามหน้าที่ความรับผิดชอบหลัก
|
* API รายการงานตามหน้าที่ความรับผิดชอบหลัก
|
||||||
|
|
@ -184,9 +182,7 @@ export class KpiUserRoleController extends Controller {
|
||||||
relations: ["kpiRole","kpiUserEvaluation"],
|
relations: ["kpiRole","kpiUserEvaluation"],
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
});
|
});
|
||||||
// if (!kpiUserRole) {
|
|
||||||
// return new HttpSuccess([]);
|
|
||||||
// }
|
|
||||||
const mapKpiUserRole = kpiUserRole.map((item) => ({
|
const mapKpiUserRole = kpiUserRole.map((item) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
evaluationId: item.kpiUserEvaluation.id,
|
evaluationId: item.kpiUserEvaluation.id,
|
||||||
|
|
@ -202,8 +198,8 @@ export class KpiUserRoleController extends Controller {
|
||||||
achievement: item.point === 1 ? "ระดับ 1" :
|
achievement: item.point === 1 ? "ระดับ 1" :
|
||||||
item.point === 2 ? "ระดับ 2" :
|
item.point === 2 ? "ระดับ 2" :
|
||||||
item.point === 3 ? "ระดับ 3" :
|
item.point === 3 ? "ระดับ 3" :
|
||||||
item.point === 3 ? "ระดับ 4" :
|
item.point === 4 ? "ระดับ 4" :
|
||||||
item.point === 3 ? "ระดับ 5" : null,
|
item.point === 5 ? "ระดับ 5" : null,
|
||||||
achievement1: item.kpiRole.achievement1,
|
achievement1: item.kpiRole.achievement1,
|
||||||
achievement2: item.kpiRole.achievement2,
|
achievement2: item.kpiRole.achievement2,
|
||||||
achievement3: item.kpiRole.achievement3,
|
achievement3: item.kpiRole.achievement3,
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,8 @@ export class UpdateKpiUserPlanned {
|
||||||
meaning: string;
|
meaning: string;
|
||||||
@Column()
|
@Column()
|
||||||
formula: string;
|
formula: string;
|
||||||
// @Column("uuid")
|
@Column("uuid")
|
||||||
// kpiUserEvaluationId: string;
|
kpiUserEvaluationId: string;
|
||||||
// @Column("uuid")
|
@Column("uuid")
|
||||||
// kpiPlanId: string;
|
kpiPlanId: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue