ข้อมูลโครงการตามจริง
This commit is contained in:
parent
e1aa682105
commit
4c0c02cc8b
1 changed files with 67 additions and 1 deletions
|
|
@ -1464,6 +1464,30 @@ export class DevelopmentController extends Controller {
|
||||||
return new HttpSuccess({ data: data, total });
|
return new HttpSuccess({ data: data, total });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API รายการโครงการ/หลักสูตรการฝึกอบรมที่เสร็จสิ้น
|
||||||
|
*
|
||||||
|
* @summary DEV_004 - รายการโครงการ/หลักสูตรการฝึกอบรมที่เสร็จสิ้น
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Get("done")
|
||||||
|
async GetDevelopmentListsDone(@Query("year") year: number) {
|
||||||
|
const [development, total] = await AppDataSource.getRepository(Development)
|
||||||
|
.createQueryBuilder("development")
|
||||||
|
.andWhere(year > 0 ? "development.year LIKE :year" : "1=1", {
|
||||||
|
year: `${year.toString()}`,
|
||||||
|
})
|
||||||
|
.andWhere("development.status LIKE :status", {
|
||||||
|
status: `%FINISH%`,
|
||||||
|
})
|
||||||
|
.select(["development.id", "development.projectName", "development.year"])
|
||||||
|
.orderBy("development.year", "DESC")
|
||||||
|
.orderBy("development.createdAt", "DESC")
|
||||||
|
.getManyAndCount();
|
||||||
|
|
||||||
|
return new HttpSuccess({ data: development, total });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API ลบโครงการ/หลักสูตรการฝึกอบรม
|
* API ลบโครงการ/หลักสูตรการฝึกอบรม
|
||||||
*
|
*
|
||||||
|
|
@ -1899,6 +1923,48 @@ export class DevelopmentController extends Controller {
|
||||||
return new HttpSuccess(_getDevelopment);
|
return new HttpSuccess(_getDevelopment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab3
|
||||||
|
*
|
||||||
|
* @summary DEV_00 - รายละเอียดโครงการ/หลักสูตรการฝึกอบรมtab3 #
|
||||||
|
*
|
||||||
|
* @param {string} id Id โครงการ
|
||||||
|
*/
|
||||||
|
@Get("tab3_1/{id}")
|
||||||
|
async GetDevelopemtTab3_1ById(@Path() id: string) {
|
||||||
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
relations: [
|
||||||
|
"developmentProjectTypes",
|
||||||
|
"developmentProjectTechniquePlanneds",
|
||||||
|
"developmentProjectTechniqueActuals",
|
||||||
|
],
|
||||||
|
});
|
||||||
|
if (!getDevelopment) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
||||||
|
}
|
||||||
|
let _getDevelopment: any = {
|
||||||
|
projectModalActual: getDevelopment.projectModalActual,
|
||||||
|
isBackActual: getDevelopment.isBackActual,
|
||||||
|
isHoldActual: getDevelopment.isHoldActual,
|
||||||
|
projectDayBackActual: getDevelopment.projectDayBackActual,
|
||||||
|
projectDayHoldActual: getDevelopment.projectDayHoldActual,
|
||||||
|
projectNigthHoldActual: getDevelopment.projectNigthHoldActual,
|
||||||
|
reasonActual70: getDevelopment.reasonActual70,
|
||||||
|
reasonActual20: getDevelopment.reasonActual20,
|
||||||
|
reasonActual10: getDevelopment.reasonActual10,
|
||||||
|
developmentProjectTechniqueActuals: getDevelopment.developmentProjectTechniqueActuals
|
||||||
|
.map((x) => x.name)
|
||||||
|
.sort(),
|
||||||
|
strategyChild1Actual: getDevelopment.strategyChild1ActualId,
|
||||||
|
strategyChild2Actual: getDevelopment.strategyChild2ActualId,
|
||||||
|
strategyChild3Actual: getDevelopment.strategyChild3ActualId,
|
||||||
|
strategyChild4Actual: getDevelopment.strategyChild4ActualId,
|
||||||
|
strategyChild5Actual: getDevelopment.strategyChild5ActualId,
|
||||||
|
};
|
||||||
|
return new HttpSuccess(_getDevelopment);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab4
|
* API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab4
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue