check workflow

This commit is contained in:
kittapath 2024-10-22 08:21:00 +07:00
parent 4e3f1714b1
commit c1f70f6dd0
5 changed files with 44 additions and 35 deletions

View file

@ -257,7 +257,9 @@ export class SalaryController extends Controller {
detail: "string", //คำอธิบาย
})
async GetSalaryById(@Request() request: RequestWithUser, @Path() id: string) {
await new permission().PermissionGet(request, "SYS_SALARY_CHART_OFFICER");
let _workflow = await new permission().Workflow(request, id, "SYS_SALARY_CHART_OFFICER");
if (_workflow == false)
await new permission().PermissionGet(request, "SYS_SALARY_CHART_OFFICER");
const salary = await this.salaryRepository.findOne({
relations: ["posType_", "posLevel_"],
where: { id: id },

View file

@ -222,7 +222,8 @@ export class SalaryEmployeeController extends Controller {
detail: "string", //คำอธิบาย
})
async GetSalaryById(@Request() request: RequestWithUser, @Path() id: string) {
await new permission().PermissionGet(request, "SYS_WAGE_CHART_EMP");
let _workflow = await new permission().Workflow(request, id, "SYS_WAGE_CHART_EMP");
if (_workflow == false) await new permission().PermissionGet(request, "SYS_WAGE_CHART_EMP");
const salary = await this.salaryEmployeeRepository.findOne({
where: { id: id },
select: ["name", "group", "isActive", "date", "startDate", "endDate", "details"],

View file

@ -133,12 +133,13 @@ export class SalaryRanksController extends Controller {
async listSalaryRanks(
@Request() request: RequestWithUser,
@Path() id: string,
@Request() req: RequestWithUser,
@Query("page") page: number = 1,
@Query("pageSize") pageSize: number = 10,
@Query("keyword") keyword?: string,
) {
await new permission().PermissionGet(request, "SYS_SALARY_CHART_OFFICER");
let _workflow = await new permission().Workflow(request, id, "SYS_SALARY_CHART_OFFICER");
if (_workflow == false)
await new permission().PermissionGet(request, "SYS_SALARY_CHART_OFFICER");
const [salaryRank, total] = await AppDataSource.getRepository(SalaryRanks)
.createQueryBuilder("salaryRank")
.andWhere(

View file

@ -158,7 +158,8 @@ export class SalaryRankEmployeeController extends Controller {
@Query("pageSize") pageSize: number = 10,
@Query("keyword") keyword?: string,
) {
await new permission().PermissionGet(request, "SYS_WAGE_CHART_EMP");
let _workflow = await new permission().Workflow(request, id, "SYS_WAGE_CHART_EMP");
if (_workflow == false) await new permission().PermissionGet(request, "SYS_WAGE_CHART_EMP");
const [salaryRankEmployee, total] = await AppDataSource.getRepository(SalaryRankEmployee)
.createQueryBuilder("salaryRankEmployee")
.andWhere(