เงินเดือนลูกจ้าง
This commit is contained in:
parent
6950954268
commit
fa79bb5b7a
8 changed files with 2893 additions and 270 deletions
150
src/entities/SalaryOrgEmployee.ts
Normal file
150
src/entities/SalaryOrgEmployee.ts
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany, Double } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { SalaryPeriod } from "./SalaryPeriod";
|
||||
import { SalaryProfileEmployee } from "./SalaryProfileEmployee";
|
||||
|
||||
@Entity("salaryOrgEmployee")
|
||||
export class SalaryOrgEmployee extends EntityBase {
|
||||
@Column({
|
||||
comment: "คีย์นอก(FK)ของตาราง salaryPeriod",
|
||||
length: 40,
|
||||
})
|
||||
salaryPeriodId: string;
|
||||
|
||||
@Column({
|
||||
comment: "สถานะ",
|
||||
})
|
||||
status: string;
|
||||
|
||||
@Column({
|
||||
comment: "คีย์นอก(FK)ของตาราง orgRoot",
|
||||
length: 40,
|
||||
})
|
||||
rootId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgRevision",
|
||||
length: 40,
|
||||
})
|
||||
revisionId: string;
|
||||
|
||||
@Column({
|
||||
comment: "รอบการ Snapshot",
|
||||
length: 20,
|
||||
default: "SNAP1",
|
||||
})
|
||||
snapshot: string;
|
||||
|
||||
@Column({
|
||||
default: 0,
|
||||
comment: "จำนวนคนทั้งหมด",
|
||||
})
|
||||
total: number;
|
||||
|
||||
@Column({
|
||||
default: 0,
|
||||
comment: "15%ของจำนวนคน(จำนวนเต็ม)",
|
||||
})
|
||||
fifteenPercent: number;
|
||||
|
||||
@Column({
|
||||
comment: "15%ของจำนวนคน(จุดทศนิยม)",
|
||||
type: "double",
|
||||
default: 0,
|
||||
})
|
||||
fifteenPoint: number;
|
||||
|
||||
@Column({
|
||||
comment: "กลุ่ม GROUP1->กลุ่ม1 GROUP2->กลุ่ม2",
|
||||
length: 10,
|
||||
})
|
||||
group: string;
|
||||
|
||||
@Column({
|
||||
comment: "เลือกไปแล้ว",
|
||||
default: 0,
|
||||
})
|
||||
quantityUsed: number;
|
||||
|
||||
@Column({
|
||||
comment: "คงเหลือโควตา",
|
||||
default: 0,
|
||||
})
|
||||
remainQuota: number;
|
||||
|
||||
@Column({
|
||||
comment: "จำนวนเงินคนครองปัจจุบัน",
|
||||
type: "double",
|
||||
default: 0,
|
||||
})
|
||||
currentAmount: number;
|
||||
|
||||
@Column({
|
||||
comment: "วงเงิน6%",
|
||||
type: "double",
|
||||
default: 0,
|
||||
})
|
||||
sixPercentAmount: number;
|
||||
|
||||
@Column({
|
||||
comment: "ยอดเงินที่ใช้ไป",
|
||||
type: "double",
|
||||
default: 0,
|
||||
})
|
||||
spentAmount: number;
|
||||
|
||||
@Column({
|
||||
comment: "ใช้ไปเท่าไหร่",
|
||||
type: "double",
|
||||
default: 0,
|
||||
})
|
||||
useAmount: number;
|
||||
|
||||
@Column({
|
||||
comment: "เหลือเท่าไหร่",
|
||||
type: "double",
|
||||
default: 0,
|
||||
})
|
||||
remainingAmount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำแนะนำ สกจ",
|
||||
length: 255,
|
||||
})
|
||||
ownerRecommend: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำแนะนำ ผอ",
|
||||
length: 255,
|
||||
})
|
||||
headRecommend: string;
|
||||
|
||||
@ManyToOne(() => SalaryPeriod, (salaryPeriod) => salaryPeriod.salaryOrgs)
|
||||
@JoinColumn({ name: "salaryPeriodId" })
|
||||
salaryPeriod: SalaryPeriod;
|
||||
|
||||
@OneToMany(() => SalaryProfileEmployee, (salaryProfile) => salaryProfile.salaryOrg)
|
||||
salaryProfiles: SalaryProfileEmployee[];
|
||||
}
|
||||
|
||||
export class CreateSalaryOrgEmployee {
|
||||
@Column("uuid")
|
||||
salaryPeriodId: string;
|
||||
|
||||
@Column()
|
||||
status: string;
|
||||
|
||||
@Column("uuid")
|
||||
rootId: string;
|
||||
|
||||
@Column()
|
||||
total: number;
|
||||
|
||||
@Column()
|
||||
fifteenPercent: number;
|
||||
}
|
||||
|
||||
export type UpdateSalaryOrgEmployee = Partial<CreateSalaryOrgEmployee>;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { SalaryOrg } from "./SalaryOrg";
|
||||
import { SalaryOrgEmployee } from "./SalaryOrgEmployee";
|
||||
|
||||
@Entity("salaryPeriod")
|
||||
export class SalaryPeriod extends EntityBase {
|
||||
|
|
@ -51,6 +52,9 @@ export class SalaryPeriod extends EntityBase {
|
|||
|
||||
@OneToMany(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryPeriod)
|
||||
salaryOrgs: SalaryOrg[];
|
||||
|
||||
@OneToMany(() => SalaryOrgEmployee, (salaryOrgEmployee) => salaryOrgEmployee.salaryPeriod)
|
||||
salaryOrgEmployees: SalaryOrgEmployee[];
|
||||
}
|
||||
|
||||
export class CreateSalaryPeriod {
|
||||
|
|
|
|||
397
src/entities/SalaryProfileEmployee.ts
Normal file
397
src/entities/SalaryProfileEmployee.ts
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { SalaryOrgEmployee } from "./SalaryOrgEmployee";
|
||||
|
||||
@Entity("salaryProfileEmployee")
|
||||
export class SalaryProfileEmployee extends EntityBase {
|
||||
@Column({
|
||||
comment: "คีย์นอก(FK)ของตาราง salaryOrg",
|
||||
length: 40,
|
||||
})
|
||||
salaryOrgId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำนำหน้า",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
prefix: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
firstName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สกุล",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
lastName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เลขบัตรประชาชน",
|
||||
length: 100,
|
||||
default: null,
|
||||
})
|
||||
citizenId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ)",
|
||||
length: 100,
|
||||
default: null,
|
||||
})
|
||||
posMasterNoPrefix: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เลขที่ตำแหน่ง เป็นตัวเลข",
|
||||
default: null,
|
||||
})
|
||||
posMasterNo: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "Suffix หลังเลขที่ตำแหน่ง เช่น ช.",
|
||||
length: 100,
|
||||
default: null,
|
||||
})
|
||||
posMasterNoSuffix: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อย่อหน่วยงาน",
|
||||
length: 100,
|
||||
default: null,
|
||||
})
|
||||
orgShortName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตำแหน่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
position: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภทตำแหน่ง",
|
||||
length: 100,
|
||||
default: null,
|
||||
})
|
||||
posType: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posLevel: number;
|
||||
|
||||
// @Column({
|
||||
// nullable: true,
|
||||
// comment: "ตำแหน่งทางการบริหาร",
|
||||
// length: 255,
|
||||
// default: null,
|
||||
// })
|
||||
// posExecutive: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "เงินเดือนฐาน",
|
||||
default: null,
|
||||
})
|
||||
amount: number | null;
|
||||
|
||||
@Column({
|
||||
type: "double",
|
||||
comment: "เงินพิเศษ",
|
||||
default: 0,
|
||||
})
|
||||
amountSpecial: number;
|
||||
|
||||
@Column({
|
||||
type: "double",
|
||||
comment: "จำนวนเงินที่ใช้เลื่อน",
|
||||
default: 0,
|
||||
})
|
||||
amountUse: number;
|
||||
|
||||
@Column({
|
||||
type: "double",
|
||||
comment: "เงินเดือนหลังเลื่อน",
|
||||
default: 0,
|
||||
})
|
||||
positionSalaryAmount: number;
|
||||
|
||||
@Column({
|
||||
comment:
|
||||
"ประเภทการเลื่อน(ขั้น) PENDING->รายชื่อคนครอง NONE->ไม่ได้เลื่อน HAFT->ครึ่งขั้น FULL->1ขั้น FULLHAFT->1.5ขั้น",
|
||||
length: 20,
|
||||
default: "PENDING",
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
comment: "สถานะ",
|
||||
length: 20,
|
||||
default: "PENDING",
|
||||
})
|
||||
status: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "id revision",
|
||||
length: 40,
|
||||
})
|
||||
revisionId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgRoot",
|
||||
length: 40,
|
||||
})
|
||||
rootId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อของหน่วยงาน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
root: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgChild1",
|
||||
length: 40,
|
||||
})
|
||||
child1Id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อส่วนราชการ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
child1: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgChild2",
|
||||
length: 40,
|
||||
})
|
||||
child2Id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อส่วนราชการ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
child2: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgChild3",
|
||||
length: 40,
|
||||
})
|
||||
child3Id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อส่วนราชการ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
child3: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgChild4",
|
||||
length: 40,
|
||||
})
|
||||
child4Id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อส่วนราชการ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
child4: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ผลการประเมินผลการปฏิบัติราชการ",
|
||||
default: null,
|
||||
})
|
||||
result: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระยะเวลาการปฏิบัติราชการในรอบครึ่งปี",
|
||||
default: null,
|
||||
})
|
||||
duration: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "การลงโทษทางวินัย",
|
||||
default: null,
|
||||
})
|
||||
isPunish: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "พักราชการ",
|
||||
default: null,
|
||||
})
|
||||
isSuspension: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ขาดราชการ",
|
||||
default: null,
|
||||
})
|
||||
isAbsent: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "วันลา",
|
||||
default: null,
|
||||
})
|
||||
isLeave: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เกษียญ",
|
||||
default: false,
|
||||
})
|
||||
isRetired: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สำรอง",
|
||||
default: false,
|
||||
})
|
||||
isReserve: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ทะลุขั้น",
|
||||
default: false,
|
||||
})
|
||||
isNext: boolean;
|
||||
|
||||
@ManyToOne(() => SalaryOrgEmployee, (salaryOrg) => salaryOrg.salaryProfiles)
|
||||
@JoinColumn({ name: "salaryOrgId" })
|
||||
salaryOrg: SalaryOrgEmployee;
|
||||
}
|
||||
|
||||
export class CreateSalaryProfileEmployee {
|
||||
@Column("uuid")
|
||||
id: string;
|
||||
|
||||
@Column()
|
||||
type: string;
|
||||
|
||||
@Column()
|
||||
prefix: string;
|
||||
|
||||
@Column()
|
||||
firstName: string;
|
||||
|
||||
@Column()
|
||||
lastName: string;
|
||||
|
||||
@Column()
|
||||
citizenId: string;
|
||||
|
||||
@Column()
|
||||
posMasterNoPrefix: string | null;
|
||||
|
||||
@Column()
|
||||
posMasterNo: number;
|
||||
|
||||
@Column()
|
||||
posMasterNoSuffix: string | null;
|
||||
|
||||
@Column()
|
||||
orgShortName: string | null;
|
||||
|
||||
@Column()
|
||||
position: string;
|
||||
|
||||
@Column()
|
||||
posType: string;
|
||||
|
||||
@Column()
|
||||
posLevel: string;
|
||||
|
||||
// @Column()
|
||||
// posExecutive: string | null;
|
||||
|
||||
@Column()
|
||||
amount: number | null;
|
||||
|
||||
@Column("uuid")
|
||||
rootId: string | null;
|
||||
|
||||
@Column()
|
||||
root: string | null;
|
||||
|
||||
@Column("uuid")
|
||||
child1Id: string | null;
|
||||
|
||||
@Column()
|
||||
child1: string | null;
|
||||
|
||||
@Column("uuid")
|
||||
child2Id: string | null;
|
||||
|
||||
@Column()
|
||||
child2: string | null;
|
||||
|
||||
@Column("uuid")
|
||||
child3Id: string | null;
|
||||
|
||||
@Column()
|
||||
child3: string | null;
|
||||
|
||||
@Column("uuid")
|
||||
child4Id: string | null;
|
||||
|
||||
@Column()
|
||||
child4: string | null;
|
||||
|
||||
@Column()
|
||||
result: string | null;
|
||||
|
||||
@Column()
|
||||
duration: string | null;
|
||||
|
||||
@Column()
|
||||
isPunish: boolean;
|
||||
|
||||
@Column()
|
||||
isSuspension: boolean;
|
||||
|
||||
@Column()
|
||||
isAbsent: boolean;
|
||||
|
||||
@Column()
|
||||
isLeave: boolean;
|
||||
|
||||
@Column()
|
||||
isRetired: boolean;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue