checkpoint and fix bug
This commit is contained in:
parent
24d0d06b62
commit
2610bd74b4
2 changed files with 57 additions and 3 deletions
|
|
@ -690,4 +690,58 @@ export class PositionController extends Controller {
|
|||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายการอัตรากำลัง
|
||||
*
|
||||
* @summary ORG_053 - รายการอัตรากำลัง (ADMIN) #56
|
||||
*
|
||||
*/
|
||||
@Post("master/list")
|
||||
async list(
|
||||
@Body()
|
||||
body: {
|
||||
id: string;
|
||||
type: number;
|
||||
// isAll: boolean;
|
||||
// page: number;
|
||||
// pageSize: number;
|
||||
// keyword?: string;
|
||||
},
|
||||
) {
|
||||
try {
|
||||
let typeCondition: any = {};
|
||||
|
||||
if (body.type === 0) {
|
||||
typeCondition = {
|
||||
orgRootId: body.id,
|
||||
};
|
||||
} else if (body.type === 1) {
|
||||
typeCondition = {
|
||||
orgChild1Id: body.id,
|
||||
};
|
||||
} else if (body.type === 2) {
|
||||
typeCondition = {
|
||||
orgChild2Id: body.id,
|
||||
};
|
||||
} else if (body.type === 3) {
|
||||
typeCondition = {
|
||||
orgChild3Id: body.id,
|
||||
};
|
||||
} else if (body.type === 4) {
|
||||
typeCondition = {
|
||||
orgChild4Id: body.id,
|
||||
};
|
||||
}
|
||||
|
||||
const posMaster = await this.posMasterRepository.find({
|
||||
where: typeCondition,
|
||||
// relations: ["position"]
|
||||
});
|
||||
|
||||
return new HttpSuccess(posMaster);
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue