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 ออกคำสั่ง *