แก้ชื่อฟิวผังเงินเดือนลูกจ้าง

This commit is contained in:
Kittapath 2024-03-13 11:25:07 +07:00
parent 3128103f3a
commit 5fc5b1bb06
7 changed files with 48 additions and 17 deletions

View file

@ -127,7 +127,7 @@ export class SalaryRankEmployeesController extends Controller {
where: {
salaryEmployeeId: id,
},
select: ["id", "step", "salaryMounth", "salaryDay"],
select: ["id", "step", "salaryMonth", "salaryDay"],
order: {
step: "ASC",
},
@ -137,7 +137,7 @@ export class SalaryRankEmployeesController extends Controller {
const filteredSalaryRankEmployee = salaryRankEmployee.filter(
(x) =>
x.step?.toString().includes(keyword) ||
x.salaryMounth?.toString().includes(keyword) ||
x.salaryMonth?.toString().includes(keyword) ||
x.salaryDay?.toString().includes(keyword),
);
const slicedData = filteredSalaryRankEmployee.slice((page - 1) * pageSize, page * pageSize);

View file

@ -1,8 +1,5 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { SalaryRanks } from "./SalaryRanks";
import { PosType } from "./PosType";
import { PosLevel } from "./PosLevel";
import { SalaryRankEmployees } from "./SalaryRankEmployees";
@Entity("salaryEmployees")
@ -14,10 +11,11 @@ export class SalaryEmployees extends EntityBase {
name: string;
@Column({
length: 40,
nullable: true,
comment: "กลุ่มบัญชีการจ้าง",
default: null,
})
group: string;
group: number;
@Column({
comment: "สถานะการใช้งาน",
@ -68,7 +66,7 @@ export class CreateSalaryEmployee {
name: string;
@Column()
group: string;
group: number;
@Column()
isActive: boolean;
@ -91,7 +89,7 @@ export class UpdateSalaryEmployee {
name: string;
@Column()
group: string;
group: number;
@Column()
isActive: boolean;

View file

@ -1,6 +1,5 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Salarys } from "./Salarys";
import { SalaryEmployees } from "./SalaryEmployees";
@Entity("salaryRankEmployees")
@ -23,7 +22,7 @@ export class SalaryRankEmployees extends EntityBase {
comment: "ค่าจ้างรายเดือน",
default: null,
})
salaryMounth: number | null;
salaryMonth: number | null;
@Column({
nullable: true,
@ -46,7 +45,7 @@ export class CreateSalaryRankEmployee {
step: number;
@Column()
salaryMounth?: number | null;
salaryMonth?: number | null;
@Column()
salaryDay?: number | null;
@ -57,7 +56,7 @@ export class UpdateSalaryRankEmployee {
step: number;
@Column()
salaryMounth?: number | null;
salaryMonth?: number | null;
@Column()
salaryDay?: number | null;

View file

@ -1,4 +1,4 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Salarys } from "./Salarys";

View file

@ -1,4 +1,4 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { SalaryRanks } from "./SalaryRanks";
import { PosType } from "./PosType";

View file

@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTypeStepTableSalaryEmployees1710302516943 implements MigrationInterface {
name = 'UpdateTypeStepTableSalaryEmployees1710302516943'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` CHANGE \`group\` \`step\` varchar(40) NOT NULL COMMENT 'กลุ่มบัญชีการจ้าง'`);
await queryRunner.query(`ALTER TABLE \`salaryRankEmployees\` CHANGE \`salaryMounth\` \`salaryMonth\` double NULL COMMENT 'ค่าจ้างรายเดือน'`);
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` DROP COLUMN \`step\``);
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` ADD \`step\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` DROP COLUMN \`step\``);
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` ADD \`step\` varchar(40) NOT NULL COMMENT 'กลุ่มบัญชีการจ้าง'`);
await queryRunner.query(`ALTER TABLE \`salaryRankEmployees\` CHANGE \`salaryMonth\` \`salaryMounth\` double NULL COMMENT 'ค่าจ้างรายเดือน'`);
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` CHANGE \`step\` \`group\` varchar(40) NOT NULL COMMENT 'กลุ่มบัญชีการจ้าง'`);
}
}

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTypeStepTableSalaryEmployees11710302798280 implements MigrationInterface {
name = 'UpdateTypeStepTableSalaryEmployees11710302798280'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` CHANGE \`step\` \`group\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryEmployees\` CHANGE \`group\` \`step\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`);
}
}