map profilesalary
This commit is contained in:
parent
4a87969337
commit
b01f074afe
3 changed files with 27 additions and 18 deletions
|
|
@ -53,6 +53,7 @@ import { HR_FUND_COURSE_CODE } from "../entities/HR_FUND_COURSE_CODE";
|
||||||
import { HR_MAJOR_CODE } from "../entities/HR_MAJOR_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";
|
||||||
|
import { HR_POSITION_OFFICER } from "../entities/HR_POSITION_OFFICER";
|
||||||
@Route("api/v1/org/upload")
|
@Route("api/v1/org/upload")
|
||||||
@Tags("UPLOAD")
|
@Tags("UPLOAD")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
|
|
@ -81,6 +82,7 @@ export class ImportDataController extends Controller {
|
||||||
private educationLevelRepo = AppDataSource.getRepository(EducationLevel);
|
private educationLevelRepo = AppDataSource.getRepository(EducationLevel);
|
||||||
private HR_MAJOR_CODERepo = AppDataSource.getRepository(HR_MAJOR_CODE);
|
private HR_MAJOR_CODERepo = AppDataSource.getRepository(HR_MAJOR_CODE);
|
||||||
private HR_FUND_COURSE_CODERepo = AppDataSource.getRepository(HR_FUND_COURSE_CODE);
|
private HR_FUND_COURSE_CODERepo = AppDataSource.getRepository(HR_FUND_COURSE_CODE);
|
||||||
|
private HR_POSITION_OFFICERRepo = AppDataSource.getRepository(HR_POSITION_OFFICER);
|
||||||
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);
|
||||||
|
|
@ -2629,12 +2631,12 @@ export class ImportDataController extends Controller {
|
||||||
@Post("update-profileSalary")
|
@Post("update-profileSalary")
|
||||||
async UpdateProfileSalary(@Request() request: { user: Record<string, any> }) {
|
async UpdateProfileSalary(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
const profileSalarys: any = await this.salaryRepo.find({ where: { refId: IsNull() } });
|
const profileSalarys: any = await this.salaryRepo.find({ where: { refId: Not(IsNull()) } });
|
||||||
|
|
||||||
for await (const _item of profileSalarys) {
|
for await (const _item of profileSalarys) {
|
||||||
const OFFICER = await this.OFFICERRepo.findOne({
|
const OFFICER = await this.HR_POSITION_OFFICERRepo.findOne({
|
||||||
select: ["ID", "POS_NUM_CODE_SIT", "POS_NUM_CODE_SIT_ABB"],
|
select: ["id", "POS_NUM_CODE_SIT", "POS_NUM_CODE_SIT_ABB"],
|
||||||
where: { ID: _item.refId },
|
where: { id: _item.refId },
|
||||||
});
|
});
|
||||||
if (OFFICER) {
|
if (OFFICER) {
|
||||||
rowCount++;
|
rowCount++;
|
||||||
|
|
|
||||||
21
src/entities/HR_POSITION_OFFICER.ts
Normal file
21
src/entities/HR_POSITION_OFFICER.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { Entity, Column, PrimaryGeneratedColumn } from "typeorm";
|
||||||
|
|
||||||
|
@Entity("HR_POSITION_OFFICER")
|
||||||
|
export class HR_POSITION_OFFICER {
|
||||||
|
@PrimaryGeneratedColumn()
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
POS_NUM_CODE_SIT: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
POS_NUM_CODE_SIT_ABB: string;
|
||||||
|
}
|
||||||
|
|
@ -172,18 +172,4 @@ export class OFFICER {
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
ADMIN_NAME: string;
|
ADMIN_NAME: string;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
type: "text",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
POS_NUM_CODE_SIT: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
type: "text",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
POS_NUM_CODE_SIT_ABB: string;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue