ผูกสิท
This commit is contained in:
parent
2a536dcc32
commit
204984f63e
4 changed files with 58 additions and 27 deletions
|
|
@ -896,7 +896,7 @@ export class DevelopmentController extends Controller {
|
||||||
developmentProjectTypes: true,
|
developmentProjectTypes: true,
|
||||||
developmentProjectTechniquePlanneds: true,
|
developmentProjectTechniquePlanneds: true,
|
||||||
developmentProjectTechniqueActuals: true,
|
developmentProjectTechniqueActuals: true,
|
||||||
developmentAddresss: true
|
developmentAddresss: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!development) {
|
if (!development) {
|
||||||
|
|
@ -907,7 +907,7 @@ export class DevelopmentController extends Controller {
|
||||||
developmentProjectTypes: [],
|
developmentProjectTypes: [],
|
||||||
developmentProjectTechniquePlanneds: [],
|
developmentProjectTechniquePlanneds: [],
|
||||||
developmentProjectTechniqueActuals: [],
|
developmentProjectTechniqueActuals: [],
|
||||||
developmentAddresss: []
|
developmentAddresss: [],
|
||||||
});
|
});
|
||||||
development.lastUpdateUserId = request.user.sub;
|
development.lastUpdateUserId = request.user.sub;
|
||||||
development.lastUpdateFullName = request.user.name;
|
development.lastUpdateFullName = request.user.name;
|
||||||
|
|
@ -1266,7 +1266,8 @@ export class DevelopmentController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
||||||
}
|
}
|
||||||
console.log(">>>>>>>>>>", requestBody.results);
|
console.log(">>>>>>>>>>", requestBody.results);
|
||||||
let results:any = requestBody.results && requestBody.results != ""?requestBody.results:null;
|
let results: any =
|
||||||
|
requestBody.results && requestBody.results != "" ? requestBody.results : null;
|
||||||
const before = structuredClone(development);
|
const before = structuredClone(development);
|
||||||
const data = Object.assign(new DevelopmentEvaluation(), requestBody);
|
const data = Object.assign(new DevelopmentEvaluation(), requestBody);
|
||||||
data.results = results;
|
data.results = results;
|
||||||
|
|
@ -1390,7 +1391,7 @@ export class DevelopmentController extends Controller {
|
||||||
if (!development) {
|
if (!development) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
||||||
}
|
}
|
||||||
if (requestBody.provinceActualId != null) {
|
if (requestBody.provinceActualId != null) {
|
||||||
const checkId = await this.provinceRepository.findOne({
|
const checkId = await this.provinceRepository.findOne({
|
||||||
where: { id: requestBody.provinceActualId },
|
where: { id: requestBody.provinceActualId },
|
||||||
});
|
});
|
||||||
|
|
@ -1494,7 +1495,8 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab7/{id}")
|
@Get("tab7/{id}")
|
||||||
async GetDevelopemtTab7ById(@Path() id: string) {
|
async GetDevelopemtTab7ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
|
|
@ -1518,7 +1520,8 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab8/{id}")
|
@Get("tab8/{id}")
|
||||||
async GetDevelopemtTab8ById(@Path() id: string) {
|
async GetDevelopemtTab8ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
relations: ["developmentRisks"],
|
relations: ["developmentRisks"],
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
|
|
@ -1531,7 +1534,9 @@ export class DevelopmentController extends Controller {
|
||||||
getDevelopment.developmentRisks == null
|
getDevelopment.developmentRisks == null
|
||||||
? null
|
? null
|
||||||
: getDevelopment.developmentRisks.sort((a, b) =>
|
: getDevelopment.developmentRisks.sort((a, b) =>
|
||||||
(a.createdAt.toString() == null ? "" : a.createdAt.toString()).localeCompare(b.createdAt.toString() == null ? "" : b.createdAt.toString()),
|
(a.createdAt.toString() == null ? "" : a.createdAt.toString()).localeCompare(
|
||||||
|
b.createdAt.toString() == null ? "" : b.createdAt.toString(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
expect: getDevelopment.expect,
|
expect: getDevelopment.expect,
|
||||||
};
|
};
|
||||||
|
|
@ -1851,6 +1856,7 @@ export class DevelopmentController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get()
|
@Get()
|
||||||
async GetDevelopmentLists(
|
async GetDevelopmentLists(
|
||||||
|
@Request() request: RequestWithUser,
|
||||||
@Query("page") page: number = 1,
|
@Query("page") page: number = 1,
|
||||||
@Query("pageSize") pageSize: number = 10,
|
@Query("pageSize") pageSize: number = 10,
|
||||||
@Query("year") year: number,
|
@Query("year") year: number,
|
||||||
|
|
@ -1859,6 +1865,7 @@ export class DevelopmentController extends Controller {
|
||||||
@Query("node") node?: number | null,
|
@Query("node") node?: number | null,
|
||||||
@Query("keyword") keyword?: string,
|
@Query("keyword") keyword?: string,
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionList(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const [development, total] = await AppDataSource.getRepository(Development)
|
const [development, total] = await AppDataSource.getRepository(Development)
|
||||||
.createQueryBuilder("development")
|
.createQueryBuilder("development")
|
||||||
.andWhere(year > 0 ? "development.year LIKE :year" : "1=1", {
|
.andWhere(year > 0 ? "development.year LIKE :year" : "1=1", {
|
||||||
|
|
@ -1956,7 +1963,8 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab1/{id}")
|
@Get("tab1/{id}")
|
||||||
async GetDevelopemtTab1ById(@Path() id: string) {
|
async GetDevelopemtTab1ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
|
|
@ -2008,7 +2016,8 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab2/{id}")
|
@Get("tab2/{id}")
|
||||||
async GetDevelopemtTab2ById(@Path() id: string) {
|
async GetDevelopemtTab2ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: [
|
relations: [
|
||||||
|
|
@ -2102,7 +2111,8 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab3/{id}")
|
@Get("tab3/{id}")
|
||||||
async GetDevelopemtTab3ById(@Path() id: string) {
|
async GetDevelopemtTab3ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: [
|
relations: [
|
||||||
|
|
@ -2155,9 +2165,7 @@ export class DevelopmentController extends Controller {
|
||||||
dateEnd: getDevelopment.dateEnd,
|
dateEnd: getDevelopment.dateEnd,
|
||||||
totalDate: getDevelopment.totalDate,
|
totalDate: getDevelopment.totalDate,
|
||||||
developmentAddresss:
|
developmentAddresss:
|
||||||
getDevelopment.developmentAddresss == null
|
getDevelopment.developmentAddresss == null ? null : getDevelopment.developmentAddresss,
|
||||||
? null
|
|
||||||
: getDevelopment.developmentAddresss
|
|
||||||
};
|
};
|
||||||
return new HttpSuccess(_getDevelopment);
|
return new HttpSuccess(_getDevelopment);
|
||||||
}
|
}
|
||||||
|
|
@ -2212,7 +2220,8 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab4/{id}")
|
@Get("tab4/{id}")
|
||||||
async GetDevelopemtTab4ById(@Path() id: string) {
|
async GetDevelopemtTab4ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: ["developmentEvaluations"],
|
relations: ["developmentEvaluations"],
|
||||||
|
|
@ -2244,20 +2253,23 @@ export class DevelopmentController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("tab5/{id}")
|
@Get("tab5/{id}")
|
||||||
async GetDevelopemtTab5ById(@Path() id: string) {
|
async GetDevelopemtTab5ById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentRepository.findOne({
|
const getDevelopment = await this.developmentRepository.findOne({
|
||||||
relations: ["developmentOthers"],
|
relations: ["developmentOthers"],
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
if (!getDevelopment) {
|
if (!getDevelopment) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรมนี้");
|
||||||
}
|
}
|
||||||
let _getDevelopment = {
|
let _getDevelopment = {
|
||||||
developmentOthers:
|
developmentOthers:
|
||||||
getDevelopment.developmentOthers == null
|
getDevelopment.developmentOthers == null
|
||||||
? null
|
? null
|
||||||
: getDevelopment.developmentOthers.sort((a, b) =>
|
: getDevelopment.developmentOthers.sort((a, b) =>
|
||||||
(a.createdAt.toString() == null ? "" : a.createdAt.toString()).localeCompare(b.createdAt.toString() == null ? "" : b.createdAt.toString()),
|
(a.createdAt.toString() == null ? "" : a.createdAt.toString()).localeCompare(
|
||||||
|
b.createdAt.toString() == null ? "" : b.createdAt.toString(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
obstacle: getDevelopment.obstacle,
|
obstacle: getDevelopment.obstacle,
|
||||||
suggestion: getDevelopment.suggestion,
|
suggestion: getDevelopment.suggestion,
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import { EmployeePosType } from "../entities/EmployeePosType";
|
||||||
import { EmployeePosLevel } from "../entities/EmployeePosLevel";
|
import { EmployeePosLevel } from "../entities/EmployeePosLevel";
|
||||||
import { RequestWithUser } from "../middlewares/user";
|
import { RequestWithUser } from "../middlewares/user";
|
||||||
import { addLogSequence, setLogDataDiff } from "../interfaces/utils";
|
import { addLogSequence, setLogDataDiff } from "../interfaces/utils";
|
||||||
|
import permission from "../interfaces/permission";
|
||||||
|
|
||||||
@Route("api/v1/development/history/employee")
|
@Route("api/v1/development/history/employee")
|
||||||
@Tags("DevelopmentEmployeeHistory")
|
@Tags("DevelopmentEmployeeHistory")
|
||||||
|
|
@ -44,7 +45,8 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Get("org/{year}")
|
@Get("org/{year}")
|
||||||
async GetOrgDevelopemt(@Path() year: number) {
|
async GetOrgDevelopemt(@Request() request: RequestWithUser, @Path() year: number) {
|
||||||
|
await new permission().PermissionList(request, "SYS_DEV_HISTORY_EMP");
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const getOrg = await this.developmentHistoryRepository
|
const getOrg = await this.developmentHistoryRepository
|
||||||
.createQueryBuilder("developmentHistory")
|
.createQueryBuilder("developmentHistory")
|
||||||
|
|
@ -76,6 +78,7 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
@Body() requestBody: CreateDevelopmentHistory,
|
@Body() requestBody: CreateDevelopmentHistory,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionCreate(request, "SYS_DEV_HISTORY_EMP");
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const chk_name = await this.developmentHistoryRepository.find({
|
const chk_name = await this.developmentHistoryRepository.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -144,6 +147,7 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
@Body() requestBody: UpdateDevelopmentHistory,
|
@Body() requestBody: UpdateDevelopmentHistory,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionUpdate(request, "SYS_DEV_HISTORY_EMP");
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const development = await this.developmentHistoryRepository.findOne({
|
const development = await this.developmentHistoryRepository.findOne({
|
||||||
where: { id: id, type: type },
|
where: { id: id, type: type },
|
||||||
|
|
@ -209,7 +213,8 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Delete("{id}")
|
@Delete("{id}")
|
||||||
async DeleteDevelopmentHistory(@Path() id: string,@Request () request: RequestWithUser) {
|
async DeleteDevelopmentHistory(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
|
await new permission().PermissionDelete(request, "SYS_DEV_HISTORY_EMP");
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const development = await this.developmentHistoryRepository.findOne({
|
const development = await this.developmentHistoryRepository.findOne({
|
||||||
where: { id: id, type: type },
|
where: { id: id, type: type },
|
||||||
|
|
@ -234,6 +239,7 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Post("filter")
|
@Post("filter")
|
||||||
async GetDevelopmentHistoryLists(
|
async GetDevelopmentHistoryLists(
|
||||||
|
@Request() request: RequestWithUser,
|
||||||
@Body()
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
page: number;
|
page: number;
|
||||||
|
|
@ -243,6 +249,7 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
root: string | null;
|
root: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionList(request, "SYS_DEV_HISTORY_EMP");
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const [development, total] = await AppDataSource.getRepository(DevelopmentHistory)
|
const [development, total] = await AppDataSource.getRepository(DevelopmentHistory)
|
||||||
.createQueryBuilder("developmentHistory")
|
.createQueryBuilder("developmentHistory")
|
||||||
|
|
@ -352,7 +359,8 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async GetDevelopemtHistoryById(@Path() id: string) {
|
async GetDevelopemtHistoryById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_HISTORY_EMP");
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
||||||
relations: ["development", "employeePosLevel", "employeePosType"],
|
relations: ["development", "employeePosLevel", "employeePosType"],
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import { PosType } from "../entities/PosType";
|
||||||
import { PosLevel } from "../entities/PosLevel";
|
import { PosLevel } from "../entities/PosLevel";
|
||||||
import { RequestWithUser } from "../middlewares/user";
|
import { RequestWithUser } from "../middlewares/user";
|
||||||
import { addLogSequence, setLogDataDiff } from "../interfaces/utils";
|
import { addLogSequence, setLogDataDiff } from "../interfaces/utils";
|
||||||
|
import permission from "../interfaces/permission";
|
||||||
|
|
||||||
@Route("api/v1/development/history/officer")
|
@Route("api/v1/development/history/officer")
|
||||||
@Tags("DevelopmentOfficerHistory")
|
@Tags("DevelopmentOfficerHistory")
|
||||||
|
|
@ -44,7 +45,8 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Get("org/{year}")
|
@Get("org/{year}")
|
||||||
async GetOrgDevelopemt(@Path() year: number) {
|
async GetOrgDevelopemt(@Request() request: RequestWithUser, @Path() year: number) {
|
||||||
|
await new permission().PermissionList(request, "SYS_DEV_HISTORY_OFFICER");
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const getOrg = await this.developmentHistoryRepository
|
const getOrg = await this.developmentHistoryRepository
|
||||||
.createQueryBuilder("developmentHistory")
|
.createQueryBuilder("developmentHistory")
|
||||||
|
|
@ -76,6 +78,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
@Body() requestBody: CreateDevelopmentHistory,
|
@Body() requestBody: CreateDevelopmentHistory,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionCreate(request, "SYS_DEV_HISTORY_OFFICER");
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const chk_name = await this.developmentHistoryRepository.find({
|
const chk_name = await this.developmentHistoryRepository.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -140,6 +143,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
@Body() requestBody: UpdateDevelopmentHistory,
|
@Body() requestBody: UpdateDevelopmentHistory,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionUpdate(request, "SYS_DEV_HISTORY_OFFICER");
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const development = await this.developmentHistoryRepository.findOne({
|
const development = await this.developmentHistoryRepository.findOne({
|
||||||
where: { id: id, type: type },
|
where: { id: id, type: type },
|
||||||
|
|
@ -202,6 +206,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Delete("{id}")
|
@Delete("{id}")
|
||||||
async DeleteDevelopmentHistory(@Path() id: string, @Request() request: RequestWithUser) {
|
async DeleteDevelopmentHistory(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
|
await new permission().PermissionDelete(request, "SYS_DEV_HISTORY_OFFICER");
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const development = await this.developmentHistoryRepository.findOne({
|
const development = await this.developmentHistoryRepository.findOne({
|
||||||
where: { id: id, type: type },
|
where: { id: id, type: type },
|
||||||
|
|
@ -226,6 +231,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Post("filter")
|
@Post("filter")
|
||||||
async GetDevelopmentHistoryLists(
|
async GetDevelopmentHistoryLists(
|
||||||
|
@Request() request: RequestWithUser,
|
||||||
@Body()
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
page: number;
|
page: number;
|
||||||
|
|
@ -235,6 +241,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
root: string | null;
|
root: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionList(request, "SYS_DEV_HISTORY_OFFICER");
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const [development, total] = await AppDataSource.getRepository(DevelopmentHistory)
|
const [development, total] = await AppDataSource.getRepository(DevelopmentHistory)
|
||||||
.createQueryBuilder("developmentHistory")
|
.createQueryBuilder("developmentHistory")
|
||||||
|
|
@ -330,7 +337,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
fullName: item.prefix + item.firstName + " " + item.lastName,
|
fullName: item.prefix + item.firstName + " " + item.lastName,
|
||||||
position: item.position,
|
position: item.position,
|
||||||
year: item.development.year,
|
year: item.development.year,
|
||||||
root: item.development.root,//test
|
root: item.development.root, //test
|
||||||
posType: item.posType ? item.posType.posTypeName : null,
|
posType: item.posType ? item.posType.posTypeName : null,
|
||||||
posLevel: item.posLevel ? item.posLevel.posLevelName : null,
|
posLevel: item.posLevel ? item.posLevel.posLevelName : null,
|
||||||
posExecutive: item.posExecutive,
|
posExecutive: item.posExecutive,
|
||||||
|
|
@ -348,7 +355,8 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
* @param {string} id Id โครงการ
|
* @param {string} id Id โครงการ
|
||||||
*/
|
*/
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async GetDevelopemtHistoryById(@Path() id: string) {
|
async GetDevelopemtHistoryById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_HISTORY_OFFICER");
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
||||||
relations: ["development", "posLevel", "posType"],
|
relations: ["development", "posLevel", "posType"],
|
||||||
|
|
|
||||||
|
|
@ -196,12 +196,14 @@ export class DevelopmentScholarshipController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get()
|
@Get()
|
||||||
async GetDevelopmentScholarshipLists(
|
async GetDevelopmentScholarshipLists(
|
||||||
|
@Request() request: RequestWithUser,
|
||||||
@Query("page") page: number = 1,
|
@Query("page") page: number = 1,
|
||||||
@Query("pageSize") pageSize: number = 10,
|
@Query("pageSize") pageSize: number = 10,
|
||||||
@Query("keyword") keyword?: string,
|
@Query("keyword") keyword?: string,
|
||||||
@Query("year") year?: number,
|
@Query("year") year?: number,
|
||||||
@Query("scholarshipType") scholarshipType?: string,
|
@Query("scholarshipType") scholarshipType?: string,
|
||||||
) {
|
) {
|
||||||
|
await new permission().PermissionList(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const [development, total] = await AppDataSource.getRepository(DevelopmentScholarship)
|
const [development, total] = await AppDataSource.getRepository(DevelopmentScholarship)
|
||||||
.createQueryBuilder("developmentScholarship")
|
.createQueryBuilder("developmentScholarship")
|
||||||
.leftJoinAndSelect("developmentScholarship.posLevel", "posLevel")
|
.leftJoinAndSelect("developmentScholarship.posLevel", "posLevel")
|
||||||
|
|
@ -292,7 +294,8 @@ export class DevelopmentScholarshipController extends Controller {
|
||||||
* @param {string} id Id ข้าราชการฯที่ได้รับทุนการศึกษา
|
* @param {string} id Id ข้าราชการฯที่ได้รับทุนการศึกษา
|
||||||
*/
|
*/
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async GetDevelopemtScholarshipById(@Path() id: string) {
|
async GetDevelopemtScholarshipById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
|
await new permission().PermissionGet(request, "SYS_DEV_SCHOLARSHIP");
|
||||||
const getDevelopment = await this.developmentScholarshipRepository.findOne({
|
const getDevelopment = await this.developmentScholarshipRepository.findOne({
|
||||||
relations: ["posLevel", "posType", "posLevelguarantor", "posTypeguarantor"],
|
relations: ["posLevel", "posType", "posLevelguarantor", "posTypeguarantor"],
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue