From 8c7cbef72b6715446b0eb9d874378b6181dbc0fd Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 22 Apr 2025 10:14:31 +0700 Subject: [PATCH] =?UTF-8?q?[Edit=20SIT=20=E0=B8=A3=E0=B8=B0=E0=B8=9A?= =?UTF-8?q?=E0=B8=9A=E0=B8=9E=E0=B8=B1=E0=B8=92=E0=B8=99=E0=B8=B2]=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=97?= =?UTF-8?q?=E0=B8=B5=E0=B9=88=E0=B8=95=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B9=81?= =?UTF-8?q?=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=20#1331?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/DevelopmentController.ts | 10 ++++--- .../DevelopmentScholarshipController.ts | 4 +-- src/controllers/ReportController.ts | 2 +- src/entities/DevelopmentAddress.ts | 26 ++++++++++++++++++- src/entities/DevelopmentScholarship.ts | 16 +++++++++--- ...ddress_and_developScholaship_add_fields.ts | 24 +++++++++++++++++ 6 files changed, 71 insertions(+), 11 deletions(-) create mode 100644 src/migration/1745290442590-update_table_developAddress_and_developScholaship_add_fields.ts diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index dadb34e..a18787a 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -2568,9 +2568,9 @@ export class DevelopmentController extends Controller { } /** - * API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab6 ส่งบันทึกทะเบียนประวัติ + * API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab6 ส่งบันทึกทะเบียนประวัติ (ข้อมูลผลงาน>การฝึกอบรม/ดูงาน) * - * @summary DEV_00 - รายละเอียดโครงการ/หลักสูตรการฝึกอบรมtab6 ส่งบันทึกทะเบียนประวัติ # + * @summary DEV_00 - รายละเอียดโครงการ/หลักสูตรการฝึกอบรมtab6 ส่งบันทึกทะเบียนประวัติ (ข้อมูลผลงาน>การฝึกอบรม/ดูงาน) # * * @param {string} id Id โครงการ */ @@ -2598,6 +2598,7 @@ export class DevelopmentController extends Controller { startDate: x.dateStart, endDate: x.dateEnd, isDate: true, + developmentId: id }) .then((x) => { _data.isDone = true; @@ -2620,6 +2621,7 @@ export class DevelopmentController extends Controller { startDate: x.dateStart, endDate: x.dateEnd, isDate: true, + developmentId: id }) .then((x) => { _data.isDone = true; @@ -2644,9 +2646,9 @@ export class DevelopmentController extends Controller { } /** - * API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab6 IDP ส่งบันทึกทะเบียนประวัติ + * API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab6 IDP ส่งบันทึกทะเบียนประวัติ (ข้อมูลผลงาน>ผลการประเมินการปฏิบัติราชการ) * - * @summary DEV_00 - รายละเอียดโครงการ/หลักสูตรการฝึกอบรมtab6 IDP ส่งบันทึกทะเบียนประวัติ # + * @summary DEV_00 - รายละเอียดโครงการ/หลักสูตรการฝึกอบรมtab6 IDP ส่งบันทึกทะเบียนประวัติ (ข้อมูลผลงาน>ผลการประเมินการปฏิบัติราชการ)# * * @param {string} id Id โครงการ */ diff --git a/src/controllers/DevelopmentScholarshipController.ts b/src/controllers/DevelopmentScholarshipController.ts index 117dfb3..54bead1 100644 --- a/src/controllers/DevelopmentScholarshipController.ts +++ b/src/controllers/DevelopmentScholarshipController.ts @@ -322,7 +322,7 @@ export class DevelopmentScholarshipController extends Controller { bookNo: getDevelopment.bookNo ? getDevelopment.bookNo : null, bookNoDate: getDevelopment.bookNoDate ? getDevelopment.bookNoDate : null, bookApproveDate: getDevelopment.bookApproveDate ? getDevelopment.bookApproveDate : null, - useOfficialTime: getDevelopment.useOfficialTime ? getDevelopment.useOfficialTime : false, + useOfficialTime: getDevelopment.useOfficialTime ? getDevelopment.useOfficialTime : null, changeDetail: getDevelopment.changeDetail ? getDevelopment.changeDetail : null, scholarshipType: getDevelopment.scholarshipType ? getDevelopment.scholarshipType : null, fundType: getDevelopment.fundType ? getDevelopment.fundType : null, @@ -484,7 +484,7 @@ export class DevelopmentScholarshipController extends Controller { bookNo: getDevelopment.bookNo ? getDevelopment.bookNo : null, bookNoDate: getDevelopment.bookNoDate ? getDevelopment.bookNoDate : null, bookApproveDate: getDevelopment.bookApproveDate ? getDevelopment.bookApproveDate : null, - useOfficialTime: getDevelopment.useOfficialTime ? getDevelopment.useOfficialTime : false, + useOfficialTime: getDevelopment.useOfficialTime ? getDevelopment.useOfficialTime : null, changeDetail: getDevelopment.changeDetail ? getDevelopment.changeDetail : null, scholarshipType: getDevelopment.scholarshipType ? getDevelopment.scholarshipType : null, fundType: getDevelopment.fundType ? getDevelopment.fundType : null, diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 7ad3c23..a6b6913 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -650,7 +650,7 @@ export class ReportController extends Controller { : Extension.ToThaiNumber(Extension.ToThaiFullDate3(getDevelopment.graduatedDate)), graduatedReason: getDevelopment.graduatedReason == null ? "" : getDevelopment.graduatedReason, useOfficialTime: getDevelopment.useOfficialTime, - useOffTime: getDevelopment.useOfficialTime == true ? "🗹 ใช้ ☐ ไม่ใช้" : "☐ ใช้ 🗹 ไม่ใช้", + useOffTime: getDevelopment.useOfficialTime == "NOUSETIME" ? "🗹 ใช้ ☐ ไม่ใช้" : "☐ ใช้ 🗹 ไม่ใช้", isGraduated: getDevelopment.isGraduated, isG1: getDevelopment.isGraduated == true ? "🗹" : "☐", isG2: getDevelopment.isGraduated == true ? "☐" : "🗹", diff --git a/src/entities/DevelopmentAddress.ts b/src/entities/DevelopmentAddress.ts index 1629293..8de2fa8 100644 --- a/src/entities/DevelopmentAddress.ts +++ b/src/entities/DevelopmentAddress.ts @@ -20,7 +20,7 @@ export class DevelopmentAddress extends EntityBase { @Column({ nullable: true, - comment: "โครงการ/หลักสูตรการฝึกอบรม", + comment: "ชื่อจังหวัด (กรณีเลือกสถานที่ดำเนินการในประเทศ)", default: null, }) provinceName: string; @@ -32,6 +32,20 @@ export class DevelopmentAddress extends EntityBase { }) developmentId: string; + @Column({ + nullable: true, + comment: "สถานที่ดำเนินการ ในประเทศ(IN_COUNTRY) หรือ ต่างประเทศ(ABROAD)", + default: null, + }) + addressType: string; + + @Column({ + nullable: true, + comment: "ชื่อประเทศ (กรณีเลือกสถานที่ดำเนินการต่างประเทศ)", + default: null, + }) + country: string; + @ManyToOne(() => Development, (development: Development) => development.developmentAddresss) @JoinColumn({ name: "developmentId" }) development: Development; @@ -39,6 +53,16 @@ export class DevelopmentAddress extends EntityBase { export class CreateDevelopmentAddress { @Column() address: string | null; + @Column() provinceId: string | null; + + @Column() + addressType?: string | null; + + @Column() + provinceName?: string | null; + + @Column() + country?: string | null; } diff --git a/src/entities/DevelopmentScholarship.ts b/src/entities/DevelopmentScholarship.ts index efa05ba..c0ef3cf 100644 --- a/src/entities/DevelopmentScholarship.ts +++ b/src/entities/DevelopmentScholarship.ts @@ -301,7 +301,7 @@ export class DevelopmentScholarship extends EntityBase { comment: "ใช้เวลาราชการ", default: false, }) - useOfficialTime: boolean; + useOfficialTime: string; @Column({ nullable: true, @@ -567,6 +567,13 @@ export class DevelopmentScholarship extends EntityBase { default: null, }) graduatedReason: string; + + @Column({ + nullable: true, + comment: "เงินอื่นๆ", + default: null, + }) + budgetSourceOther: number; } export class CreateDevelopmentScholarship { rootId: string | null; @@ -604,7 +611,7 @@ export class CreateDevelopmentScholarship { bookNo: string | null; bookNoDate: Date | null; bookApproveDate: Date | null; - useOfficialTime: boolean | false; + useOfficialTime: string | null; changeDetail: string | null; scholarshipType: string | null; fundType: string | null; @@ -631,6 +638,7 @@ export class CreateDevelopmentScholarship { totalPeriod: string | null; planType: string | null; isNoUseBudget: boolean | null; + budgetSourceOther?: number | null; } export class UpdateDevelopmentScholarship { @@ -669,7 +677,7 @@ export class UpdateDevelopmentScholarship { bookNo: string | null; bookNoDate: Date | null; bookApproveDate: Date | null; - useOfficialTime: boolean | false; + useOfficialTime: string | null; changeDetail: string | null; scholarshipType: string | null; fundType: string | null; @@ -696,6 +704,7 @@ export class UpdateDevelopmentScholarship { totalPeriod: string | null; planType: string | null; isNoUseBudget: boolean | null; + budgetSourceOther?: number | null; } export class UpdateDevelopmentScholarshipUser { @@ -706,4 +715,5 @@ export class UpdateDevelopmentScholarshipUser { isGraduated: boolean | null; graduatedDate: Date | null; graduatedReason: string | null; + budgetSourceOther?: number | null; } diff --git a/src/migration/1745290442590-update_table_developAddress_and_developScholaship_add_fields.ts b/src/migration/1745290442590-update_table_developAddress_and_developScholaship_add_fields.ts new file mode 100644 index 0000000..001ec46 --- /dev/null +++ b/src/migration/1745290442590-update_table_developAddress_and_developScholaship_add_fields.ts @@ -0,0 +1,24 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableDevelopAddressAndDevelopScholashipAddFields1745290442590 implements MigrationInterface { + name = 'UpdateTableDevelopAddressAndDevelopScholashipAddFields1745290442590' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` ADD \`budgetSourceOther\` int NULL COMMENT 'เงินอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`developmentAddress\` ADD \`addressType\` varchar(255) NULL COMMENT 'สถานที่ดำเนินการ ในประเทศ(IN_COUNTRY) หรือ ต่างประเทศ(ABROAD)'`); + await queryRunner.query(`ALTER TABLE \`developmentAddress\` ADD \`country\` varchar(255) NULL COMMENT 'ชื่อประเทศ (กรณีเลือกสถานที่ดำเนินการต่างประเทศ)'`); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` DROP COLUMN \`useOfficialTime\``); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` ADD \`useOfficialTime\` varchar(255) NOT NULL COMMENT 'ใช้เวลาราชการ' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`developmentAddress\` CHANGE \`provinceName\` \`provinceName\` varchar(255) NULL COMMENT 'ชื่อจังหวัด (กรณีเลือกสถานที่ดำเนินการในประเทศ)'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`developmentAddress\` CHANGE \`provinceName\` \`provinceName\` varchar(255) NULL COMMENT 'โครงการ/หลักสูตรการฝึกอบรม'`); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` DROP COLUMN \`useOfficialTime\``); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` ADD \`useOfficialTime\` tinyint NOT NULL COMMENT 'ใช้เวลาราชการ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`developmentAddress\` DROP COLUMN \`country\``); + await queryRunner.query(`ALTER TABLE \`developmentAddress\` DROP COLUMN \`addressType\``); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` DROP COLUMN \`budgetSourceOther\``); + } + +}