no message

This commit is contained in:
kittapath 2024-08-22 17:23:48 +07:00
parent 927d9563f6
commit ce8bb41bda
7 changed files with 238 additions and 43 deletions

View file

@ -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_"],