diff --git a/src/controllers/ImportDataController.ts b/src/controllers/ImportDataController.ts index 25532954..dc3dc2e2 100644 --- a/src/controllers/ImportDataController.ts +++ b/src/controllers/ImportDataController.ts @@ -1925,9 +1925,9 @@ export class ImportDataController extends Controller { // ? _null // : Number(item.SAL_POS_AMOUNT_2); // profileSalary.positionSalaryAmount = sal_pos_amount_1 ?? sal_pos_amount_2; - const special_amt: any = - item.SPECIAL_AMT == null || item.SPECIAL_AMT == "" ? _null : Number(item.SPECIAL_AMT); - profileSalary.amountSpecial = special_amt; + // const special_amt: any = + // item.SPECIAL_AMT == null || item.SPECIAL_AMT == "" ? _null : Number(item.SPECIAL_AMT); + // profileSalary.amountSpecial = special_amt; profileSalary.posNumCodeSit = item.POS_NUM_CODE_SIT; profileSalary.posNumCodeSitAbb = item.POS_NUM_CODE_SIT_ABB; diff --git a/src/entities/HR_POSITION_EMPLOYEETEMP.ts b/src/entities/HR_POSITION_EMPLOYEETEMP.ts index 170db661..fd4d4d15 100644 --- a/src/entities/HR_POSITION_EMPLOYEETEMP.ts +++ b/src/entities/HR_POSITION_EMPLOYEETEMP.ts @@ -189,12 +189,12 @@ export class HR_POSITION_EMPLOYEETEMP { // }) // SAL_POS_AMOUNT_2: string; - @Column({ - nullable: true, - type: "text", - default: null, - }) - SPECIAL_AMT: string; + // @Column({ + // nullable: true, + // type: "text", + // default: null, + // }) + // SPECIAL_AMT: string; @Column({ nullable: true, diff --git a/src/services/rabbitmq.ts b/src/services/rabbitmq.ts index 6f379825..e1392178 100644 --- a/src/services/rabbitmq.ts +++ b/src/services/rabbitmq.ts @@ -532,7 +532,17 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { ? x.id : x.ancestorDNA, })); - await repoEmployeePosmaster.save(_orgemployeePosMaster); + // await repoEmployeePosmaster.save(_orgemployeePosMaster); + await repoEmployeePosmaster + .createQueryBuilder() + .insert() + .into(EmployeePosMaster) + .values(_orgemployeePosMaster) + .orUpdate({ + conflict_target: ['id'], + overwrite: ['ancestorDNA'], + }) + .execute(); // } //หา dna posmaster ถ้าไม่มีให้เอาตัวเองเป็น dna @@ -555,9 +565,19 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { ? x.id : x.ancestorDNA, })); - await repoEmployeeTempPosmaster.save(_orgemployeeTempPosMaster); + // await repoEmployeeTempPosmaster.save(_orgemployeeTempPosMaster); + await repoEmployeeTempPosmaster + .createQueryBuilder() + .insert() + .into(EmployeeTempPosMaster) + .values(_orgemployeeTempPosMaster) + .orUpdate({ + conflict_target: ['id'], + overwrite: ['ancestorDNA'], + }) + .execute(); // } - + //create org orgRoot.forEach(async (x: any) => { var dataId = x.id; @@ -1364,7 +1384,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise { }); }); // } - + const employeePosMaster = await repoEmployeePosmaster.find({ where: { orgRevisionId: orgRevisionDraft.id }, relations: ["positions", "positions.posLevel", "positions.posType"],