ปรับเป็น POST แทน GET >> report 2 3 4
This commit is contained in:
parent
aa2831307b
commit
d823a448bc
1 changed files with 35 additions and 10 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue