แก้ทะเบียนประวัติ Individual Development Plan #875
This commit is contained in:
parent
fe9eca9b33
commit
e094c0ad07
1 changed files with 52 additions and 0 deletions
|
|
@ -2606,6 +2606,58 @@ export class DevelopmentController extends Controller {
|
|||
return new HttpSuccess(getOrg);
|
||||
}
|
||||
|
||||
@Get("registry/{type}/{developmentId}")
|
||||
async developmentDetail(
|
||||
@Path() developmentId: string,
|
||||
@Path() type: string,
|
||||
@Request() request: RequestWithUser
|
||||
) {
|
||||
const getDevelopment = await this.developmentRepository.findOne({
|
||||
where: { id: developmentId },
|
||||
relations: [
|
||||
"developmentProjectTypes",
|
||||
"developmentProjectTechniquePlanneds",
|
||||
"developmentProjectTechniqueActuals",
|
||||
"developmentAddresss",
|
||||
],
|
||||
});
|
||||
if (!getDevelopment)
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
||||
|
||||
if (type.trim().toLocaleUpperCase() == "OFFICER") {
|
||||
let _workflow = await new permission().Workflow(request, developmentId, "SYS_REGISTRY_OFFICER");
|
||||
if (_workflow == false) await new permission().PermissionGet(request, "SYS_REGISTRY_OFFICER");
|
||||
} else if (type.trim().toLocaleUpperCase() == "USER") {
|
||||
} else {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถเข้าถึงข้อมูลนี้ได้");
|
||||
}
|
||||
|
||||
let _getDevelopment: any = {
|
||||
id: getDevelopment.id,
|
||||
evaluationId: null,
|
||||
target: null,
|
||||
summary: null,
|
||||
point: null,
|
||||
name: getDevelopment.projectName,
|
||||
achievement10: "มีผลการพัฒนาและมีการดำเนินการตามเป้าหมายการนำไปพัฒนางาน1",
|
||||
achievement5: "มีผลการพัฒนาแต่ยังไม่ได้ดำเนินการตามเป้าหมายการนำไปพัฒนางาน",
|
||||
achievement0: "ไม่ได้ดำเนินการพัฒนา",
|
||||
isDevelopment70: getDevelopment.isReasonActual70,
|
||||
isDevelopment20: getDevelopment.isReasonActual20,
|
||||
isDevelopment10: getDevelopment.isReasonActual10,
|
||||
reasonDevelopment70: getDevelopment.reasonActual70,
|
||||
reasonDevelopment20: getDevelopment.reasonActual20,
|
||||
reasonDevelopment10: getDevelopment.reasonActual10,
|
||||
selectType: "PROJECT",
|
||||
selectTypeYear: getDevelopment.year,
|
||||
selectTypeId: null,
|
||||
developmentProjects : getDevelopment.developmentProjectTechniqueActuals
|
||||
.map((x) => x.name)
|
||||
.sort(),
|
||||
};
|
||||
return new HttpSuccess(_getDevelopment);
|
||||
}
|
||||
|
||||
/**
|
||||
* API upload User
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue