From 8339e6ce6d9e45fe9f6adf457c1c4efdf89e8a64 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 28 Feb 2024 14:46:17 +0700 Subject: [PATCH 1/5] no message --- src/controllers/SalaryPeriodController.ts | 32 ++++++++----------- src/entities/SalaryOrg.ts | 2 ++ src/interfaces/call-api.ts | 7 +--- ...pdate_table_salaryProfile_add_revision3.ts | 16 ++++++++++ 4 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 src/migration/1709105846886-update_table_salaryProfile_add_revision3.ts diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index db17580..7522dbe 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -28,6 +28,7 @@ import { PosLevel } from "../entities/PosLevel"; import { Salarys } from "../entities/Salarys"; import { SalaryRanks } from "../entities/SalaryRanks"; import CallAPI from "../interfaces/call-api"; +import { Int32 } from "typeorm/browser"; @Route("api/v1/salary/period") @Tags("Salary") @@ -772,30 +773,25 @@ export class SalaryPeriodController extends Controller { const salaryProfile = await this.salaryProfileRepository.find({ where: { salaryOrgId: In(salaryOrg.map((x) => x.id)) }, }); - await this.salaryOrgRepository.remove(salaryOrg); await this.salaryProfileRepository.remove(salaryProfile); + await this.salaryOrgRepository.remove(salaryOrg); - console.log("11111111111111111111111"); let orgs = await new CallAPI().GetData(request, "org/active/root/id"); - console.log("22222222222222222222222"); - let orgProfiles: any; - await new CallAPI() - .PostData(request, "org/profile/salary/gen", { - page: 1, - pageSize: 100, - keyword: "", - }) - .then((x) => { - orgProfiles = x.data; - }); - console.log("333333333333333333333"); - if (orgProfiles.total > 100) { - const page = Math.ceil(orgProfiles.total.length / 100); + let total = 1000; + let _orgProfiles = await new CallAPI().PostData(request, "org/profile/salary/gen", { + page: 1, + pageSize: 1000, + keyword: "", + }); + let orgProfiles = _orgProfiles.data; + total = _orgProfiles.total; + if (total > 1000) { + const page = Math.ceil(total / 1000); for (let index = 2; index <= page; index++) { await new CallAPI() .PostData(request, "org/profile/salary/gen", { page: index, - pageSize: 100, + pageSize: 1000, keyword: "", }) .then((x) => { @@ -803,9 +799,7 @@ export class SalaryPeriodController extends Controller { }); } } - console.log("44444444444444444444444"); let revisionId = await new CallAPI().GetData(request, "org/revision/latest"); - console.log("55555555555555555555555"); salaryPeriod.revisionId = revisionId; await this.salaryPeriodRepository.save(salaryPeriod); diff --git a/src/entities/SalaryOrg.ts b/src/entities/SalaryOrg.ts index 4ebad1d..5581190 100644 --- a/src/entities/SalaryOrg.ts +++ b/src/entities/SalaryOrg.ts @@ -37,11 +37,13 @@ export class SalaryOrg extends EntityBase { snapshot: string; @Column({ + default: 0, comment: "จำนวนคนทั้งหมด", }) total: number; @Column({ + default: 0, comment: "15%ของจำนวนคน(จำนวนเต็ม)", }) fifteenPercent: number; diff --git a/src/interfaces/call-api.ts b/src/interfaces/call-api.ts index 86ed525..8608230 100644 --- a/src/interfaces/call-api.ts +++ b/src/interfaces/call-api.ts @@ -35,17 +35,12 @@ class CallAPI { const token = request.headers.authorization; const url = process.env.API + path; try { - console.log("response"); - console.log(url); - console.log("response"); - const response = await axios.post(url, { + const response = await axios.post(url, sendData, { headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", }, - json: sendData, }); - console.log(response); return response.data.result; } catch (error) { throw error; diff --git a/src/migration/1709105846886-update_table_salaryProfile_add_revision3.ts b/src/migration/1709105846886-update_table_salaryProfile_add_revision3.ts new file mode 100644 index 0000000..cffaf25 --- /dev/null +++ b/src/migration/1709105846886-update_table_salaryProfile_add_revision3.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryProfileAddRevision31709105846886 implements MigrationInterface { + name = 'UpdateTableSalaryProfileAddRevision31709105846886' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryOrg\` CHANGE \`total\` \`total\` int NOT NULL COMMENT 'จำนวนคนทั้งหมด' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` CHANGE \`fifteenPercent\` \`fifteenPercent\` int NOT NULL COMMENT '15%ของจำนวนคน(จำนวนเต็ม)' DEFAULT '0'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryOrg\` CHANGE \`fifteenPercent\` \`fifteenPercent\` int NOT NULL COMMENT '15%ของจำนวนคน(จำนวนเต็ม)'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` CHANGE \`total\` \`total\` int NOT NULL COMMENT 'จำนวนคนทั้งหมด'`); + } + +} From 442f2f9a8626e4dc7ddda2e8f0c97a081adc2745 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 28 Feb 2024 16:04:09 +0700 Subject: [PATCH 2/5] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9F?= =?UTF-8?q?=E0=B8=B4=E0=B8=A7validate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/SalaryPeriodController.ts | 9 ++++++-- src/entities/SalaryProfile.ts | 28 +++++++++++------------ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 7522dbe..c18f045 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -480,7 +480,8 @@ export class SalaryPeriodController extends Controller { ); } - const salaryProfile = Object.assign(new SalaryProfile(), requestBody); + let salaryProfile: any = Object.assign(new SalaryProfile(), requestBody); + delete salaryProfile.id; salaryProfile.type = salaryProfile.type.toUpperCase(); //Type & Level const type = await this.posTypeRepository.findOne({ @@ -557,7 +558,9 @@ export class SalaryPeriodController extends Controller { : salaryRanks.salaryFullHalf - salaryProfile.amount; salaryProfile.positionSalaryAmount = salaryRanks == null ? 0 : salaryRanks.salaryFullHalf; } else { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง"); + salaryProfile.amountSpecial = 0; + salaryProfile.amountUse = 0; + salaryProfile.positionSalaryAmount = 0; } salaryProfile.salaryOrgId = salaryOrg.id; @@ -807,6 +810,7 @@ export class SalaryPeriodController extends Controller { await Promise.all( orgs.map(async (rootId: string) => { let salaryOrgNew = Object.assign(new SalaryOrg()); + delete salaryOrgNew.id; salaryOrgNew.salaryPeriodId = salaryPeriod.id; salaryOrgNew.status = "PENDING"; salaryOrgNew.rootId = rootId; @@ -857,6 +861,7 @@ export class SalaryPeriodController extends Controller { if (salaryOrgNew != null) { let salaryProfileNew = Object.assign(new SalaryProfile(), profile); + delete profile.id; salaryProfileNew.salaryOrgId = salaryOrgNew.id; salaryProfileNew.revisionId = salaryPeriod.revisionId; salaryProfileNew.createdUserId = request.user.sub; diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index ff93597..f93f68e 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -289,16 +289,16 @@ export class CreateSalaryProfile { citizenId: string; @Column() - posMasterNoPrefix: string; + posMasterNoPrefix: string | null; @Column() posMasterNo: number; @Column() - posMasterNoSuffix: string; + posMasterNoSuffix: string | null; @Column() - orgShortName: string; + orgShortName: string | null; @Column() position: string; @@ -310,40 +310,40 @@ export class CreateSalaryProfile { posLevel: string; @Column() - posExecutive: string; + posExecutive: string | null; @Column() amount: number; @Column("uuid") - rootId: string; + rootId: string | null; @Column() - root: string; + root: string | null; @Column("uuid") - child1Id: string; + child1Id: string | null; @Column() - child1: string; + child1: string | null; @Column("uuid") - child2Id: string; + child2Id: string | null; @Column() - child2: string; + child2: string | null; @Column("uuid") - child3Id: string; + child3Id: string | null; @Column() - child3: string; + child3: string | null; @Column("uuid") - child4Id: string; + child4Id: string | null; @Column() - child4: string; + child4: string | null; @Column() isResult: boolean; From 95c4321c5d284821bef2a176981014d878662c0a Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 28 Feb 2024 16:27:36 +0700 Subject: [PATCH 3/5] add feild SalaryOrg --- src/controllers/SalaryPeriodController.ts | 8 ++-- src/entities/SalaryOrg.ts | 48 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index d59ed83..22e1e62 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -273,9 +273,9 @@ export class SalaryPeriodController extends Controller { } /** - * API แก้ไขเงินเดือน + * API แก้ไขขั้น * - * @summary SLR_025 - แก้ไขเงินเดือน #24 + * @summary SLR_025 - แก้ไขขั้น #24 * * @param {string} id profile Id * @param {string} type ประเภทการเลื่อน NONE->ไม่ได้เลื่อน HAFT->ครึ่งขั้น FULL->1ขั้น FULLHAFT->1.5ขั้น @@ -746,9 +746,9 @@ export class SalaryPeriodController extends Controller { } /** - * API รายการรอบเงินเดือน + * API snapshot salary * - * @summary SLR_020 - รายการรอบเงินเดือน #20 + * @summary snapshot salary * */ @Get("snapshot/{snaphot}/{salaryPeriodId}") diff --git a/src/entities/SalaryOrg.ts b/src/entities/SalaryOrg.ts index 4ebad1d..fbb960f 100644 --- a/src/entities/SalaryOrg.ts +++ b/src/entities/SalaryOrg.ts @@ -59,6 +59,54 @@ export class SalaryOrg extends EntityBase { }) group: string; + @Column({ + comment: "เลือกไปแล้ว", + default: 0, + }) + quantityUsed: number; + + @Column({ + comment: "คงเหลือโควตา", + default: 0, + }) + remainQuota: number; + + @Column({ + comment: "จำนวนเงินคนครองปัจจุบัน", + type: "double", + default: 0, + }) + currentAmount: number; + + @Column({ + comment: "วงเงิน6%", + type: "double", + default: 0, + }) + sixPercentAmount: number; + + @Column({ + comment: "ยอดเงินที่ใช้ไป", + type: "double", + default: 0, + }) + spentAmount: number; + + @Column({ + comment: "ใช้ไปเท่าไหร่", + type: "double", + default: 0, + }) + useAmount: number; + + @Column({ + comment: "เหลือเท่าไหร่", + type: "double", + default: 0, + }) + remainingAmount: number; + + @ManyToOne(() => SalaryPeriod, (salaryPeriod) => salaryPeriod.salaryOrgs) @JoinColumn({ name: "salaryPeriodId" }) salaryPeriod: SalaryPeriod; From bbe3ee2906dff08379d2b7ecc0f44a6ef3605faf Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 28 Feb 2024 16:33:03 +0700 Subject: [PATCH 4/5] migrate db --- src/entities/SalaryProfile.ts | 20 ++++---- ...update_table_salaryProfile_add_retired2.ts | 46 +++++++++++++++++++ 2 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 src/migration/1709112744213-update_table_salaryProfile_add_retired2.ts diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index f93f68e..3710588 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -238,31 +238,31 @@ export class SalaryProfile extends EntityBase { comment: "ผลการประเมิน", default: false, }) - isResult: boolean; + result: boolean; @Column({ comment: "ระยะเวลา", default: false, }) - isDuration: boolean; + duration: boolean; @Column({ comment: "การลงโทษ", default: false, }) - isPunish: boolean; + punish: boolean; @Column({ comment: "พักราชการ", default: false, }) - isRetired: boolean; + retired: boolean; @Column({ comment: "ขาดราชการ", default: false, }) - isRetired2: boolean; + retired2: boolean; @ManyToOne(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryProfiles) @JoinColumn({ name: "salaryOrgId" }) @@ -346,17 +346,17 @@ export class CreateSalaryProfile { child4: string | null; @Column() - isResult: boolean; + result: boolean; @Column() - isDuration: boolean; + duration: boolean; @Column() - isPunish: boolean; + punish: boolean; @Column() - isRetired: boolean; + retired: boolean; @Column() - isRetired2: boolean; + retired2: boolean; } diff --git a/src/migration/1709112744213-update_table_salaryProfile_add_retired2.ts b/src/migration/1709112744213-update_table_salaryProfile_add_retired2.ts new file mode 100644 index 0000000..f2ae914 --- /dev/null +++ b/src/migration/1709112744213-update_table_salaryProfile_add_retired2.ts @@ -0,0 +1,46 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryProfileAddRetired21709112744213 implements MigrationInterface { + name = 'UpdateTableSalaryProfileAddRetired21709112744213' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isDuration\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isPunish\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isResult\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isRetired\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isRetired2\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`quantityUsed\` int NOT NULL COMMENT 'เลือกไปแล้ว' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`remainQuota\` int NOT NULL COMMENT 'คงเหลือโควตา' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`currentAmount\` double NOT NULL COMMENT 'จำนวนเงินคนครองปัจจุบัน' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`sixPercentAmount\` double NOT NULL COMMENT 'วงเงิน6%' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`spentAmount\` double NOT NULL COMMENT 'ยอดเงินที่ใช้ไป' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`useAmount\` double NOT NULL COMMENT 'ใช้ไปเท่าไหร่' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`remainingAmount\` double NOT NULL COMMENT 'เหลือเท่าไหร่' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`result\` tinyint NOT NULL COMMENT 'ผลการประเมิน' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`duration\` tinyint NOT NULL COMMENT 'ระยะเวลา' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`punish\` tinyint NOT NULL COMMENT 'การลงโทษ' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`retired\` tinyint NOT NULL COMMENT 'พักราชการ' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`retired2\` tinyint NOT NULL COMMENT 'ขาดราชการ' DEFAULT 0`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`retired2\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`retired\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`punish\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`duration\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`result\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`remainingAmount\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`useAmount\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`spentAmount\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`sixPercentAmount\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`currentAmount\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`remainQuota\``); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`quantityUsed\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isRetired2\` tinyint NOT NULL COMMENT 'ขาดราชการ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isRetired\` tinyint NOT NULL COMMENT 'พักราชการ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isResult\` tinyint NOT NULL COMMENT 'ผลการประเมิน' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isPunish\` tinyint NOT NULL COMMENT 'การลงโทษ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isDuration\` tinyint NOT NULL COMMENT 'ระยะเวลา' DEFAULT '0'`); + } + +} From aeb034a654916a774e0b56a811aaf8673b1a0af1 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 28 Feb 2024 18:03:36 +0700 Subject: [PATCH 5/5] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/SalaryPeriodController.ts | 60 ++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 92140f8..bd33cba 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -139,11 +139,26 @@ export class SalaryPeriodController extends Controller { @Delete("profile/{id}") async deleteSalaryProfile(@Path() id: string) { const salaryProfile = await this.salaryProfileRepository.findOne({ + relations: ["salaryOrg"], where: { id: id }, }); if (!salaryProfile) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขอเงินเดือนผู้ใช้งานนี้ในระบบ"); } + // หาจำนวน Quota คงเหลือ + if(salaryProfile?.salaryOrg.snapshot == "SNAP1"){ + const amountFullType = await this.salaryProfileRepository.count({ + where:{ + salaryOrgId:salaryProfile?.salaryOrg.id, + type:"FULL" + } + }); + const calRemainQuota = salaryProfile?.salaryOrg.fifteenPercent - amountFullType; + salaryProfile.salaryOrg.quantityUsed = amountFullType; + salaryProfile.salaryOrg.remainQuota = calRemainQuota; + await this.salaryOrgRepository.save(salaryProfile?.salaryOrg); + } + await this.salaryProfileRepository.remove(salaryProfile); return new HttpSuccess(); } @@ -242,7 +257,20 @@ export class SalaryPeriodController extends Controller { } else { throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง"); } - + // หาจำนวน Quota คงเหลือ + if(salaryProfile?.salaryOrg.snapshot == "SNAP1"){ + const amountFullType = await this.salaryProfileRepository.count({ + where:{ + salaryOrgId:salaryProfile?.salaryOrg.id, + type:"FULL" + } + }); + const calRemainQuota = salaryProfile?.salaryOrg.fifteenPercent - amountFullType; + salaryProfile.salaryOrg.quantityUsed = amountFullType; + salaryProfile.salaryOrg.remainQuota = calRemainQuota; + await this.salaryOrgRepository.save(salaryProfile?.salaryOrg); + } + await this.salaryProfileRepository.save(salaryProfile); return new HttpSuccess(); } @@ -269,6 +297,21 @@ export class SalaryPeriodController extends Controller { if (!salaryOrg) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลกลุ่มการขอเลื่อนเงินเดือน"); } + + //หาจำนวน Quota คงเหลือ + if(salaryOrg.snapshot == "SNAP1"){ + const amountFullType = await this.salaryProfileRepository.count({ + where:{ + salaryOrgId:salaryOrg.id, + type:"FULL" + } + }); + const calRemainQuota = salaryOrg.fifteenPercent - amountFullType; + salaryOrg.quantityUsed = amountFullType; + salaryOrg.remainQuota = calRemainQuota; + await this.salaryOrgRepository.save(salaryOrg); + } + salaryProfile.salaryOrgId = salaryOrg.id; await this.salaryProfileRepository.save(salaryProfile); return new HttpSuccess(); @@ -456,6 +499,21 @@ export class SalaryPeriodController extends Controller { if (!salaryOrg) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบรอบการขึ้นเงินเดือน"); } + + //หาจำนวน Quota คงเหลือ + if(salaryOrg.snapshot == "SNAP1"){ + const amountFullType = await this.salaryProfileRepository.count({ + where:{ + salaryOrgId:salaryOrg.id, + type:"FULL" + } + }); + const calRemainQuota = salaryOrg.fifteenPercent - amountFullType; + salaryOrg.quantityUsed = amountFullType; + salaryOrg.remainQuota = calRemainQuota; + await this.salaryOrgRepository.save(salaryOrg); + } + const salaryOrgAll = await this.salaryOrgRepository.find({ where: { salaryPeriodId: salaryOrg.salaryPeriodId,