import data

This commit is contained in:
kittapath 2025-03-03 14:52:29 +07:00
parent f800e74379
commit a11b6f152c
7 changed files with 502 additions and 283 deletions

View file

@ -47,6 +47,10 @@ import { OFFICER } from "../entities/OFFICER";
import { Position } from "../entities/Position"; import { Position } from "../entities/Position";
import { PosMaster } from "../entities/PosMaster"; import { PosMaster } from "../entities/PosMaster";
import { positionOfficer } from "../entities/positionOfficer"; import { positionOfficer } from "../entities/positionOfficer";
import { PosExecutive } from "../entities/PosExecutive";
import { EducationLevel } from "../entities/EducationLevel";
import { HR_FUND_COURSE_CODE } from "../entities/HR_FUND_COURSE_CODE";
import { HR_MAJOR_CODE } from "../entities/HR_MAJOR_CODE";
// import { uuidv7 } from "uuidv7"; // import { uuidv7 } from "uuidv7";
// import { ProfileSalaries } from "../entities/ProfileSalaries"; // import { ProfileSalaries } from "../entities/ProfileSalaries";
@Route("api/v1/org/upload") @Route("api/v1/org/upload")
@ -74,6 +78,9 @@ export class ImportDataController extends Controller {
private HR_PERSONAL_EMP_FAMILYRepo = AppDataSource.getRepository(HR_PERSONAL_EMP_FAMILY); private HR_PERSONAL_EMP_FAMILYRepo = AppDataSource.getRepository(HR_PERSONAL_EMP_FAMILY);
private educationMisRepo = AppDataSource.getRepository(EducationMis); private educationMisRepo = AppDataSource.getRepository(EducationMis);
private educationLevelRepo = AppDataSource.getRepository(EducationLevel);
private HR_MAJOR_CODERepo = AppDataSource.getRepository(HR_MAJOR_CODE);
private HR_FUND_COURSE_CODERepo = AppDataSource.getRepository(HR_FUND_COURSE_CODE);
private provincsRepo = AppDataSource.getRepository(ProvinceImport); private provincsRepo = AppDataSource.getRepository(ProvinceImport);
private amphurRepo = AppDataSource.getRepository(AmphurImport); private amphurRepo = AppDataSource.getRepository(AmphurImport);
private subDistrictRepo = AppDataSource.getRepository(SubDistrictImport); private subDistrictRepo = AppDataSource.getRepository(SubDistrictImport);
@ -91,6 +98,7 @@ export class ImportDataController extends Controller {
private OFFICERRepo = AppDataSource.getRepository(OFFICER); private OFFICERRepo = AppDataSource.getRepository(OFFICER);
private positionRepo = AppDataSource.getRepository(Position); private positionRepo = AppDataSource.getRepository(Position);
private posMasterRepo = AppDataSource.getRepository(PosMaster); private posMasterRepo = AppDataSource.getRepository(PosMaster);
private posExecutiveRepo = AppDataSource.getRepository(PosExecutive);
/** /**
* @summary * @summary
*/ */
@ -199,7 +207,7 @@ export class ImportDataController extends Controller {
// where: { posTypeName: item.MP_Type }, // where: { posTypeName: item.MP_Type },
// }); // });
// profile.posTypeId = type?.id ?? null_; // profile.posTypeId = type?.id ?? null_;
profile.amount = item.SALARY == "" ? 0 : Number(Extension.CheckRelationship(item.SALARY)); profile.amount = item.SALARY == "" ? 0 : Number(item.SALARY);
// profile.isLeave = // profile.isLeave =
// item.FLAG_RETIRE_STATUSxxxx == "" || item.FLAG_RETIRE_STATUSxxxx == null ? false : true; // item.FLAG_RETIRE_STATUSxxxx == "" || item.FLAG_RETIRE_STATUSxxxx == null ? false : true;
profile.createdUserId = request.user.sub; profile.createdUserId = request.user.sub;
@ -409,7 +417,6 @@ export class ImportDataController extends Controller {
"49", "49",
"50", "50",
"51", "51",
"56",
"60", "60",
"61", "61",
"62", "62",
@ -427,7 +434,7 @@ export class ImportDataController extends Controller {
} else if (["3", "6", "34", "36", "37"].includes(item.flag_to_name_code)) { } else if (["3", "6", "34", "36", "37"].includes(item.flag_to_name_code)) {
profileSalary.commandCode = "3"; profileSalary.commandCode = "3";
profileSalary.commandName = "แต่งตั้ง ย้าย"; profileSalary.commandName = "แต่งตั้ง ย้าย";
} else if (["10", "55"].includes(item.flag_to_name_code)) { } else if (["10", "55", "56"].includes(item.flag_to_name_code)) {
profileSalary.commandCode = "4"; profileSalary.commandCode = "4";
profileSalary.commandName = "เลื่อน"; profileSalary.commandName = "เลื่อน";
} else if (["14"].includes(item.flag_to_name_code)) { } else if (["14"].includes(item.flag_to_name_code)) {
@ -474,14 +481,16 @@ export class ImportDataController extends Controller {
profileSalary.commandCode = "17"; profileSalary.commandCode = "17";
profileSalary.commandName = "รักษาราชการ, ช่วยราชการ"; profileSalary.commandName = "รักษาราชการ, ช่วยราชการ";
} }
if ( if (item.flag_to_name_code == null && item.flag_to_name == "ลาศึกษาต่อ") {
item.flag_to_name_code == null &&
(item.flag_to_name == "เลื่อน 1 ขั้นและเลื่อนระดับ" ||
item.flag_to_name == "เลื่อน 0.5 ขั้นและเลื่อนระดับ" ||
item.flag_to_name == "ลาศึกษาต่อ")
) {
profileSalary.commandCode = "0"; profileSalary.commandCode = "0";
profileSalary.commandName = "อื่น ๆ"; profileSalary.commandName = "อื่น ๆ";
} else if (
item.flag_to_name_code == null &&
(item.flag_to_name == "เลื่อน 1 ขั้นและเลื่อนระดับ" ||
item.flag_to_name == "เลื่อน 0.5 ขั้นและเลื่อนระดับ")
) {
profileSalary.commandCode = "4";
profileSalary.commandName = "เลื่อน";
} else if (item.flag_to_name_code == null && item.flag_to_name == "เลื่อนเงินเดือน") { } else if (item.flag_to_name_code == null && item.flag_to_name == "เลื่อนเงินเดือน") {
profileSalary.commandCode = "5"; profileSalary.commandCode = "5";
profileSalary.commandName = "เลื่อนเงินเดือนตามปกติ"; profileSalary.commandName = "เลื่อนเงินเดือนตามปกติ";
@ -538,8 +547,6 @@ export class ImportDataController extends Controller {
"ขยายเวลาศึกษาต่อ", "ขยายเวลาศึกษาต่อ",
"รายงานตัวกลับเข้าปฏิบัติราชการ", "รายงานตัวกลับเข้าปฏิบัติราชการ",
"ไม่ได้เลื่อนขั้น", "ไม่ได้เลื่อนขั้น",
"เลือนเงินเดือนและระดับ",
"เลื่อนเงินเดือนและระดับ",
"ตัดเงินเดือน", "ตัดเงินเดือน",
"ลดขั้นเงินเดือน", "ลดขั้นเงินเดือน",
"ให้ข้าราชการกลับเข้ารับราชการ", "ให้ข้าราชการกลับเข้ารับราชการ",
@ -573,7 +580,11 @@ export class ImportDataController extends Controller {
) { ) {
profileSalary.commandCode = "3"; profileSalary.commandCode = "3";
profileSalary.commandName = "แต่งตั้ง ย้าย"; profileSalary.commandName = "แต่งตั้ง ย้าย";
} else if (["เลื่อนและแต่งตั้ง", "เลื่อนระดับ"].includes(item.flag_to_name)) { } else if (
["เลื่อนและแต่งตั้ง", "เลื่อนระดับ", "เลื่อนเงินเดือนและระดับ"].includes(
item.flag_to_name,
)
) {
profileSalary.commandCode = "4"; profileSalary.commandCode = "4";
profileSalary.commandName = "เลื่อน"; profileSalary.commandName = "เลื่อน";
} else if (["เลื่อนขั้นเงินเดือน", "เลื่อนเงินเดือน"].includes(item.flag_to_name)) { } else if (["เลื่อนขั้นเงินเดือน", "เลื่อนเงินเดือน"].includes(item.flag_to_name)) {
@ -1228,8 +1239,7 @@ export class ImportDataController extends Controller {
// .take(5) // .take(5)
// .getMany(); // .getMany();
await Promise.all( for (const _item of profiles) {
profiles.map(async (_item) => {
const existingProfile = await this.HR_EDUCATIONRepo.find({ const existingProfile = await this.HR_EDUCATIONRepo.find({
where: { CIT: _item.citizenId }, where: { CIT: _item.citizenId },
select: [ select: [
@ -1249,13 +1259,18 @@ export class ImportDataController extends Controller {
}); });
// educations = await []; // educations = await [];
await Promise.all( for (const item of existingProfile) {
existingProfile.map(async (item) => {
rowCount++; rowCount++;
const education = new ProfileEducation(); const education = new ProfileEducation();
const educationCode = await this.educationMisRepo.findOne({ const educationCode = await this.educationMisRepo.findOne({
where: { EDUCATION_CODE: item.EDUCATION_CODE }, where: { EDUCATION_CODE: item.EDUCATION_CODE },
}); });
const hrMajorCode = await this.HR_MAJOR_CODERepo.findOne({
where: { MAJOR_CODE: item.MAJOR_CODE },
});
const hrFundCourseCode = await this.HR_FUND_COURSE_CODERepo.findOne({
where: { FUND_COURSE_CODE: item.FUND_COURSE_CODE },
});
let startDate = item.START_EDUCATION_YEAR let startDate = item.START_EDUCATION_YEAR
? Extension.ConvertToDateTimeV2(item.START_EDUCATION_YEAR) ? Extension.ConvertToDateTimeV2(item.START_EDUCATION_YEAR)
@ -1269,9 +1284,9 @@ export class ImportDataController extends Controller {
education.level = educationLevel == null ? 1 : educationLevel.level + 1; education.level = educationLevel == null ? 1 : educationLevel.level + 1;
education.profileId = _item.id; education.profileId = _item.id;
education.degree = educationCode ? educationCode.EDUCATION_ABB_NAME : ""; education.degree = educationCode ? educationCode.EDUCATION_NAME : null_;
// education.degree = educationCode ? educationCode.MAJOR_NAME: ""; education.field = hrMajorCode ? hrMajorCode.MAJOR_NAME : null_;
// education.degree = educationCode ? educationCode.FUND_COURSE_CODE: ""; education.educationLevelId = hrFundCourseCode ? hrFundCourseCode.refId : null_;
education.institute = item.INSTITUE; education.institute = item.INSTITUE;
education.level = item.EDUCATION_SEQ ? null_ : Number(item.EDUCATION_SEQ); education.level = item.EDUCATION_SEQ ? null_ : Number(item.EDUCATION_SEQ);
education.startDate = startDate; education.startDate = startDate;
@ -1285,12 +1300,10 @@ export class ImportDataController extends Controller {
// await educations.push(await education); // await educations.push(await education);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount); console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.profileEducationRepo.save(await education); await this.profileEducationRepo.save(await education);
}), }
);
// await this.profileEducationRepo.save(educations); // await this.profileEducationRepo.save(educations);
// educations = await []; // educations = await [];
}), }
);
// } // }
// console.log(">>>>>>>>>>>>>>>>>>>" + rowCount); // console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
// await this.profileEducationRepo.save(educations); // await this.profileEducationRepo.save(educations);
@ -1878,11 +1891,10 @@ export class ImportDataController extends Controller {
orgChild3: "", orgChild3: "",
}, },
}); });
let order = 1;
//order xxxxxxxxxxxxxxxx for (const item of IMPORT_CHILD) {
await Promise.all(
IMPORT_CHILD.map(async (item) => {
const orgRoot = new OrgRoot(); const orgRoot = new OrgRoot();
orgRoot.orgRootOrder = order;
orgRoot.orgRootName = item.orgRoot; orgRoot.orgRootName = item.orgRoot;
orgRoot.orgRootShortName = item.orgShortname; orgRoot.orgRootShortName = item.orgShortname;
const rank: any = item.orgRank; const rank: any = item.orgRank;
@ -1900,8 +1912,8 @@ export class ImportDataController extends Controller {
orgRoot.createdAt = new Date(); orgRoot.createdAt = new Date();
orgRoot.lastUpdatedAt = new Date(); orgRoot.lastUpdatedAt = new Date();
await this.orgRootRepo.save(orgRoot); await this.orgRootRepo.save(orgRoot);
}), order++;
); }
//create child1 //create child1
const IMPORT_CHILD1 = await this.IMPORT_ORGRepo.find({ const IMPORT_CHILD1 = await this.IMPORT_ORGRepo.find({
@ -1913,14 +1925,16 @@ export class ImportDataController extends Controller {
}, },
}); });
await Promise.all( for (const item of IMPORT_CHILD1) {
IMPORT_CHILD1.map(async (item) => {
const orgChild1 = new OrgChild1(); const orgChild1 = new OrgChild1();
let orgRoot = await this.orgRootRepo.findOne({ let orgRoot = await this.orgRootRepo.findOne({
where: { orgRootName: item.orgRoot }, where: { orgRootName: item.orgRoot },
relations: ["orgChild1s"],
}); });
if (orgRoot == null) { if (orgRoot == null) {
orgRoot = new OrgRoot(); orgRoot = new OrgRoot();
orgRoot.orgRootOrder = order;
order = order + 1;
orgRoot.orgRootName = item.orgRoot; orgRoot.orgRootName = item.orgRoot;
orgRoot.orgRootShortName = item.orgShortname; orgRoot.orgRootShortName = item.orgShortname;
const rank: any = item.orgRank; const rank: any = item.orgRank;
@ -1940,6 +1954,10 @@ export class ImportDataController extends Controller {
await this.orgRootRepo.save(orgRoot); await this.orgRootRepo.save(orgRoot);
} }
orgChild1.orgChild1Order =
orgRoot == null || orgRoot.orgChild1s == null || orgRoot.orgChild1s.length == 0
? 1
: orgRoot.orgChild1s.length + 1;
orgChild1.orgRootId = orgRoot.id; orgChild1.orgRootId = orgRoot.id;
orgChild1.orgChild1Name = item.orgChild1; orgChild1.orgChild1Name = item.orgChild1;
orgChild1.orgChild1ShortName = item.orgShortname; orgChild1.orgChild1ShortName = item.orgShortname;
@ -1958,8 +1976,7 @@ export class ImportDataController extends Controller {
orgChild1.createdAt = new Date(); orgChild1.createdAt = new Date();
orgChild1.lastUpdatedAt = new Date(); orgChild1.lastUpdatedAt = new Date();
await this.orgChild1Repo.save(orgChild1); await this.orgChild1Repo.save(orgChild1);
}), }
);
//create child2 //create child2
const IMPORT_CHILD2 = await this.IMPORT_ORGRepo.find({ const IMPORT_CHILD2 = await this.IMPORT_ORGRepo.find({
@ -1970,14 +1987,16 @@ export class ImportDataController extends Controller {
orgChild3: "", orgChild3: "",
}, },
}); });
await Promise.all( for (const item of IMPORT_CHILD2) {
IMPORT_CHILD2.map(async (item) => {
const orgChild2 = new OrgChild2(); const orgChild2 = new OrgChild2();
let orgRoot = await this.orgRootRepo.findOne({ let orgRoot = await this.orgRootRepo.findOne({
where: { orgRootName: item.orgRoot }, where: { orgRootName: item.orgRoot },
relations: ["orgChild1s"],
}); });
if (orgRoot == null) { if (orgRoot == null) {
orgRoot = new OrgRoot(); orgRoot = new OrgRoot();
orgRoot.orgRootOrder = order;
order = order + 1;
orgRoot.orgRootName = item.orgRoot; orgRoot.orgRootName = item.orgRoot;
orgRoot.orgRootShortName = item.orgShortname; orgRoot.orgRootShortName = item.orgShortname;
const rank: any = item.orgRank; const rank: any = item.orgRank;
@ -1998,10 +2017,15 @@ export class ImportDataController extends Controller {
} }
let orgChild1 = await this.orgChild1Repo.findOne({ let orgChild1 = await this.orgChild1Repo.findOne({
where: { orgChild1Name: item.orgChild1 }, where: { orgChild1Name: item.orgChild1 },
relations: ["orgChild2s"],
}); });
if (orgChild1 == null) { if (orgChild1 == null) {
orgChild1 = new OrgChild1(); orgChild1 = new OrgChild1();
orgChild1.orgRootId = orgRoot.id; orgChild1.orgRootId = orgRoot.id;
orgChild1.orgChild1Order =
orgRoot == null || orgRoot.orgChild1s == null || orgRoot.orgChild1s.length == 0
? 1
: orgRoot.orgChild1s.length + 1;
orgChild1.orgChild1Name = item.orgChild1; orgChild1.orgChild1Name = item.orgChild1;
orgChild1.orgChild1ShortName = item.orgShortname; orgChild1.orgChild1ShortName = item.orgShortname;
const rank: any = item.orgRank; const rank: any = item.orgRank;
@ -2020,6 +2044,10 @@ export class ImportDataController extends Controller {
orgChild1.lastUpdatedAt = new Date(); orgChild1.lastUpdatedAt = new Date();
await this.orgChild1Repo.save(orgChild1); await this.orgChild1Repo.save(orgChild1);
} }
orgChild2.orgChild2Order =
orgChild1 == null || orgChild1.orgChild2s == null || orgChild1.orgChild2s.length == 0
? 1
: orgChild1.orgChild2s.length + 1;
orgChild2.orgRootId = orgRoot.id; orgChild2.orgRootId = orgRoot.id;
orgChild2.orgChild1Id = orgChild1.id; orgChild2.orgChild1Id = orgChild1.id;
orgChild2.orgChild2Name = item.orgChild2; orgChild2.orgChild2Name = item.orgChild2;
@ -2039,8 +2067,7 @@ export class ImportDataController extends Controller {
orgChild2.createdAt = new Date(); orgChild2.createdAt = new Date();
orgChild2.lastUpdatedAt = new Date(); orgChild2.lastUpdatedAt = new Date();
await this.orgChild2Repo.save(orgChild2); await this.orgChild2Repo.save(orgChild2);
}), }
);
//create child3 //create child3
const IMPORT_CHILD3 = await this.IMPORT_ORGRepo.find({ const IMPORT_CHILD3 = await this.IMPORT_ORGRepo.find({
@ -2052,14 +2079,16 @@ export class ImportDataController extends Controller {
}, },
}); });
await Promise.all( for (const item of IMPORT_CHILD3) {
IMPORT_CHILD3.map(async (item) => {
const orgChild3 = new OrgChild3(); const orgChild3 = new OrgChild3();
let orgRoot = await this.orgRootRepo.findOne({ let orgRoot = await this.orgRootRepo.findOne({
where: { orgRootName: item.orgRoot }, where: { orgRootName: item.orgRoot },
relations: ["orgChild1s"],
}); });
if (orgRoot == null) { if (orgRoot == null) {
orgRoot = new OrgRoot(); orgRoot = new OrgRoot();
orgRoot.orgRootOrder = order;
order = order + 1;
orgRoot.orgRootName = item.orgRoot; orgRoot.orgRootName = item.orgRoot;
orgRoot.orgRootShortName = item.orgShortname; orgRoot.orgRootShortName = item.orgShortname;
const rank: any = item.orgRank; const rank: any = item.orgRank;
@ -2080,9 +2109,14 @@ export class ImportDataController extends Controller {
} }
let orgChild1 = await this.orgChild1Repo.findOne({ let orgChild1 = await this.orgChild1Repo.findOne({
where: { orgChild1Name: item.orgChild1 }, where: { orgChild1Name: item.orgChild1 },
relations: ["orgChild2s"],
}); });
if (orgChild1 == null) { if (orgChild1 == null) {
orgChild1 = new OrgChild1(); orgChild1 = new OrgChild1();
orgChild1.orgChild1Order =
orgRoot == null || orgRoot.orgChild1s == null || orgRoot.orgChild1s.length == 0
? 1
: orgRoot.orgChild1s.length + 1;
orgChild1.orgRootId = orgRoot.id; orgChild1.orgRootId = orgRoot.id;
orgChild1.orgChild1Name = item.orgChild1; orgChild1.orgChild1Name = item.orgChild1;
orgChild1.orgChild1ShortName = item.orgShortname; orgChild1.orgChild1ShortName = item.orgShortname;
@ -2104,9 +2138,14 @@ export class ImportDataController extends Controller {
} }
let orgChild2 = await this.orgChild2Repo.findOne({ let orgChild2 = await this.orgChild2Repo.findOne({
where: { orgChild2Name: item.orgChild2 }, where: { orgChild2Name: item.orgChild2 },
relations: ["orgChild3s"],
}); });
if (orgChild2 == null) { if (orgChild2 == null) {
orgChild2 = new OrgChild2(); orgChild2 = new OrgChild2();
orgChild2.orgChild2Order =
orgChild1 == null || orgChild1.orgChild2s == null || orgChild1.orgChild2s.length == 0
? 1
: orgChild1.orgChild2s.length + 1;
orgChild2.orgRootId = orgRoot.id; orgChild2.orgRootId = orgRoot.id;
orgChild2.orgChild1Id = orgChild1.id; orgChild2.orgChild1Id = orgChild1.id;
orgChild2.orgChild2Name = item.orgChild2; orgChild2.orgChild2Name = item.orgChild2;
@ -2127,7 +2166,10 @@ export class ImportDataController extends Controller {
orgChild2.lastUpdatedAt = new Date(); orgChild2.lastUpdatedAt = new Date();
await this.orgChild2Repo.save(orgChild2); await this.orgChild2Repo.save(orgChild2);
} }
orgChild3.orgChild3Order =
orgChild2 == null || orgChild2.orgChild3s == null || orgChild2.orgChild3s.length == 0
? 1
: orgChild2.orgChild3s.length + 1;
orgChild3.orgRootId = orgRoot.id; orgChild3.orgRootId = orgRoot.id;
orgChild3.orgChild1Id = orgChild1.id; orgChild3.orgChild1Id = orgChild1.id;
orgChild3.orgChild2Id = orgChild2.id; orgChild3.orgChild2Id = orgChild2.id;
@ -2148,8 +2190,7 @@ export class ImportDataController extends Controller {
orgChild3.createdAt = new Date(); orgChild3.createdAt = new Date();
orgChild3.lastUpdatedAt = new Date(); orgChild3.lastUpdatedAt = new Date();
await this.orgChild3Repo.save(orgChild3); await this.orgChild3Repo.save(orgChild3);
}), }
);
return new HttpSuccess(); return new HttpSuccess();
} }
/** /**
@ -2174,7 +2215,7 @@ export class ImportDataController extends Controller {
rowCount++; rowCount++;
const existingProfile = await this.profileRepo.findOne({ const existingProfile = await this.profileRepo.findOne({
where: { citizenId: item.id.toString() }, where: { citizenId: item.CIT },
}); });
if (existingProfile == null) { if (existingProfile == null) {
continue; continue;
@ -2270,6 +2311,31 @@ export class ImportDataController extends Controller {
position.lastUpdateFullName = request.user.name; position.lastUpdateFullName = request.user.name;
position.createdAt = new Date(); position.createdAt = new Date();
position.lastUpdatedAt = new Date(); position.lastUpdatedAt = new Date();
const posExecutive = await this.posExecutiveRepo.findOne({
where: {
posExecutiveName: item.ADMIN_NAME,
},
});
if (posExecutive == null && item.ADMIN_NAME != "" && item.ADMIN_NAME != null) {
const posExecutiveOrder = await this.posExecutiveRepo.findOne({
where: { posExecutivePriority: Not(IsNull()) },
order: { posExecutivePriority: "DESC" },
});
let posExecutive = new PosExecutive();
posExecutive.posExecutivePriority =
posExecutiveOrder == null ? null_ : posExecutiveOrder.posExecutivePriority + 1;
posExecutive.posExecutiveName = item.ADMIN_NAME;
posExecutive.createdUserId = request.user.sub;
posExecutive.createdFullName = request.user.name;
posExecutive.lastUpdateUserId = request.user.sub;
posExecutive.lastUpdateFullName = request.user.name;
posExecutive.createdAt = new Date();
posExecutive.lastUpdatedAt = new Date();
await this.posExecutiveRepo.save(posExecutive);
}
position.posExecutiveId = posExecutive == null ? null_ : posExecutive.id;
position.positionName = item.WORK_LINE_NAME == "" ? null_ : item.WORK_LINE_NAME; position.positionName = item.WORK_LINE_NAME == "" ? null_ : item.WORK_LINE_NAME;
position.posTypeId = position.posTypeId =
type_ != null && type_.posTypeName == item.MP_CATEGORY && type_ ? type_.id : null; type_ != null && type_.posTypeName == item.MP_CATEGORY && type_ ? type_.id : null;

View file

@ -259,9 +259,6 @@ export class ReportController extends Controller {
tenureTypeCondition = "registryOfficer.Years BETWEEN :tenureMin AND :tenureMax"; //xxxxxxxxxxxx tenureTypeCondition = "registryOfficer.Years BETWEEN :tenureMin AND :tenureMax"; //xxxxxxxxxxxx
} }
const sql_mode = await AppDataSource.query(
"SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));",
);
const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer) const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer)
.createQueryBuilder("registryOfficer") .createQueryBuilder("registryOfficer")
.where(nodeCondition, { .where(nodeCondition, {

View file

@ -52,4 +52,18 @@ export class HR_EDUCATION {
default: null, default: null,
}) })
EDUCATION_SEQ: string; EDUCATION_SEQ: string;
@Column({
nullable: true,
type: "text",
default: null,
})
FUND_COURSE_CODE: string;
@Column({
nullable: true,
type: "text",
default: null,
})
MAJOR_CODE: string;
} }

View file

@ -0,0 +1,35 @@
import { Entity, Column, PrimaryGeneratedColumn } from "typeorm";
@Entity("HR_FUND_COURSE_CODE")
export class HR_FUND_COURSE_CODE {
@PrimaryGeneratedColumn()
id!: number;
@Column({
nullable: true,
type: "text",
default: null,
})
FUND_COURSE_CODE: string;
@Column({
nullable: true,
type: "text",
default: null,
})
FUND_COURSE_NAME: string;
@Column({
nullable: true,
type: "text",
default: null,
})
LEVEL_SEQ: string;
@Column({
nullable: true,
type: "text",
default: null,
})
refId: string;
}

View file

@ -0,0 +1,28 @@
import { Entity, Column, PrimaryGeneratedColumn } from "typeorm";
@Entity("HR_MAJOR_CODE")
export class HR_MAJOR_CODE {
@PrimaryGeneratedColumn()
id!: number;
@Column({
nullable: true,
type: "text",
default: null,
})
MAJOR_CODE: string;
@Column({
nullable: true,
type: "text",
default: null,
})
MAJOR_NAME: string;
@Column({
nullable: true,
type: "text",
default: null,
})
MAJOR_ABB_NAME: string;
}

View file

@ -19,6 +19,13 @@ export class OFFICER {
// }) // })
// ID: string; // ID: string;
@Column({
nullable: true,
type: "text",
default: null,
})
CIT: string;
@Column({ @Column({
nullable: true, nullable: true,
type: "text", type: "text",
@ -130,4 +137,11 @@ export class OFFICER {
default: null, default: null,
}) })
POS_NUM_NAME: string; POS_NUM_NAME: string;
@Column({
nullable: true,
type: "text",
default: null,
})
ADMIN_NAME: string;
} }

View file

@ -0,0 +1,65 @@
import { Entity, Column, Double } from "typeorm";
import { EntityBase } from "./base/Base";
@Entity("ProfileSalaries")
export class ProfileSalaries extends EntityBase {
@Column({
nullable: true,
default: null,
})
Order: number;
@Column({
nullable: true,
default: null,
})
Date: Date;
@Column({
nullable: true,
default: null,
})
SalaryRef: string;
@Column({
nullable: true,
type: "double",
})
Amount: Double;
@Column({
nullable: true,
type: "double",
})
PositionSalaryAmount: Double;
@Column({
nullable: true,
default: null,
})
PosNoName: string;
@Column({
nullable: true,
default: null,
})
PositionTypeName: string;
@Column({
nullable: true,
default: null,
})
PositionLevelName: string;
@Column({
nullable: true,
default: null,
})
PositionName: string;
@Column({
nullable: true,
default: null,
})
ProfileId: string;
}