diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 2c4be4c4..a5df992d 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -3469,8 +3469,16 @@ export class ReportController extends Controller { * @summary Report2 * */ - @Get("report2/{rootId}") - async findReport2(@Path() rootId: string) { + @Post("report2") + async NewReport2( + @Body() + reqBody: { + node: number; + nodeId: string; + } + ) { + // @Get("report2/{rootId}") + // async findReport2(@Path() rootId: string) { // const orgRevision = await this.orgRevisionRepository.findOne({ // where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false }, // relations: ["orgRoots"], @@ -3481,7 +3489,8 @@ export class ReportController extends Controller { // (async () => { const orgRootData = await this.orgRootRepository.find({ where: { - id: rootId, + id: reqBody.nodeId, + // id: rootId, // orgRevisionId: orgRevision.id, }, order: { orgRootOrder: "ASC" }, @@ -7822,8 +7831,16 @@ export class ReportController extends Controller { * @summary Report3 * */ - @Get("report3/{rootId}") - async findReport3(@Path() rootId: string) { + @Post("report3") + async NewReport3( + @Body() + reqBody: { + node: number; + nodeId: string; + } + ) { + // @Get("report3/{rootId}") + // async findReport3(@Path() rootId: string) { // const orgRevision = await this.orgRevisionRepository.findOne({ // where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false }, // relations: ["orgRoots"], @@ -7834,7 +7851,7 @@ export class ReportController extends Controller { const orgRootData = await this.orgRootRepository.find({ where: { - id: rootId, + id: reqBody.nodeId, // orgRevisionId: orgRevision.id, }, order: { orgRootOrder: "ASC" }, @@ -9063,13 +9080,21 @@ export class ReportController extends Controller { }); } - @Get("report4/{rootId}") - async findReport4(@Path() rootId: string) { + @Post("report4") + async NewReport4( + @Body() + reqBody: { + node: number; + nodeId: string; + } + ) { + // @Get("report4/{rootId}") + // async findReport4(@Path() rootId: string) { const orgRootData = await this.orgRootRepository.findOne({ - where: { id: rootId }, + where: { id: reqBody.nodeId }, }); if (!orgRootData) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล"); - + let rootId:string = reqBody.nodeId; const posMaster = await this.posMasterRepository .createQueryBuilder("posMaster") .leftJoinAndSelect("posMaster.positions", "position")