Merge branch 'develop' into adiDev
This commit is contained in:
commit
c8fcfebe97
2 changed files with 41 additions and 0 deletions
|
|
@ -43,6 +43,19 @@ export class ProfileSalaryController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("position/user")
|
||||||
|
public async getSalaryPositionUser(@Request() request: { user: Record<string, any> }) {
|
||||||
|
const profile = await this.profileRepo.findOneBy({ keycloak: request.user.sub });
|
||||||
|
if (!profile) {
|
||||||
|
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||||
|
}
|
||||||
|
const record = await this.salaryRepo.find({
|
||||||
|
where: { profileId: profile.id },
|
||||||
|
order: { order: "ASC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getSalary(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalary(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,19 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("position/user")
|
||||||
|
public async getSalaryPositionUser(@Request() request: { user: Record<string, any> }) {
|
||||||
|
const profile = await this.profileRepo.findOneBy({ keycloak: request.user.sub });
|
||||||
|
if (!profile) {
|
||||||
|
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||||
|
}
|
||||||
|
const record = await this.salaryRepo.find({
|
||||||
|
where: { profileEmployeeId: profile.id },
|
||||||
|
order: { order: "ASC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
|
@ -59,6 +72,21 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("position/{profileId}")
|
||||||
|
public async getPositionSalaryEmployee(
|
||||||
|
@Path() profileId: string,
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
) {
|
||||||
|
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.salaryRepo.find({
|
||||||
|
where: { profileEmployeeId: profileId },
|
||||||
|
order: { order: "ASC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getSalaryEmployeeAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryEmployeeAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue