set report development
This commit is contained in:
parent
3dc49ec507
commit
58a30a7c74
1 changed files with 127 additions and 0 deletions
127
src/controllers/ReportController.ts
Normal file
127
src/controllers/ReportController.ts
Normal file
|
|
@ -0,0 +1,127 @@
|
||||||
|
import {
|
||||||
|
Controller,
|
||||||
|
Get,
|
||||||
|
Post,
|
||||||
|
Put,
|
||||||
|
Delete,
|
||||||
|
Route,
|
||||||
|
Security,
|
||||||
|
Tags,
|
||||||
|
Body,
|
||||||
|
Path,
|
||||||
|
Request,
|
||||||
|
Query,
|
||||||
|
} from "tsoa";
|
||||||
|
import { AppDataSource } from "../database/data-source";
|
||||||
|
import { Brackets, Not } from "typeorm";
|
||||||
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
|
import HttpError from "../interfaces/http-error";
|
||||||
|
import HttpStatusCode from "../interfaces/http-status";
|
||||||
|
import { Development } from "../entities/Development";
|
||||||
|
import {
|
||||||
|
CreateDevelopmentHistory,
|
||||||
|
DevelopmentHistory,
|
||||||
|
UpdateDevelopmentHistory,
|
||||||
|
} from "../entities/DevelopmentHistory";
|
||||||
|
import { PosType } from "../entities/PosType";
|
||||||
|
import { PosLevel } from "../entities/PosLevel";
|
||||||
|
|
||||||
|
@Route("api/v1/development/report")
|
||||||
|
@Tags("Report")
|
||||||
|
@Security("bearerAuth")
|
||||||
|
export class ReportController extends Controller {
|
||||||
|
private developmentHistoryRepository = AppDataSource.getRepository(DevelopmentHistory);
|
||||||
|
private developmentRepository = AppDataSource.getRepository(Development);
|
||||||
|
private posTypeRepository = AppDataSource.getRepository(PosType);
|
||||||
|
private posLevelRepository = AppDataSource.getRepository(PosLevel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Report รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด
|
||||||
|
*
|
||||||
|
* @summary DEV_0xx - Report รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด #xx
|
||||||
|
*
|
||||||
|
* @param {string} type type ประเภท report
|
||||||
|
*/
|
||||||
|
@Get("main/{type}")
|
||||||
|
async GetReportDevelopemtMain(@Path() type: string) {
|
||||||
|
const _type = type.trim().toUpperCase();
|
||||||
|
const formattedData = {
|
||||||
|
org: _type,
|
||||||
|
};
|
||||||
|
|
||||||
|
return new HttpSuccess({
|
||||||
|
template: "development",
|
||||||
|
reportName: "development",
|
||||||
|
data: {
|
||||||
|
data: formattedData,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Report รายการประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ
|
||||||
|
*
|
||||||
|
* @summary DEV_0xx - Report รายการประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ #xx
|
||||||
|
*
|
||||||
|
* @param {string} type type ประเภท report
|
||||||
|
*/
|
||||||
|
@Get("history-officer/{type}")
|
||||||
|
async GetReportDevelopemtHistoryOfficer(@Path() type: string) {
|
||||||
|
const _type = type.trim().toUpperCase();
|
||||||
|
const formattedData = {
|
||||||
|
org: _type,
|
||||||
|
};
|
||||||
|
|
||||||
|
return new HttpSuccess({
|
||||||
|
template: "development",
|
||||||
|
reportName: "development",
|
||||||
|
data: {
|
||||||
|
data: formattedData,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Report รายการประวัติฝึกอบรม/ดูงานลูกจ้าง
|
||||||
|
*
|
||||||
|
* @summary DEV_0xx - Report รายการประวัติฝึกอบรม/ดูงานลูกจ้าง #xx
|
||||||
|
*
|
||||||
|
* @param {string} type type ประเภท report
|
||||||
|
*/
|
||||||
|
@Get("history-employee/{type}")
|
||||||
|
async GetReportDevelopemtHistoryEmployee(@Path() type: string) {
|
||||||
|
const _type = type.trim().toUpperCase();
|
||||||
|
const formattedData = {
|
||||||
|
org: _type,
|
||||||
|
};
|
||||||
|
|
||||||
|
return new HttpSuccess({
|
||||||
|
template: "development",
|
||||||
|
reportName: "development",
|
||||||
|
data: {
|
||||||
|
data: formattedData,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Report รายการข้าราชการฯที่ได้รับทุนการศึกษา/ฝึกอบรม
|
||||||
|
*
|
||||||
|
* @summary DEV_0xx - Report รายการข้าราชการฯที่ได้รับทุนการศึกษา/ฝึกอบรม #xx
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Get("scholarship")
|
||||||
|
async GetReportDevelopemtScholarship() {
|
||||||
|
const formattedData = {
|
||||||
|
org: "_type",
|
||||||
|
};
|
||||||
|
|
||||||
|
return new HttpSuccess({
|
||||||
|
template: "development",
|
||||||
|
reportName: "development",
|
||||||
|
data: {
|
||||||
|
data: formattedData,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue