diff --git a/src/controllers/ImportDataController.ts b/src/controllers/ImportDataController.ts index fdb9e668..a52cd4e4 100644 --- a/src/controllers/ImportDataController.ts +++ b/src/controllers/ImportDataController.ts @@ -3428,6 +3428,30 @@ export class ImportDataController extends Controller { return new HttpSuccess(); } + /** + * @summary เงินเดือน ข้าราชการ + */ + @Post("update-profileSalaryEmp") + async UpdateProfileSalaryEmp(@Request() request: { user: Record }) { + let rowCount = 0; + const profileSalarys: any = await this.salaryRepo.find({ where: { refId: Not(IsNull()) } }); + + for await (const _item of profileSalarys) { + const EMPLOYEE = await this.HR_POSITION_EMPLOYEERepo.findOne({ + select: ["id", "POS_NUM_CODE_SIT", "POS_NUM_CODE_SIT_ABB"], + where: { id: _item.refId }, + }); + if (EMPLOYEE) { + rowCount++; + _item.posNumCodeSit = EMPLOYEE.POS_NUM_CODE_SIT; + _item.posNumCodeSitAbb = EMPLOYEE.POS_NUM_CODE_SIT_ABB; + await this.salaryRepo.save(_item); + console.log(rowCount); + } + } + return new HttpSuccess(); + } + OrgRank(value: string) { switch (value.trim().toUpperCase()) { case "DEPARTMENT":