แก้ฟิวขอทุน

This commit is contained in:
Kittapath 2024-04-04 19:59:28 +07:00
parent 7e9aa4e0fa
commit de746486d1
5 changed files with 451 additions and 410 deletions

View file

@ -1,5 +1,7 @@
import { Entity, Column, ManyToOne, JoinColumn, Double } from "typeorm";
import { EntityBase } from "./base/Base";
import { PosLevel } from "./PosLevel";
import { PosType } from "./PosType";
@Entity("developmentScholarship")
export class DevelopmentScholarship extends EntityBase {
@ -59,6 +61,28 @@ export class DevelopmentScholarship extends EntityBase {
})
posExecutive: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีระดับตำแหน่ง",
})
posLevelId: string | null;
@ManyToOne(() => PosLevel, (posLevel) => posLevel.developmentScholars)
@JoinColumn({ name: "posLevelId" })
posLevel: PosLevel;
@Column({
nullable: true,
length: 40,
comment: "ไอดีประเภทตำแหน่ง",
})
posTypeId: string | null;
@ManyToOne(() => PosType, (posType) => posType.developmentScholars)
@JoinColumn({ name: "posTypeId" })
posType: PosType;
@Column({
nullable: true,
comment: "ยศ(ผู้ค้ำ)",
@ -115,6 +139,28 @@ export class DevelopmentScholarship extends EntityBase {
})
guarantorPosExecutive: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีระดับตำแหน่ง(ผู้ค้ำ)",
})
posLevelguarantorId: string | null;
@ManyToOne(() => PosLevel, (posLevel) => posLevel.developmentScholarGuarantors)
@JoinColumn({ name: "posLevelguarantorId" })
posLevelguarantor: PosLevel;
@Column({
nullable: true,
length: 40,
comment: "ไอดีประเภทตำแหน่ง(ผู้ค้ำ)",
})
posTypeguarantorId: string | null;
@ManyToOne(() => PosType, (posType) => posType.developmentScholarGuarantors)
@JoinColumn({ name: "posTypeguarantorId" })
posTypeguarantor: PosType;
@Column({
nullable: true,
comment: "ปีงบประมาณที่ได้รับทุน",
@ -177,7 +223,7 @@ export class DevelopmentScholarship extends EntityBase {
changeDetail: string;
@Column({
//การศึกษาในประเทศ = DOMESTICE ,
//การศึกษาในประเทศ = DOMESTICE
//ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ) = NOABROAD
//ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ) = ABROAD
//ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร) = EXECUTIVE
@ -238,29 +284,28 @@ export class DevelopmentScholarship extends EntityBase {
reportBackDate: Date;
@Column({
//ปริญญาตรี = BACHELOR , ปริญญาโท = GRADUATE , ปริญญาเอก = MASTER , ปริญญาดุษฎีบัณฑิต = DOCTOR
nullable: true,
comment: "ระดับปริญญา",
length: 10,
length: 255,
default: null,
})
degreeLevel: string;
@Column({
nullable: true,
comment: "หลักสูตรการศึกษา",
comment: "หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม",
length: 255,
default: null,
})
courseOfStudy: string;
course: string;
@Column({
nullable: true,
comment: "สาขาวิชา",
comment: "สาขาวิชา/สาขา",
length: 255,
default: null,
})
fieldOfStudy: string;
field: string;
@Column({
nullable: true,
@ -272,7 +317,7 @@ export class DevelopmentScholarship extends EntityBase {
@Column({
nullable: true,
comment: "สถาบันการศึกษา",
comment: "สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ",
length: 255,
default: null,
})
@ -280,35 +325,35 @@ export class DevelopmentScholarship extends EntityBase {
@Column({
nullable: true,
comment: "วันเริ่มต้นการศึกษา",
length: 255,
type: "datetime",
comment: "วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ",
default: null,
})
studyStartDate: string;
@Column({
nullable: true,
comment: "วันสิ้นสุดการศึกษา",
length: 255,
default: null,
})
studyEndDate: string;
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ",
default: null,
})
endDate: Date;
@Column({
nullable: true,
comment: "สถานที่ไปศึกษาดูงาน",
length: 255,
default: null,
})
studyTourPlace: Date;
studyPlace: string;
@Column({
nullable: true,
type: "datetime",
comment: "หัวข้อการไปศึกษาดูงาน",
comment: "หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ",
length: 255,
default: null,
})
studyTourTopic: Date;
studyTopic: string;
@Column({
nullable: true,
@ -316,7 +361,7 @@ export class DevelopmentScholarship extends EntityBase {
comment: "วันเริ่มต้นการศึกษาดูงาน",
default: null,
})
studyTourStartDate: Date;
studyStartDate: Date;
@Column({
nullable: true,
@ -324,7 +369,7 @@ export class DevelopmentScholarship extends EntityBase {
comment: "วันสิ้นสุดการศึกษาดูงาน",
default: null,
})
studyTourEndDate: Date;
studyEndDate: Date;
@Column({
nullable: true,
@ -332,7 +377,7 @@ export class DevelopmentScholarship extends EntityBase {
length: 255,
default: null,
})
studyTourCountry: string;
studyCountry: string;
@Column({
nullable: true,
@ -340,7 +385,7 @@ export class DevelopmentScholarship extends EntityBase {
length: 255,
default: null,
})
studyTourAbroadTopic: string;
studyAbroadTopic: string;
@Column({
nullable: true,
@ -348,7 +393,7 @@ export class DevelopmentScholarship extends EntityBase {
comment: "วันเริ่มต้นการศึกษาดูงานต่างประเทศ",
default: null,
})
studyTourAbroadStartDate: Date;
studyAbroadStartDate: Date;
@Column({
nullable: true,
@ -356,79 +401,35 @@ export class DevelopmentScholarship extends EntityBase {
comment: "วันสิ้นสุดการศึกษาดูงานต่างประเทศ",
default: null,
})
studyTourAbroadEndDate: Date;
studyAbroadEndDate: Date;
@Column({
nullable: true,
comment: "รวมระยะเวลาในการศึกษา",
comment: "รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม",
length: 40,
default: null,
})
totalStudyPeriod: string;
@Column({
nullable: true,
comment: "หลักสูตรการฝึกอบรม",
length: 255,
default: null,
})
trainingCourseName: string;
@Column({
nullable: true,
type: "date",
comment: "วันเริ่มต้นการฝึกอบรม",
default: null,
})
trainingStartDate: Date;
@Column({
nullable: true,
type: "date",
comment: "วันสิ้นสุดการฝึกอบรม",
default: null,
})
trainingEndDate: Date;
@Column({
nullable: true,
comment: "รวมระยะเวลาในการฝึกอบรม",
length: 40,
default: null,
})
totalTrainingTime: string;
@Column({
nullable: true,
comment: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ",
default: null,
length: 255,
})
order: string;
@Column({
nullable: true,
type: "datetime",
comment: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่",
default: null,
})
dateOrder: Date;
totalPeriod: string;
}
export class CreateDevelopmentScholarship {
rank: string | null;
rank?: string | null;
prefix: string | null;
firstName: string | null;
lastName: string | null;
citizenId: string | null;
position: string | null;
posExecutive: string | null;
guarantorRank: string | null;
posLevelId: string | null;
posTypeId: string | null;
guarantorRank?: string | null;
guarantorPrefix: string | null;
guarantorFirstName: string | null;
guarantorLastName: string | null;
guarantorCitizenId: string | null;
guarantorPosition: string | null;
guarantorPosExecutive: string | null;
posLevelguarantorId: string | null;
posTypeguarantorId: string | null;
scholarshipYear: number | null;
budgetSource: string | null;
budgetApprove: Double | null;
@ -445,44 +446,42 @@ export class CreateDevelopmentScholarship {
reportBackNoDate: Date | null;
reportBackDate: Date | null;
degreeLevel: string | null;
courseOfStudy: string | null;
fieldOfStudy: string | null;
course: string | null;
field: string | null;
faculty: string | null;
educationalInstitution: string | null;
studyStartDate: string | null;
studyEndDate: string | null;
studyTourPlace: Date | null;
studyTourTopic: Date | null;
studyTourStartDate: Date | null;
studyTourEndDate: Date | null;
studyTourCountry: string | null;
studyTourAbroadTopic: string | null;
studyTourAbroadStartDate: Date | null;
studyTourAbroadEndDate: Date | null;
totalStudyPeriod: string | null;
trainingCourseName: string | null;
trainingStartDate: Date | null;
trainingEndDate: Date | null;
totalTrainingTime: string | null;
order: string | null;
dateOrder: Date | null;
startDate: Date | null;
endDate: Date | null;
studyPlace: Date | null;
studyTopic: Date | null;
studyStartDate: Date | null;
studyEndDate: Date | null;
studyCountry: string | null;
studyAbroadTopic: string | null;
studyAbroadStartDate: Date | null;
studyAbroadEndDate: Date | null;
totalPeriod: string | null;
}
export class UpdateDevelopmentScholarship {
rank: string | null;
rank?: string | null;
prefix: string | null;
firstName: string | null;
lastName: string | null;
citizenId: string | null;
position: string | null;
posExecutive: string | null;
guarantorRank: string | null;
posLevelId: string | null;
posTypeId: string | null;
guarantorRank?: string | null;
guarantorPrefix: string | null;
guarantorFirstName: string | null;
guarantorLastName: string | null;
guarantorCitizenId: string | null;
guarantorPosition: string | null;
guarantorPosExecutive: string | null;
posLevelguarantorId: string | null;
posTypeguarantorId: string | null;
scholarshipYear: number | null;
budgetSource: string | null;
budgetApprove: Double | null;
@ -499,25 +498,19 @@ export class UpdateDevelopmentScholarship {
reportBackNoDate: Date | null;
reportBackDate: Date | null;
degreeLevel: string | null;
courseOfStudy: string | null;
fieldOfStudy: string | null;
course: string | null;
field: string | null;
faculty: string | null;
educationalInstitution: string | null;
studyStartDate: string | null;
studyEndDate: string | null;
studyTourPlace: Date | null;
studyTourTopic: Date | null;
studyTourStartDate: Date | null;
studyTourEndDate: Date | null;
studyTourCountry: string | null;
studyTourAbroadTopic: string | null;
studyTourAbroadStartDate: Date | null;
studyTourAbroadEndDate: Date | null;
totalStudyPeriod: string | null;
trainingCourseName: string | null;
trainingStartDate: Date | null;
trainingEndDate: Date | null;
totalTrainingTime: string | null;
order: string | null;
dateOrder: Date | null;
startDate: Date | null;
endDate: Date | null;
studyPlace: Date | null;
studyTopic: Date | null;
studyStartDate: Date | null;
studyEndDate: Date | null;
studyCountry: string | null;
studyAbroadTopic: string | null;
studyAbroadStartDate: Date | null;
studyAbroadEndDate: Date | null;
totalPeriod: string | null;
}

View file

@ -4,6 +4,7 @@ import { PosType } from "./PosType";
import { ActualGoal } from "./ActualGoal";
import { PlannedGoal } from "./PlannedGoal";
import { DevelopmentHistory } from "./DevelopmentHistory";
import { DevelopmentScholarship } from "./DevelopmentScholarship";
enum PosLevelAuthority {
HEAD = "HEAD",
@ -55,6 +56,18 @@ export class PosLevel extends EntityBase {
@OneToMany(() => DevelopmentHistory, (developmentHistory) => developmentHistory.posLevel)
developmentHistorys: DevelopmentHistory[];
@OneToMany(
() => DevelopmentScholarship,
(developmentScholarship) => developmentScholarship.posLevel,
)
developmentScholars: DevelopmentScholarship[];
@OneToMany(
() => DevelopmentScholarship,
(developmentScholarship) => developmentScholarship.posLevelguarantor,
)
developmentScholarGuarantors: DevelopmentScholarship[];
}
export class CreatePosLevel {

View file

@ -4,6 +4,7 @@ import { PosLevel } from "./PosLevel";
import { ActualGoal } from "./ActualGoal";
import { PlannedGoal } from "./PlannedGoal";
import { DevelopmentHistory } from "./DevelopmentHistory";
import { DevelopmentScholarship } from "./DevelopmentScholarship";
@Entity("posType")
export class PosType extends EntityBase {
@ -34,6 +35,18 @@ export class PosType extends EntityBase {
@OneToMany(() => DevelopmentHistory, (developmentHistory) => developmentHistory.posType)
developmentHistorys: DevelopmentHistory[];
@OneToMany(
() => DevelopmentScholarship,
(developmentScholarship) => developmentScholarship.posType,
)
developmentScholars: DevelopmentScholarship[];
@OneToMany(
() => DevelopmentScholarship,
(developmentScholarship) => developmentScholarship.posTypeguarantor,
)
developmentScholarGuarantors: DevelopmentScholarship[];
}
export class CreatePosType {