fix entity and api
This commit is contained in:
parent
f793c2465b
commit
c0f6c5ab9d
3 changed files with 183 additions and 43 deletions
|
|
@ -295,7 +295,7 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
async GetDevelopemtHistoryById(@Path() id: string) {
|
async GetDevelopemtHistoryById(@Path() id: string) {
|
||||||
const type = "EMPLOYEE";
|
const type = "EMPLOYEE";
|
||||||
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
||||||
relations: ["development"],
|
relations: ["development","employeePosLevel","employeePosType"],
|
||||||
where: { id: id, type: type },
|
where: { id: id, type: type },
|
||||||
});
|
});
|
||||||
if (!getDevelopment) {
|
if (!getDevelopment) {
|
||||||
|
|
@ -310,7 +310,9 @@ export class DevelopmentEmployeeHistoryController extends Controller {
|
||||||
citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null,
|
citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null,
|
||||||
position: getDevelopment.position ? getDevelopment.position : null,
|
position: getDevelopment.position ? getDevelopment.position : null,
|
||||||
posLevelId: getDevelopment.employeePosLevelId ? getDevelopment.employeePosLevelId : null,
|
posLevelId: getDevelopment.employeePosLevelId ? getDevelopment.employeePosLevelId : null,
|
||||||
|
posLevelName: getDevelopment.employeePosLevel.posLevelName ? getDevelopment.employeePosLevel.posLevelName : null,
|
||||||
posTypeId: getDevelopment.employeePosTypeId ? getDevelopment.employeePosTypeId : null,
|
posTypeId: getDevelopment.employeePosTypeId ? getDevelopment.employeePosTypeId : null,
|
||||||
|
posTypeName: getDevelopment.employeePosType.posTypeName ? getDevelopment.employeePosType.posTypeName : null,
|
||||||
developmentId: getDevelopment.developmentId ? getDevelopment.developmentId : null,
|
developmentId: getDevelopment.developmentId ? getDevelopment.developmentId : null,
|
||||||
order: getDevelopment.order ? getDevelopment.order : null,
|
order: getDevelopment.order ? getDevelopment.order : null,
|
||||||
dateOrder: getDevelopment.dateOrder ? getDevelopment.dateOrder : null,
|
dateOrder: getDevelopment.dateOrder ? getDevelopment.dateOrder : null,
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
async GetDevelopemtHistoryById(@Path() id: string) {
|
async GetDevelopemtHistoryById(@Path() id: string) {
|
||||||
const type = "OFFICER";
|
const type = "OFFICER";
|
||||||
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
const getDevelopment = await this.developmentHistoryRepository.findOne({
|
||||||
relations: ["development"],
|
relations: ["development","posLevel","posType"],
|
||||||
where: { id: id, type: type },
|
where: { id: id, type: type },
|
||||||
});
|
});
|
||||||
if (!getDevelopment) {
|
if (!getDevelopment) {
|
||||||
|
|
@ -306,7 +306,9 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
||||||
citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null,
|
citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null,
|
||||||
position: getDevelopment.position ? getDevelopment.position : null,
|
position: getDevelopment.position ? getDevelopment.position : null,
|
||||||
posLevelId: getDevelopment.posLevelId ? getDevelopment.posLevelId : null,
|
posLevelId: getDevelopment.posLevelId ? getDevelopment.posLevelId : null,
|
||||||
|
posLevelName: getDevelopment.posLevel.posLevelName ? getDevelopment.posLevel.posLevelName : null,
|
||||||
posTypeId: getDevelopment.posTypeId ? getDevelopment.posTypeId : null,
|
posTypeId: getDevelopment.posTypeId ? getDevelopment.posTypeId : null,
|
||||||
|
posTypeName: getDevelopment.posType.posTypeName ? getDevelopment.posType.posTypeName : null,
|
||||||
developmentId: getDevelopment.developmentId ? getDevelopment.developmentId : null,
|
developmentId: getDevelopment.developmentId ? getDevelopment.developmentId : null,
|
||||||
order: getDevelopment.order ? getDevelopment.order : null,
|
order: getDevelopment.order ? getDevelopment.order : null,
|
||||||
dateOrder: getDevelopment.dateOrder ? getDevelopment.dateOrder : null,
|
dateOrder: getDevelopment.dateOrder ? getDevelopment.dateOrder : null,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { EntityBase } from "./base/Base";
|
||||||
|
|
||||||
@Entity("developmentScholarship")
|
@Entity("developmentScholarship")
|
||||||
export class DevelopmentScholarship extends EntityBase {
|
export class DevelopmentScholarship extends EntityBase {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ยศ",
|
comment: "ยศ",
|
||||||
|
|
@ -238,7 +237,134 @@ export class DevelopmentScholarship extends EntityBase {
|
||||||
})
|
})
|
||||||
reportBackDate: Date;
|
reportBackDate: Date;
|
||||||
|
|
||||||
//เพิ่มต่อจากนี้
|
@Column({
|
||||||
|
//ปริญญาตรี = BACHELOR , ปริญญาโท = GRADUATE , ปริญญาเอก = MASTER , ปริญญาดุษฎีบัณฑิต = DOCTOR
|
||||||
|
nullable: true,
|
||||||
|
comment: "ระดับปริญญา",
|
||||||
|
length: 10,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
degreeLevel: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "หลักสูตรการศึกษา",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
courseOfStudy: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "สาขาวิชา",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
fieldOfStudy: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "คณะ",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
faculty: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "สถาบันการศึกษา",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
educationalInstitution: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "วันเริ่มต้นการศึกษา",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyStartDate: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "วันสิ้นสุดการศึกษา",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyEndDate: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "สถานที่ไปศึกษาดูงาน",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourPlace: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "หัวข้อการไปศึกษาดูงาน",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourTopic: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันเริ่มต้นการศึกษาดูงาน",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourStartDate: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันสิ้นสุดการศึกษาดูงาน",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourEndDate: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ประเทศที่เดินทางไปศึกษาดูงาน",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourCountry: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "หัวข้อการไปศึกษาดูงานต่างประเทศ",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourAbroadTopic: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันเริ่มต้นการศึกษาดูงานต่างประเทศ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourAbroadStartDate: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันสิ้นสุดการศึกษาดูงานต่างประเทศ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
studyTourAbroadEndDate: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "รวมระยะเวลาในการศึกษา",
|
||||||
|
length: 40,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
totalStudyPeriod: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -248,18 +374,10 @@ export class DevelopmentScholarship extends EntityBase {
|
||||||
})
|
})
|
||||||
trainingCourseName: string;
|
trainingCourseName: string;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
comment: "สถาบันการศึกษา/หน่วยงานผู้จัดการฝึกอบรม",
|
|
||||||
length: 255,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
trainingplaceName: string;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "date",
|
type: "date",
|
||||||
comment: "วันที่เริ่มต้นการฝึกอบรม",
|
comment: "วันเริ่มต้นการฝึกอบรม",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
trainingStartDate: Date;
|
trainingStartDate: Date;
|
||||||
|
|
@ -267,26 +385,18 @@ export class DevelopmentScholarship extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "date",
|
type: "date",
|
||||||
comment: "วันที่สิ้นสุดการฝึกอบรม",
|
comment: "วันสิ้นสุดการฝึกอบรม",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
trainingEndDate: Date;
|
trainingEndDate: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "datetime",
|
comment: "รวมระยะเวลาในการฝึกอบรม",
|
||||||
comment: "สถานที่ศึกษาดูงาน",
|
length: 40,
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
studyTourPlace: Date;
|
totalTrainingTime: string;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
type: "datetime",
|
|
||||||
comment: "หัวข้อไปศึกษาดูงาน",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
studyTourTopic: Date;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -304,7 +414,7 @@ export class DevelopmentScholarship extends EntityBase {
|
||||||
})
|
})
|
||||||
dateOrder: Date;
|
dateOrder: Date;
|
||||||
}
|
}
|
||||||
export class CreateDevelopmentHistory {
|
export class CreateDevelopmentScholarship {
|
||||||
rank: string | null;
|
rank: string | null;
|
||||||
prefix: string | null;
|
prefix: string | null;
|
||||||
firstName: string | null;
|
firstName: string | null;
|
||||||
|
|
@ -312,7 +422,6 @@ export class CreateDevelopmentHistory {
|
||||||
citizenId: string | null;
|
citizenId: string | null;
|
||||||
position: string | null;
|
position: string | null;
|
||||||
posExecutive: string | null;
|
posExecutive: string | null;
|
||||||
guarantorType: string | null;
|
|
||||||
guarantorRank: string | null;
|
guarantorRank: string | null;
|
||||||
guarantorPrefix: string | null;
|
guarantorPrefix: string | null;
|
||||||
guarantorFirstName: string | null;
|
guarantorFirstName: string | null;
|
||||||
|
|
@ -324,7 +433,7 @@ export class CreateDevelopmentHistory {
|
||||||
budgetSource: string | null;
|
budgetSource: string | null;
|
||||||
budgetApprove: Double | null;
|
budgetApprove: Double | null;
|
||||||
bookNo: string | null;
|
bookNo: string | null;
|
||||||
bookDate: Date | null;
|
bookNoDate: Date | null;
|
||||||
bookApproveDate: Date | null;
|
bookApproveDate: Date | null;
|
||||||
useOfficialTime: boolean | null;
|
useOfficialTime: boolean | null;
|
||||||
changeDetail: string | null;
|
changeDetail: string | null;
|
||||||
|
|
@ -335,17 +444,31 @@ export class CreateDevelopmentHistory {
|
||||||
reportBackNo: string | null;
|
reportBackNo: string | null;
|
||||||
reportBackNoDate: Date | null;
|
reportBackNoDate: Date | null;
|
||||||
reportBackDate: Date | null;
|
reportBackDate: Date | null;
|
||||||
trainingCourseName: string | null;
|
degreeLevel: string | null;
|
||||||
trainingplaceName: string | null;
|
courseOfStudy: string | null;
|
||||||
trainingStartDate: Date | null;
|
fieldOfStudy: string | null;
|
||||||
trainingEndtDate: Date | null;
|
faculty: string | null;
|
||||||
order: string | null;
|
educationalInstitution: string | null;
|
||||||
dateOrder: Date | null;
|
studyStartDate: string | null;
|
||||||
|
studyEndDate: string | null;
|
||||||
studyTourPlace: Date | null;
|
studyTourPlace: Date | null;
|
||||||
studyTourTopic: 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UpdateDevelopmentHistory {
|
export class UpdateDevelopmentScholarship {
|
||||||
rank: string | null;
|
rank: string | null;
|
||||||
prefix: string | null;
|
prefix: string | null;
|
||||||
firstName: string | null;
|
firstName: string | null;
|
||||||
|
|
@ -353,7 +476,6 @@ export class UpdateDevelopmentHistory {
|
||||||
citizenId: string | null;
|
citizenId: string | null;
|
||||||
position: string | null;
|
position: string | null;
|
||||||
posExecutive: string | null;
|
posExecutive: string | null;
|
||||||
guarantorType: string | null;
|
|
||||||
guarantorRank: string | null;
|
guarantorRank: string | null;
|
||||||
guarantorPrefix: string | null;
|
guarantorPrefix: string | null;
|
||||||
guarantorFirstName: string | null;
|
guarantorFirstName: string | null;
|
||||||
|
|
@ -365,7 +487,7 @@ export class UpdateDevelopmentHistory {
|
||||||
budgetSource: string | null;
|
budgetSource: string | null;
|
||||||
budgetApprove: Double | null;
|
budgetApprove: Double | null;
|
||||||
bookNo: string | null;
|
bookNo: string | null;
|
||||||
bookDate: Date | null;
|
bookNoDate: Date | null;
|
||||||
bookApproveDate: Date | null;
|
bookApproveDate: Date | null;
|
||||||
useOfficialTime: boolean | null;
|
useOfficialTime: boolean | null;
|
||||||
changeDetail: string | null;
|
changeDetail: string | null;
|
||||||
|
|
@ -376,12 +498,26 @@ export class UpdateDevelopmentHistory {
|
||||||
reportBackNo: string | null;
|
reportBackNo: string | null;
|
||||||
reportBackNoDate: Date | null;
|
reportBackNoDate: Date | null;
|
||||||
reportBackDate: Date | null;
|
reportBackDate: Date | null;
|
||||||
trainingCourseName: string | null;
|
degreeLevel: string | null;
|
||||||
trainingplaceName: string | null;
|
courseOfStudy: string | null;
|
||||||
trainingStartDate: Date | null;
|
fieldOfStudy: string | null;
|
||||||
trainingEndtDate: Date | null;
|
faculty: string | null;
|
||||||
order: string | null;
|
educationalInstitution: string | null;
|
||||||
dateOrder: Date | null;
|
studyStartDate: string | null;
|
||||||
|
studyEndDate: string | null;
|
||||||
studyTourPlace: Date | null;
|
studyTourPlace: Date | null;
|
||||||
studyTourTopic: 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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue