no message
This commit is contained in:
parent
927d9563f6
commit
ce8bb41bda
7 changed files with 238 additions and 43 deletions
|
|
@ -183,7 +183,7 @@ export class SalaryEmployeeController extends Controller {
|
|||
const chk_SalaryFormulaEmp = await this.salaryFormulaEmployeeRepository.find({
|
||||
where: { salaryEmployeeId: id },
|
||||
});
|
||||
if(chk_SalaryFormulaEmp.length > 0){
|
||||
if (chk_SalaryFormulaEmp.length > 0) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่สามารถลบรายการนี้ได้เนื่องจากมีการใช้งานอยู่",
|
||||
|
|
@ -213,7 +213,9 @@ export class SalaryEmployeeController extends Controller {
|
|||
endDate: "datetime", //วันที่สิ้นสุดบังคับใช้
|
||||
detail: "string", //คำอธิบาย
|
||||
})
|
||||
async GetSalaryById(@Path() id: string) {
|
||||
async GetSalaryById(
|
||||
@Request() request: RequestWithUser,@Path() id: string) {
|
||||
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"],
|
||||
|
|
@ -231,10 +233,12 @@ export class SalaryEmployeeController extends Controller {
|
|||
*/
|
||||
@Get()
|
||||
async listSalary(
|
||||
@Request() request: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
await new permission().PermissionList(request, "SYS_WAGE_CHART_EMP");
|
||||
const [salaryEmployee, total] = await AppDataSource.getRepository(SalaryEmployee)
|
||||
.createQueryBuilder("salaryEmployee")
|
||||
.andWhere(
|
||||
|
|
@ -270,10 +274,7 @@ export class SalaryEmployeeController extends Controller {
|
|||
*
|
||||
*/
|
||||
@Post("copy")
|
||||
async copySalary(
|
||||
@Body() body: { id: string },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
async copySalary(@Body() body: { id: string }, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionCreate(request, "SYS_WAGE_CHART_EMP");
|
||||
const salary = await this.salaryEmployeeRepository.findOne({
|
||||
relations: ["salaryRankEmployees_"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue