From 09701e131ae74bbb5c29bb470d98e3ae4e1b1d51 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 30 Oct 2024 10:23:36 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=AB=E0=B8=A5=E0=B8=B1=E0=B8=87?= =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=99=E0=B8=97=E0=B8=B6=E0=B8=81=E0=B8=A5=E0=B8=87=E0=B8=97?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 116 ++++++++++++++-------------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 89b2e0a..7476105 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -7185,6 +7185,58 @@ export class ReportController extends Controller { return new HttpSuccess(_salaryRank); } + + /** + * API ออกคำสั่ง + * + * @summary ออกคำสั่ง + * + * @param {string} id Guid, *Id ผังเงินเดือน + */ + @Post("command/officer/report") + async SalaryOfficerReportCommand( + @Body() + body: { + refIds: string[]; + }, + @Request() request: RequestWithUser, + ) { + const salaryProfile = await this.salaryProfileRepository.find({ + where: { id: In(body.refIds) }, + }); + const data = salaryProfile.map((_data) => ({ + ..._data, + status: "REPORT", + })); + await this.salaryProfileRepository.save(data); + return new HttpSuccess(); + } + /** + * API ออกคำสั่ง + * + * @summary ออกคำสั่ง + * + * @param {string} id Guid, *Id ผังเงินเดือน + */ + + @Post("command/employee/report") + async SalaryEmployeeReportCommand( + @Body() + body: { + refIds: string[]; + }, + @Request() request: RequestWithUser, + ) { + const salaryProfile = await this.salaryProfileEmployeeRepository.find({ + where: { id: In(body.refIds) }, + }); + const data = salaryProfile.map((_data) => ({ + ..._data, + status: "REPORT", + })); + await this.salaryProfileEmployeeRepository.save(data); + return new HttpSuccess(); + } /** * API ออกคำสั่ง @@ -7224,10 +7276,10 @@ export class ReportController extends Controller { .PostData(request, "/org/profile/salary", { profileId: salary.profileId, date: new Date(), - amount: salary.positionSalaryAmount, + amount: v.amount, commandId: v.commandId, - positionSalaryAmount: salary.amountSpecial, - mouthSalaryAmount: null, + positionSalaryAmount: v.positionSalaryAmount, + mouthSalaryAmount: v.mouthSalaryAmount, posNo: salary.orgShortName + salary.posMasterNo, position: salary.position, positionLine: null, @@ -7290,10 +7342,10 @@ export class ReportController extends Controller { .PostData(request, "/org/profile-employee/salary", { profileEmployeeId: salary.profileId, date: new Date(), - amount: salary.positionSalaryAmount, + amount: v.amount, commandId: v.commandId, - positionSalaryAmount: salary.amountSpecial, - mouthSalaryAmount: null, + positionSalaryAmount: v.positionSalaryAmount, + mouthSalaryAmount: v.mouthSalaryAmount, posNo: salary.orgShortName + salary.posMasterNo, position: salary.position, positionType: salary.posType, @@ -7315,56 +7367,7 @@ export class ReportController extends Controller { ); return new HttpSuccess(); } - /** - * API ออกคำสั่ง - * - * @summary ออกคำสั่ง - * - * @param {string} id Guid, *Id ผังเงินเดือน - */ - @Post("command/officer/report") - async SalaryOfficerReportCommand( - @Body() - body: { - refIds: string[]; - }, - @Request() request: RequestWithUser, - ) { - const salaryProfile = await this.salaryProfileRepository.find({ - where: { id: In(body.refIds) }, - }); - const data = salaryProfile.map((_data) => ({ - ..._data, - status: "REPORT", - })); - await this.salaryProfileRepository.save(data); - return new HttpSuccess(); - } - /** - * API ออกคำสั่ง - * - * @summary ออกคำสั่ง - * - * @param {string} id Guid, *Id ผังเงินเดือน - */ - @Post("command/employee/report") - async SalaryEmployeeReportCommand( - @Body() - body: { - refIds: string[]; - }, - @Request() request: RequestWithUser, - ) { - const salaryProfile = await this.salaryProfileEmployeeRepository.find({ - where: { id: In(body.refIds) }, - }); - const data = salaryProfile.map((_data) => ({ - ..._data, - status: "REPORT", - })); - await this.salaryProfileEmployeeRepository.save(data); - return new HttpSuccess(); - } + /** * API ออกคำสั่ง * @@ -7390,6 +7393,7 @@ export class ReportController extends Controller { await this.salaryProfileRepository.save(data); return new HttpSuccess(); } + /** * API ออกคำสั่ง *