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 { uuidv7 } from "uuidv7";
|
||||
import { ProfileSalaries } from "../entities/ProfileSalaries";
|
||||
import { HR_POSITION_OFFICER } from "../entities/HR_POSITION_OFFICER";
|
||||
@Route("api/v1/org/upload")
|
||||
@Tags("UPLOAD")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -81,6 +82,7 @@ export class ImportDataController extends Controller {
|
|||
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 HR_POSITION_OFFICERRepo = AppDataSource.getRepository(HR_POSITION_OFFICER);
|
||||
private provincsRepo = AppDataSource.getRepository(ProvinceImport);
|
||||
private amphurRepo = AppDataSource.getRepository(AmphurImport);
|
||||
private subDistrictRepo = AppDataSource.getRepository(SubDistrictImport);
|
||||
|
|
@ -2629,12 +2631,12 @@ export class ImportDataController extends Controller {
|
|||
@Post("update-profileSalary")
|
||||
async UpdateProfileSalary(@Request() request: { user: Record<string, any> }) {
|
||||
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) {
|
||||
const OFFICER = await this.OFFICERRepo.findOne({
|
||||
select: ["ID", "POS_NUM_CODE_SIT", "POS_NUM_CODE_SIT_ABB"],
|
||||
where: { ID: _item.refId },
|
||||
const OFFICER = await this.HR_POSITION_OFFICERRepo.findOne({
|
||||
select: ["id", "POS_NUM_CODE_SIT", "POS_NUM_CODE_SIT_ABB"],
|
||||
where: { id: _item.refId },
|
||||
});
|
||||
if (OFFICER) {
|
||||
rowCount++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue