From 59eec3d7b9f534d1b8d2cf86238ed69108dae441 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 25 Jun 2025 15:22:03 +0700 Subject: [PATCH] fix --- src/controllers/ReportController.ts | 1 + src/controllers/SalaryPeriodController.ts | 39 +++++++++++++++++------ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index a4b3296..83b975a 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -7798,6 +7798,7 @@ export class ReportController extends Controller { }), ) .andWhere("salaryProfile.status35 = :status", { status: "PENDING" }) + .andWhere("salaryProfile.isRetired = :isRetired", { isRetired: true}) .select([ "salaryProfile.id", "salaryProfile.orgShortName", diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 09a6e27..0f43223 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -1698,7 +1698,7 @@ export class SalaryPeriodController extends Controller { ...profile, posExecutive: profile.positionExecutiveField - ? `${profile.posExecutive} (${profile.positionExecutiveField})` + ? `${profile.posExecutive}(${profile.positionExecutiveField})` : profile.posExecutive ?? null, })); @@ -2565,6 +2565,7 @@ export class SalaryPeriodController extends Controller { let orgs = await new CallAPI().GetData(request, "/org/unauthorize/active/root/id"); //snap บางสำนัก + //.chin // const targetRootIds = [ // "d7e98989-b5ce-47d6-93c3-ab63ed486348", // "e0545eca-5d0a-4a1c-8bbd-e3e25c2521db", @@ -2573,15 +2574,16 @@ export class SalaryPeriodController extends Controller { // "eaf65f33-25e9-4956-9dba-5d909f5eb595", // "a3efed2c-3f4b-476d-95e6-9f7e0585ae25", // ]; - const targetRootIds = [ - "b89a4467-7ee3-4706-8db7-f366555f826c", - "585648a9-e634-43fc-9360-5fd4189136ab", - "d6e3daa0-284a-428f-aa43-0750fa74e974", - "ed3ddcfb-f882-4499-817b-aff73e5be87c", - "f8ce98ca-a691-4c89-abde-875f559afb3a", - ]; + //.me + // const targetRootIds = [ + // "b89a4467-7ee3-4706-8db7-f366555f826c", + // "585648a9-e634-43fc-9360-5fd4189136ab", + // "d6e3daa0-284a-428f-aa43-0750fa74e974", + // "ed3ddcfb-f882-4499-817b-aff73e5be87c", + // "f8ce98ca-a691-4c89-abde-875f559afb3a", + // ]; - orgs = orgs.filter((x: any) => targetRootIds.includes(x.rootId)); + // orgs = orgs.filter((x: any) => targetRootIds.includes(x.rootId)); let total = 1000; // let _orgProfiles = await new CallAPI().PostData(request, "/org/unauthorize/salary/gen", { let _orgProfiles = await new CallAPI().PostData(request, "/org/unauthorize/new-salary/gen", { @@ -2773,6 +2775,25 @@ export class SalaryPeriodController extends Controller { salaryOrgId: In(salaryOrgOld.map((x) => x.id)), }, }); + // const salaryOrgOldList = await this.salaryOrgRepository.find({ + // where: { + // salaryPeriodId: salaryPeriod.id, + // snapshot: "SNAP1", + // }, + // }); + + // const salaryProfileOldList = await this.salaryProfileRepository.find({ + // where: { + // salaryOrgId: In(salaryOrgOldList.map((org) => org.id)), + // }, + // }); + + // const salaryProfileMap = new Map(); + // salaryProfileOldList.forEach((item) => { + // salaryProfileMap.set(item.citizenId, item); + // }); + + // const salaryOld = salaryProfileMap.get(salaryProfileNew.citizenId); salaryProfileNew.type = salaryOld == null ? "PENDING" : salaryOld.type; salaryProfileNew.amount = salaryOld == null ? 0 : salaryOld.amount;