ปรับโครงาร

This commit is contained in:
Kittapath 2024-04-11 11:39:56 +07:00
parent b8e1c93cb4
commit 4f8b2cec73
10 changed files with 1317 additions and 483 deletions

View file

@ -6,9 +6,22 @@ import { CreatePlannedPeople, PlannedPeople } from "./PlannedPeople";
import { ActualGoal, CreateActualGoal } from "./ActualGoal";
import { CreatePlannedGoal, PlannedGoal } from "./PlannedGoal";
import { DevelopmentHistory } from "./DevelopmentHistory";
import { DevelopmentProjectType } from "./DevelopmentProjectType";
import { DevelopmentProjectTechnique } from "./DevelopmentProjectTechnique";
import { CreateDevelopmentEvaluation, DevelopmentEvaluation } from "./DevelopmentEvaluation";
import { CreateDevelopmentAddress, DevelopmentAddress } from "./DevelopmentAddress";
@Entity("development")
export class Development extends EntityBase {
@Column({
// กำลังดำเนินการ (ONGOING)
// เสร็จสิ้น (FINISH)
nullable: true,
comment: "สถานะ",
default: "ONGOING",
})
status: string;
////////////////////////////////////////tab ข้อมูลเบื้องต้น
@Column({
nullable: true,
comment: "ปีงบประมาณ",
@ -35,61 +48,118 @@ export class Development extends EntityBase {
})
objective: string;
////////////////////////////////////////tab เป้าหมาย
@OneToMany(
() => ActualPeople,
(actualPeople: ActualPeople) => actualPeople.developmentActualPeople,
)
developmentActualPeoples: ActualPeople[];
@OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.developmentActualGoal)
developmentActualGoals: ActualGoal[];
@OneToMany(
() => PlannedPeople,
(plannedPeople: PlannedPeople) => plannedPeople.developmentPlannedPeople,
)
developmentPlannedPeoples: PlannedPeople[];
@OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.developmentPlannedGoal)
developmentPlannedGoals: PlannedGoal[];
////////////////////////////////////////tab ลักษณะโครงการ
@OneToMany(
() => DevelopmentProjectType,
(developmentProjectType: DevelopmentProjectType) => developmentProjectType.development,
)
developmentProjectTypes: DevelopmentProjectType[];
@Column({
nullable: true,
comment: "ประเภทตัวชี้วัด",
default: null,
comment: "ไป-กลับ",
default: false,
})
metricType: string;
isBackPlanned: boolean;
@Column({
comment: "พักค้าง",
default: false,
})
isHoldPlanned: boolean;
@Column({
nullable: true,
comment: "ตัวชี้วัด",
comment: "จำนวน(วัน)(ไป-กลับ)",
default: null,
})
indicators: string;
projectDayBackPlanned: number;
@Column({
nullable: true,
comment: "เป้าหมาย",
comment: "จำนวน(วัน)(พักค้าง)",
default: null,
})
target: string;
projectDayHoldPlanned: number;
@Column({
nullable: true,
comment: "วิธีการคำนวณ/เครื่องมือ",
comment: "จำนวน(คืน)(พักค้าง)",
default: null,
})
calculation: string;
projectNigthHoldPlanned: number;
@Column({
comment: "ไป-กลับ",
default: false,
})
isBackActual: boolean;
@Column({
comment: "พักค้าง",
default: false,
})
isHoldActual: boolean;
@Column({
nullable: true,
comment: "ระยะเวลาวัดผล",
comment: "จำนวน(วัน)(ไป-กลับ)",
default: null,
})
measuRement: string;
projectDayBackActual: number;
@Column({
nullable: true,
comment: "ผลการดำเนิน",
comment: "จำนวน(วัน)(พักค้าง)",
default: null,
})
results: string;
projectDayHoldActual: number;
@Column({
nullable: true,
comment: "ปัญหาอุปสรรค",
comment: "จำนวน(คืน)(พักค้าง)",
default: null,
})
obstacles: string;
projectNigthHoldActual: number;
@OneToMany(
() => DevelopmentProjectTechnique,
(developmentProjectTechnique: DevelopmentProjectTechnique) =>
developmentProjectTechnique.development,
)
developmentProjectTechniques: DevelopmentProjectTechnique[];
@Column({
nullable: true,
comment: "ข้อเสนอเเนะ",
comment: "จำนวน(รุ่น)",
default: null,
})
suggestions: string;
projectModal: number;
////////////////////////////////////////tab ผลประเมิน
@OneToMany(
() => DevelopmentEvaluation,
(developmentEvaluation: DevelopmentEvaluation) => developmentEvaluation.development,
)
developmentEvaluations: DevelopmentEvaluation[];
@Column({
nullable: true,
@ -129,6 +199,7 @@ export class Development extends EntityBase {
})
isOutBudget: boolean;
////////////////////////////////////////tab อื่นๆ
@Column({
nullable: true,
type: "datetime",
@ -152,12 +223,11 @@ export class Development extends EntityBase {
})
totalDate: number;
@Column({
nullable: true,
comment: "ที่อยู่",
default: null,
})
address: string;
@OneToMany(
() => DevelopmentAddress,
(developmentAddress: DevelopmentAddress) => developmentAddress.development,
)
developmentAddresss: DevelopmentAddress[];
@Column({
nullable: true,
@ -166,6 +236,16 @@ export class Development extends EntityBase {
})
budget: string;
@Column({
// เงินบำรุง = MAINTENANCE
// เงินกองทุน = FUND
// เงินอุดหนุน = SUBSIDY
nullable: true,
comment: "ประเภทย่อย",
default: null,
})
budgetSub: string;
@Column({
nullable: true,
comment: "จํานวนงบประมาณที่ขอรับการจัดสรรฯ",
@ -210,14 +290,14 @@ export class Development extends EntityBase {
comment: "โอกาสที่จะเกิด",
default: null,
})
chance: string;
chance: number;
@Column({
nullable: true,
comment: "ผลกระทบจากการเกิด",
default: null,
})
effects: string;
effects: number;
@Column({
nullable: true,
@ -254,6 +334,17 @@ export class Development extends EntityBase {
})
addressAcademic: string;
@Column({
nullable: true,
comment: "จังหวัด(ข้อมูลวิชาการ)",
default: null,
})
provinceActualId: string;
@ManyToOne(() => Province, (province: Province) => province.developmentActuals)
@JoinColumn({ name: "provinceActualId" })
provinceActual: Province;
@Column({
nullable: true,
type: "datetime",
@ -270,105 +361,6 @@ export class Development extends EntityBase {
})
dateStudyEnd: Date;
@Column({
// STRATEGIC_PROJECT = โครงการตามยุทธศาสตร์
// MISSION_PROJECT = โครงการตามภารกิจประจำของหน่วยงาน
// NEW_PROJECT = โครงการใหม่
// ONGOING_PROJECT = โครงการต่อเนื่อง
nullable: true,
comment: "ประเภทโครงการ",
default: null,
})
projectType: string;
@Column({
// GO_BACK = ไป-กลับ
// HOLD = พักค้าง
// GO_BACK_HOLD = ไป-กลับและพักค้าง
nullable: true,
comment: "ลักษณะ",
default: null,
})
projectCharacteristics: string;
@Column({
nullable: true,
comment: "จำนวน(วัน)",
default: null,
})
projectDay: number;
@Column({
nullable: true,
comment: "จำนวน(คืน)",
default: null,
})
projectNigth: number;
@Column({
// TRAINING = การอบรม
// MEETING = การประชุม
// SEMINAR = การสัมมนา
// STUDY_TOUR = การศึกษาดูงาน
// ACADEMIC_SEMINAR = การสัมมนาทางวิชาการ
// WORKSHOP = การสัมมนาเชิงปฏิบัติการ
// SPECIAL_LECTURE = การบรรยายพิเศษ
// STUDY_TRAINING = การฝึกศึกษา
nullable: true,
comment: "เทคนิควิธีการที่ใช้ในการพัฒนา",
default: null,
})
projectTechniques: string;
@Column({
nullable: true,
comment: "จำนวน(รุ่น)",
default: null,
})
projectModal: number;
@Column({
// เงินบำรุง = MAINTENANCE
// เงินกองทุน = FUND
// เงินอุดหนุน = SUBSIDY
nullable: true,
comment: "ประเภทย่อย",
default: null,
})
budgetSub: string;
@Column({
nullable: true,
comment: "จังหวัด(ข้อมูลวิชาการ)",
default: null,
})
provinceActualId: string;
@ManyToOne(() => Province, (province: Province) => province.developmentActuals)
@JoinColumn({ name: "provinceActualId" })
provinceActual: Province;
@ManyToMany(() => Province, (provinces) => provinces.developmentProvinces)
provinces: Province[];
@OneToMany(
() => ActualPeople,
(actualPeople: ActualPeople) => actualPeople.developmentActualPeople,
)
developmentActualPeoples: ActualPeople[];
@OneToMany(
() => PlannedPeople,
(plannedPeople: PlannedPeople) => plannedPeople.developmentPlannedPeople,
)
developmentPlannedPeoples: PlannedPeople[];
@OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.developmentActualGoal)
developmentActualGoals: ActualGoal[];
@OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.developmentPlannedGoal)
developmentPlannedGoals: PlannedGoal[];
@OneToMany(
() => DevelopmentHistory,
(developmentHistory: DevelopmentHistory) => developmentHistory.development,
@ -380,105 +372,9 @@ export class CreateDevelopment {
year: number;
@Column()
projectName: string;
@Column()
reason: string | null;
@Column()
objective: string | null;
@Column()
metricType: string | null;
@Column()
indicators: string | null;
@Column()
target: string | null;
@Column()
calculation: string | null;
@Column()
measuRement: string | null;
@Column()
results: string | null;
@Column()
obstacles: string | null;
@Column()
suggestions: string | null;
@Column()
project: string | null;
@Column()
isPassAllocate: boolean;
@Column()
isPassNoAllocate: boolean;
@Column()
isNoPass: boolean;
@Column()
isBudget: boolean;
@Column()
isOutBudget: boolean;
@Column()
dateStart: Date | null;
@Column()
dateEnd: Date | null;
@Column()
totalDate: number | null;
@Column()
address: string | null;
@Column()
provinceIds: string[];
@Column()
budget: string | null;
@Column()
accept: Double | null;
@Column()
receive: Double | null;
@Column()
approved: Double | null;
@Column()
budgetPay: Double | null;
@Column()
issues: string | null;
@Column()
chance: string | null;
@Column()
effects: string | null;
@Column()
riskLevel: string | null;
@Column()
riskManagement: string | null;
@Column()
expect: string | null;
@Column()
topicAcademic: string | null;
@Column()
addressAcademic: string | null;
@Column()
provinceActualId: string | null;
@Column()
dateStudyStart?: Date | null;
@Column()
dateStudyEnd?: Date | null;
@Column()
projectType: string | null;
@Column()
projectCharacteristics: string | null;
@Column()
projectDay: number | null;
@Column()
projectNigth: number | null;
@Column()
projectTechniques: string | null;
@Column()
projectModal: number | null;
@Column()
budgetSub: string | null;
@Column()
actualPeoples: CreateActualPeople[];
@Column()
plannedPeoples: CreatePlannedPeople[];
@Column()
actualGoals: CreateActualGoal[];
@Column()
plannedGoals: CreatePlannedGoal[];
}
export class UpdateDevelopment {
export class UpdateDevelopment1 {
@Column()
year: number;
@Column()
@ -487,22 +383,50 @@ export class UpdateDevelopment {
reason: string | null;
@Column()
objective: string | null;
}
export class UpdateDevelopment2_1 {
@Column()
metricType: string | null;
actualGoals: CreateActualGoal[];
@Column()
indicators: string | null;
plannedGoals: CreatePlannedGoal[];
}
export class UpdateDevelopment2_2 {
@Column()
target: string | null;
actualPeoples: CreateActualPeople[];
@Column()
calculation: string | null;
plannedPeoples: CreatePlannedPeople[];
}
export class UpdateDevelopment3 {
@Column()
measuRement: string | null;
developmentProjectTypes?: string[];
@Column()
results: string | null;
isBackPlanned?: boolean | null;
@Column()
obstacles: string | null;
isHoldPlanned?: boolean | null;
@Column()
suggestions: string | null;
projectDayBackPlanned?: number | null;
@Column()
projectDayHoldPlanned?: number | null;
@Column()
projectNigthHoldPlanned?: number | null;
@Column()
isBackActual?: boolean | null;
@Column()
isHoldActual?: boolean | null;
@Column()
projectDayBackActual?: number | null;
@Column()
projectDayHoldActual?: number | null;
@Column()
projectNigthHoldActual?: number | null;
@Column()
developmentProjectTechniques?: string[];
@Column()
projectModal?: number | null;
}
export class UpdateDevelopment4 {
@Column()
developmentEvaluations: CreateDevelopmentEvaluation[];
@Column()
project: string | null;
@Column()
@ -515,6 +439,8 @@ export class UpdateDevelopment {
isBudget: boolean;
@Column()
isOutBudget: boolean;
}
export class UpdateDevelopment5 {
@Column()
dateStart: Date | null;
@Column()
@ -522,12 +448,12 @@ export class UpdateDevelopment {
@Column()
totalDate: number | null;
@Column()
address: string | null;
@Column()
provinceIds: string[];
developmentAddresss: CreateDevelopmentAddress[];
@Column()
budget: string | null;
@Column()
budgetSub: string | null;
@Column()
accept: Double | null;
@Column()
receive: Double | null;
@ -538,9 +464,9 @@ export class UpdateDevelopment {
@Column()
issues: string | null;
@Column()
chance: string | null;
chance: number | null;
@Column()
effects: string | null;
effects: number | null;
@Column()
riskLevel: string | null;
@Column()
@ -554,29 +480,7 @@ export class UpdateDevelopment {
@Column()
provinceActualId: string | null;
@Column()
dateStudyStart?: Date | null;
dateStudyStart: Date | null;
@Column()
dateStudyEnd?: Date | null;
@Column()
projectType?: string | null;
@Column()
projectCharacteristics?: string | null;
@Column()
projectDay?: number | null;
@Column()
projectNigth?: number | null;
@Column()
projectTechniques?: string | null;
@Column()
projectModal?: number | null;
@Column()
budgetSub: string | null;
@Column()
actualPeoples: CreateActualPeople[];
@Column()
plannedPeoples: CreatePlannedPeople[];
@Column()
actualGoals: CreateActualGoal[];
@Column()
plannedGoals: CreatePlannedGoal[];
dateStudyEnd: Date | null;
}