check workflow
This commit is contained in:
parent
4c2188a363
commit
32b0aa325d
74 changed files with 529 additions and 285 deletions
|
|
@ -51,7 +51,9 @@ export class ProfileLeaveEmployeeController extends Controller {
|
|||
|
||||
@Get("{profileId}")
|
||||
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||
if (_workflow == false)
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||
const record = await this.leaveRepo.find({
|
||||
relations: { leaveType: true },
|
||||
where: { profileEmployeeId: profileId },
|
||||
|
|
@ -62,7 +64,8 @@ export class ProfileLeaveEmployeeController extends Controller {
|
|||
|
||||
@Get("admin/{profileId}")
|
||||
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||
const record = await this.leaveRepo.find({
|
||||
relations: { leaveType: true },
|
||||
where: { profileEmployeeId: profileId },
|
||||
|
|
@ -75,11 +78,13 @@ export class ProfileLeaveEmployeeController extends Controller {
|
|||
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
req,
|
||||
"SYS_REGISTRY_EMP",
|
||||
_record.profileEmployeeId,
|
||||
);
|
||||
let _workflow = await new permission().Workflow(req, leaveId, "SYS_REGISTRY_EMP");
|
||||
if (_workflow == false)
|
||||
await new permission().PermissionOrgUserGet(
|
||||
req,
|
||||
"SYS_REGISTRY_EMP",
|
||||
_record.profileEmployeeId,
|
||||
);
|
||||
}
|
||||
const record = await this.leaveHistoryRepo.find({
|
||||
relations: { leaveType: true },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue