import mis

This commit is contained in:
mamoss 2025-05-21 08:16:21 +07:00
parent 60a72243e8
commit 083a482b3a
26 changed files with 4711 additions and 0 deletions

View file

@ -73,6 +73,25 @@ import { HR_CHILDEN } from "../entities/HR_CHILDEN";
import { HR_CHILDEN_EMP } from "../entities/HR_CHILDEN_EMP";
import { HR_CHANGENAME } from "../entities/HR_CHANGENAME";
import { HR_CHANGENAME_EMP } from "../entities/HR_CHANGENAME_EMP";
import { ProfileHonor } from "../entities/ProfileHonor";
import { ProfileAbility } from "../entities/ProfileAbility";
import { ProfileDuty } from "../entities/ProfileDuty";
import { ProfileNopaid } from "../entities/ProfileNopaid";
import { ProfileOther } from "../entities/ProfileOther";
import { ProfileCertificate } from "../entities/ProfileCertificate";
import { ProfileAbilitys } from "../entities/ProfileAbilitys";
import { ProfileCertificates } from "../entities/ProfileCertificates";
import { ProfileDutys } from "../entities/ProfileDutys";
import { ProfileHonors } from "../entities/ProfileHonors";
import { ProfileNopaids } from "../entities/ProfileNopaids";
import { ProfileOthers } from "../entities/ProfileOthers";
import { ProfileDisciplines } from "../entities/ProfileDisciplines";
import { ProfileChangeNames } from "../entities/ProfileChangeNames";
import { ProfileChildrens } from "../entities/ProfileChildrens";
import { ProfileEducations } from "../entities/ProfileEducations";
import { ProfileInsignias } from "../entities/ProfileInsignias";
import { ProfileLeave } from "../entities/ProfileLeave";
import { ProfileLeaves } from "../entities/ProfileLeaves";
@Route("api/v1/org/upload")
@Tags("UPLOAD")
@Security("bearerAuth")
@ -140,6 +159,31 @@ export class ImportDataController extends Controller {
private posMasterEmpRepo = AppDataSource.getRepository(EmployeePosMaster);
private posExecutiveRepo = AppDataSource.getRepository(PosExecutive);
private insigniaRepo = AppDataSource.getRepository(Insignia);
private ProfileHonorsRepo = AppDataSource.getRepository(ProfileHonors);
private HonorRepo = AppDataSource.getRepository(ProfileHonor);
private ProfileOthersRepo = AppDataSource.getRepository(ProfileOthers);
private OtherRepo = AppDataSource.getRepository(ProfileOther);
private ProfileNopaidsRepo = AppDataSource.getRepository(ProfileNopaids);
private NopaidRepo = AppDataSource.getRepository(ProfileNopaid);
private ProfileAbilitysRepo = AppDataSource.getRepository(ProfileAbilitys);
private AbilityRepo = AppDataSource.getRepository(ProfileAbility);
private ProfileDutysRepo = AppDataSource.getRepository(ProfileDutys);
private DutyRepo = AppDataSource.getRepository(ProfileDuty);
private ProfileDisciplinesRepo = AppDataSource.getRepository(ProfileDisciplines);
private DisciplineRepo = AppDataSource.getRepository(ProfileDiscipline);
private ProfileCertificatesRepo = AppDataSource.getRepository(ProfileCertificates);
private CertificateRepo = AppDataSource.getRepository(ProfileCertificate);
private ProfileChangeNamesRepo = AppDataSource.getRepository(ProfileChangeNames);
private ChangeNameRepo = AppDataSource.getRepository(ProfileChangeName);
private ProfileChildrensRepo = AppDataSource.getRepository(ProfileChildrens);
private ChildrenRepo = AppDataSource.getRepository(ProfileChildren);
private ProfileEducationsRepo = AppDataSource.getRepository(ProfileEducations);
private EducationRepo = AppDataSource.getRepository(ProfileEducation);
private ProfileLeaveSummarysRepo = AppDataSource.getRepository(ProfileLeaves);
private LeaveSummaryRepo = AppDataSource.getRepository(ProfileLeave);
private ProfileInsigniasRepo = AppDataSource.getRepository(ProfileInsignias);
private InsigniaRepo = AppDataSource.getRepository(ProfileInsignia);
/**
* @summary
*/
@ -4112,4 +4156,594 @@ export class ImportDataController extends Controller {
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileHonor-OfficerEntry")
async UploadFileSQLHonorEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileHonorsRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileHonor();
profile.profileId = item.id;
profile.detail = _item.detail;
profile.issueDate = _item.issueDate;
profile.issuer = _item.issuer;
profile.refCommandDate = _item.refCommandDate;
profile.refCommandNo = _item.refCommandNo;
profile.isDate = _item.isDate;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.HonorRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileOther-OfficerEntry")
async UploadFileSQLOtherEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileOthersRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileOther();
profile.profileId = item.id;
profile.detail = _item.detail;
profile.date = _item.date;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.OtherRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileNopaid-OfficerEntry")
async UploadFileSQLNopaidEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileNopaidsRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileNopaid();
profile.profileId = item.id;
profile.date = _item.date;
profile.detail = _item.detail;
profile.reference = _item.reference;
profile.refCommandDate = _item.refCommandDate;
profile.refCommandNo = _item.refCommandNo;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.NopaidRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileAbility-OfficerEntry")
async UploadFileSQLAbilityEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileAbilitysRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileAbility();
profile.profileId = item.id;
profile.remark = _item.remark;
profile.detail = _item.detail;
profile.reference = _item.reference;
profile.dateStart = _item.dateStart;
profile.dateEnd = _item.dateEnd;
profile.field = _item.field;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.AbilityRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileDuty-OfficerEntry")
async UploadFileSQLDutyEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileDutysRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileDuty();
profile.profileId = item.id;
profile.dateStart = _item.dateStart;
profile.dateEnd = _item.dateEnd;
profile.detail = _item.detail;
profile.reference = _item.reference;
profile.refCommandDate = _item.refCommandDate;
profile.refCommandNo = _item.refCommandNo;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.DutyRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileDiscipline-OfficerEntry")
async UploadFileSQLDisciplineEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileDisciplinesRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileDiscipline();
profile.profileId = item.id;
profile.date = _item.date;
profile.level = _item.level;
profile.detail = _item.detail;
profile.refCommandDate = _item.refCommandDate;
profile.refCommandNo = _item.refCommandNo;
profile.unStigma = _item.unStigma;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.DisciplineRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileCertificate-OfficerEntry")
async UploadFileSQLCertificateEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileCertificatesRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileCertificate();
profile.profileId = item.id;
profile.expireDate = _item.expireDate;
profile.issueDate = _item.issueDate;
profile.certificateNo = _item.certificateNo;
profile.certificateType = _item.certificateType;
profile.issuer = _item.issuer;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.CertificateRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary -
*/
@Post("uploadProfileChangeName-OfficerEntry")
async UploadFileSQLChangeNameEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileChangeNamesRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileChangeName();
profile.profileId = item.id;
profile.prefix = _item.prefix;
profile.firstName = _item.firstName;
profile.lastName = _item.lastName;
profile.status = _item.status;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.ChangeNameRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileChildren-OfficerEntry")
async UploadFileSQLChildrenEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileChildrensRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileChildren();
profile.profileId = item.id;
profile.childrenCareer = _item.childrenCareer;
profile.childrenFirstName = _item.childrenFirstName;
profile.childrenLastName = _item.childrenLastName;
profile.childrenPrefix = _item.childrenPrefix;
profile.childrenLive = _item.childrenLive;
profile.childrenCitizenId = _item.childrenCitizenId;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.ChildrenRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileEducation-OfficerEntry")
async UploadFileSQLEducationEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.profileRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
// const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.ProfileEducationsRepo.find({
where: { createdFullName: _item.citizenId },
order: {
startDate: "ASC",
},
});
const eduLevel = await this.profileEducationRepo.findOne({
where: { profileId: _item.id },
order: {
startDate: "DESC",
},
});
let order = 1;
if (eduLevel != null) {
order = eduLevel.level + 1;
}
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileEducation();
profile.profileId = _item.id;
profile.country = item.country;
profile.degree = item.degree;
profile.duration = item.duration;
profile.durationYear = item.durationYear;
profile.field = item.field;
profile.finishDate = item.finishDate;
profile.fundName = item.fundName;
profile.gpa = item.gpa;
profile.institute = item.institute;
profile.other = item.other;
profile.startDate = item.startDate;
profile.endDate = item.endDate;
profile.educationLevel = item.educationLevel;
// profile.educationLevelId = item.educationLevelId;
profile.positionPath = item.positionPath;
profile.note = item.note;
profile.positionPathId = item.positionPathId;
profile.isDate = item.isDate;
profile.isEducation = item.isEducation;
profile.level = order;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.EducationRepo.save(profile);
order = order + 1;
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileInsignia-OfficerEntry")
async UploadFileSQLInsigniaEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileInsigniasRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileInsignia();
profile.profileId = item.id;
profile.year = _item.year;
profile.no = _item.no;
profile.volume = _item.volume;
profile.section = _item.section;
profile.page = _item.page;
profile.receiveDate = _item.receiveDate;
profile.dateAnnounce = _item.dateAnnounce;
profile.issue = _item.issue;
profile.volumeNo = _item.volumeNo;
profile.refCommandDate = _item.refCommandDate;
profile.refCommandNo = _item.refCommandNo;
profile.note = _item.note;
profile.insigniaId = _item.insigniaId;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.InsigniaRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
/**
* @summary
*/
@Post("uploadProfileLeaveSummary-OfficerEntry")
async UploadFileSQLLeaveSummaryEntry(@Request() request: { user: Record<string, any> }) {
let rowCount = 0;
let _null: any = null;
const existingProfile = await this.ProfileLeaveSummarysRepo.find({
// order: {
// citizenId: "ASC",
// },
});
for await (const _item of existingProfile) {
const citizenId: any = _item.createdFullName ?? "";
const profiles = await this.profileRepo.find({
where: { citizenId: citizenId },
// order: {
// Order: "ASC",
// },
});
let order = 1;
for await (const item of profiles) {
rowCount++;
const profile: any = new ProfileLeave();
profile.profileId = item.id;
// profile.totalLeave = _item.insigniaId;
profile.status = "approve";
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
// profile.totalLeave = _item.insigniaId;
profile.isEntry = true;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date().toISOString().split("T")[0];
profile.lastUpdatedAt = new Date().toISOString().split("T")[0];
await this.LeaveSummaryRepo.save(profile);
console.log("profiles successfully written to Profile.csv: " + rowCount);
}
order = 1;
}
return new HttpSuccess();
}
}

View file

@ -76,6 +76,13 @@ export class ProfileAbility extends EntityBase {
})
profileEmployeeId: string;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: null,
})
isEntry: boolean;
@OneToMany(
() => ProfileAbilityHistory,
(profileAbilityHistory) => profileAbilityHistory.histories,

View file

@ -0,0 +1,53 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileAbilitys")
export class ProfileAbilitys extends EntityBase {
@Column({
nullable: true,
comment: "หมายเหตุ",
type: "text",
default: null,
})
remark: string;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง",
type: "text",
default: null,
})
reference: string;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่เริ่มต้น",
default: null,
})
dateStart: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่สิ้นสุด",
default: null,
})
dateEnd: Date;
@Column({
nullable: true,
comment: "ด้าน",
type: "text",
default: null,
})
field: string;
}

View file

@ -68,6 +68,13 @@ export class ProfileCertificate extends EntityBase {
})
isUpload: boolean;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(
() => ProfileCertificateHistory,
(profileCertificateHistory) => profileCertificateHistory.histories,

View file

@ -0,0 +1,45 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileCertificates")
export class ProfileCertificates extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วันที่หมดอายุ",
default: null,
})
expireDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่ออกใบอนุญาต",
default: null,
})
issueDate: Date;
@Column({
nullable: true,
comment: "เลขที่ใบอนุญาต",
length: 20,
default: null,
})
certificateNo: string;
@Column({
nullable: true,
comment: "ชื่อใบอนุญาต",
length: 100,
default: null,
})
certificateType: string;
@Column({
nullable: true,
comment: "หน่วยงานผู้ออกใบอนุญาต",
length: 200,
default: null,
})
issuer: string;
}

View file

@ -70,6 +70,13 @@ export class ProfileChangeName extends EntityBase {
})
profileEmployeeId: string;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(
() => ProfileChangeNameHistory,
(profileChangeNameHistory) => profileChangeNameHistory.histories,

View file

@ -0,0 +1,37 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileChangeNames")
export class ProfileChangeNames extends EntityBase {
@Column({
nullable: true,
length: 40,
comment: "คำนำหน้า",
default: null,
})
prefix: string;
@Column({
nullable: true,
length: 100,
comment: "ชื่อ",
default: null,
})
firstName: string;
@Column({
nullable: true,
length: 100,
comment: "นามสกุล",
default: null,
})
lastName: string;
@Column({
nullable: true,
length: 100,
comment: "สถานะ",
default: null,
})
status: string;
}

View file

@ -66,6 +66,13 @@ export class ProfileChildren extends EntityBase {
})
profileEmployeeId: string;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@ManyToOne(() => Profile, (Profile) => Profile.profileChildrens)
@JoinColumn({ name: "profileId" })
profile: Profile;

View file

@ -0,0 +1,48 @@
import { Column, Entity } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileChildrens")
export class ProfileChildrens extends EntityBase {
@Column({
nullable: true,
default: null,
comment: "อาชีพบุตร",
})
childrenCareer: string;
@Column({
nullable: true,
default: null,
comment: "ชื่อบุตร",
})
childrenFirstName: string;
@Column({
nullable: true,
default: null,
comment: "นามสกุลบุตร",
})
childrenLastName: string;
@Column({
nullable: true,
default: null,
comment: "คำนำหน้าบุตร",
})
childrenPrefix: string;
@Column({
nullable: true,
default: null,
type: "boolean",
comment: "มีชีวิตบุตร",
})
childrenLive: boolean;
@Column({
nullable: true,
default: null,
comment: "เลขที่บัตรประชาชนบุตร",
})
childrenCitizenId: string;
}

View file

@ -76,6 +76,13 @@ export class ProfileDiscipline extends EntityBase {
})
isUpload: boolean;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(
() => ProfileDisciplineHistory,
(profileDisciplineHistory) => profileDisciplineHistory.histories,

View file

@ -0,0 +1,53 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileDisciplines")
export class ProfileDisciplines extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วันที่",
default: null,
})
date: Date;
@Column({
nullable: true,
comment: "ระดับความผิด",
type: "text",
default: null,
})
level: string;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "ล้างมลทิน",
type: "text",
default: null,
})
unStigma: string;
}

View file

@ -76,6 +76,13 @@ export class ProfileDuty extends EntityBase {
})
isUpload: boolean;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(() => ProfileDutyHistory, (profileDutyHistory) => profileDutyHistory.histories)
profileDutyHistories: ProfileDutyHistory[];

View file

@ -0,0 +1,53 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileDutys")
export class ProfileDutys extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "เริ่มต้น",
default: null,
})
dateStart: Date;
@Column({
nullable: true,
type: "datetime",
comment: "สิ้นสุด",
default: null,
})
dateEnd: Date;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง",
type: "text",
default: null,
})
reference: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
}

View file

@ -190,6 +190,13 @@ export class ProfileEducation extends EntityBase {
})
level: number;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(
() => ProfileEducationHistory,
(profileEducationHistory) => profileEducationHistory.histories,

View file

@ -0,0 +1,152 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileEducations")
export class ProfileEducations extends EntityBase {
@Column({
nullable: true,
comment: "ประเทศ",
length: 1000,
default: null,
})
country: string;
@Column({
nullable: true,
comment: "วุฒิการศึกษา",
length: 200,
default: null,
})
degree: string;
@Column({
nullable: true,
comment: "ระยะเวลา",
length: 1000,
default: null,
})
duration: string;
@Column({
comment: "ระยะเวลาหลักสูตร",
nullable: true,
})
durationYear: number;
@Column({
nullable: true,
comment: "สาขาวิชา/ทาง",
length: 200,
default: null,
})
field: string;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่สำเร็จการศึกษา",
default: null,
})
finishDate: Date;
@Column({
nullable: true,
comment: "ทุน",
length: 1000,
default: null,
})
fundName: string;
@Column({
nullable: true,
comment: "เกรดเฉลี่ย",
length: 20,
default: null,
})
gpa: string;
@Column({
nullable: true,
comment: "สถานศึกษา",
length: 1000,
default: null,
})
institute: string;
@Column({
nullable: true,
comment: "ข้อมูลการติดต่อ",
length: 1000,
default: null,
})
other: string;
@Column({
nullable: true,
type: "datetime",
comment: "ตั้งแต่",
default: null,
})
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "ถึง",
default: null,
})
endDate: Date;
@Column({
nullable: true,
comment: "ระดับศึกษา",
type: "text", // ใช้ "text" แทน "string" เพื่อรองรับ long text
default: null,
})
educationLevel: string;
@Column({
nullable: true,
length: 40,
comment: "Id ระดับศึกษา",
default: null,
})
educationLevelId: string;
@Column({
nullable: true,
comment: "เป็นวุฒิการศึกษาในตำแหน่ง",
type: "text",
default: null,
})
positionPath: string;
@Column({
nullable: true,
comment: "หมายเหตุ",
default: null,
})
note: string;
@Column({
nullable: true,
length: 40,
comment: "Id เป็นวุฒิการศึกษาในตำแหน่ง",
default: null,
})
positionPathId: string;
@Column({
nullable: true,
comment: "ประเภทช่วงเวลาการศึกษา",
default: null,
})
isDate: boolean;
@Column({
nullable: true,
comment: "เป็นวุฒิศึกษาในตำแหน่ง",
default: null,
})
isEducation: boolean;
}

View file

@ -83,6 +83,13 @@ export class ProfileHonor extends EntityBase {
})
isUpload: boolean;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(() => ProfileHonorHistory, (profileHonorHistory) => profileHonorHistory.histories)
profileHonorHistories: ProfileHonorHistory[];

View file

@ -0,0 +1,60 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileHonors")
export class ProfileHonors extends EntityBase {
@Column({
nullable: true,
length: 2000,
comment: "รายละเอียด",
default: null,
})
detail: string;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่ได้รับ",
default: null,
})
issueDate: Date;
@Column({
nullable: true,
length: 200,
comment: "หน่วยงานที่ออก ",
default: null,
})
issuer: string;
// @Column({
// nullable: true,
// length: 200,
// comment: "ประเภท",
// default: null,
// })
// type: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "ประเภทช่วงเวลา",
default: null,
})
isDate: boolean;
}

View file

@ -131,6 +131,13 @@ export class ProfileInsignia extends EntityBase {
})
insigniaId: string;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@ManyToOne(() => Insignia, (v) => v.profileInsignias)
insignia: Insignia;

View file

@ -0,0 +1,106 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileInsignias")
export class ProfileInsignias extends EntityBase {
@Column({
nullable: true,
comment: "ปีที่ยื่นขอ",
default: null,
})
year: number;
@Column({
nullable: true,
length: 20,
comment: "ลำดับที่",
default: null,
})
no: string;
@Column({
nullable: true,
length: 30,
comment: "เล่ม",
default: null,
})
volume: string;
@Column({
nullable: true,
length: 30,
comment: "ตอน",
default: null,
})
section: string;
@Column({
nullable: true,
length: 30,
comment: "หน้า",
default: null,
})
page: string;
@Column({
nullable: true,
type: "datetime",
comment: "ลงวันที่",
default: null,
})
receiveDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่ประกาศในราชกิจจาฯ",
default: null,
})
dateAnnounce: Date;
@Column({
nullable: true,
length: 300,
comment: "ราชกิจจาฯ ฉบับที่",
default: null,
})
issue: string;
@Column({
nullable: true,
length: 30,
comment: "เล่มที่",
default: null,
})
volumeNo: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "หมายเหตุ",
default: null,
})
note: string;
@Column({
nullable: true,
comment: "หมายเหตุ",
default: null,
})
insigniaId: string;
}

View file

@ -94,6 +94,13 @@ export class ProfileLeave extends EntityBase {
})
leaveId: string;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(() => ProfileLeaveHistory, (v) => v.profileLeave)
histories: ProfileLeaveHistory[];

View file

@ -0,0 +1,61 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileLeaveSummary")
export class ProfileLeaves extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วัน เดือน ปี ที่เริ่มลา",
default: null,
})
dateLeaveStart: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วัน เดือน ปี ที่สิ้นสุดลา",
default: null,
})
dateLeaveEnd: Date;
@Column({
nullable: true,
type: "double",
comment: "จำนวนวันลา",
default: null,
})
leaveDays: number;
@Column({
nullable: true,
type: "double",
comment: "ลามาเเล้ว",
default: null,
})
leaveCount: number;
@Column({
nullable: true,
type: "double",
comment: "รวมเป็น",
default: null,
})
totalLeave: number;
@Column({
nullable: true,
comment: "สถานะ",
type: "text",
default: null,
})
status: string;
@Column({
nullable: true,
comment: "เหตุผล",
type: "text",
default: null,
})
reason: string;
}

View file

@ -68,6 +68,13 @@ export class ProfileNopaid extends EntityBase {
})
isUpload: boolean;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(() => ProfileNopaidHistory, (profileNopaidHistory) => profileNopaidHistory.histories)
profileNopaidHistories: ProfileNopaidHistory[];

View file

@ -0,0 +1,45 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileNopaids")
export class ProfileNopaids extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วัน เดือน ปี",
default: null,
})
date: Date;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง",
type: "text",
default: null,
})
reference: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
}

View file

@ -38,6 +38,13 @@ export class ProfileOther extends EntityBase {
})
date: Date;
@Column({
nullable: false,
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
@OneToMany(() => ProfileOtherHistory, (profileOtherHistory) => profileOtherHistory.histories)
profileOtherHistories: ProfileOtherHistory[];

View file

@ -0,0 +1,21 @@
import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileOthers")
export class ProfileOthers extends EntityBase {
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่",
default: null,
})
date: Date;
}

File diff suppressed because one or more lines are too long