diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 94d128b..ded0593 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -6553,11 +6553,15 @@ export class ReportController extends Controller { const _salaryRank = salaryRank.map((item) => ({ id: item.id, - citizenId: item.citizenId, + posMasterNo: `${item.orgShortName}${item.posMasterNo}`, + positionName: item.position, + posType: item.posType, + posLevel: item.posLevel, + profileId: item.profileId, prefix: item.prefix, firstName: item.firstName, lastName: item.lastName, - profileId: item.profileId, + citizenId: item.citizenId, })); return new HttpSuccess(_salaryRank); @@ -6599,11 +6603,15 @@ export class ReportController extends Controller { const _salaryRank = salaryRank.map((item) => ({ id: item.id, - citizenId: item.citizenId, + posMasterNo: `${item.orgShortName}${item.posMasterNo}`, + positionName: item.position, + posType: item.posType, + posLevel: item.posLevel, + profileId: item.profileId, prefix: item.prefix, firstName: item.firstName, lastName: item.lastName, - profileId: item.profileId, + citizenId: item.citizenId, })); return new HttpSuccess(_salaryRank); @@ -6639,11 +6647,15 @@ export class ReportController extends Controller { const _salaryRank = salaryRank.map((item) => ({ id: item.id, - citizenId: item.citizenId, + posMasterNo: `${item.orgShortName}${item.posMasterNo}`, + positionName: item.position, + posType: item.posType, + posLevel: item.posLevel, + profileId: item.profileId, prefix: item.prefix, firstName: item.firstName, lastName: item.lastName, - profileId: item.profileId, + citizenId: item.citizenId, })); return new HttpSuccess(_salaryRank); @@ -6678,11 +6690,15 @@ export class ReportController extends Controller { const _salaryRank = salaryRank.map((item) => ({ id: item.id, - citizenId: item.citizenId, + posMasterNo: `${item.orgShortName}${item.posMasterNo}`, + positionName: item.position, + posType: item.posType, + posLevel: `${item.posTypeShort}${item.posLevel}`, + profileId: item.profileId, prefix: item.prefix, firstName: item.firstName, lastName: item.lastName, - profileId: item.profileId, + citizenId: item.citizenId, })); return new HttpSuccess(_salaryRank); @@ -6717,11 +6733,15 @@ export class ReportController extends Controller { const _salaryRank = salaryRank.map((item) => ({ id: item.id, - citizenId: item.citizenId, + posMasterNo: `${item.orgShortName}${item.posMasterNo}`, + positionName: item.position, + posType: item.posType, + posLevel: `${item.posTypeShort}${item.posLevel}`, + profileId: item.profileId, prefix: item.prefix, firstName: item.firstName, lastName: item.lastName, - profileId: item.profileId, + citizenId: item.citizenId, })); return new HttpSuccess(_salaryRank); @@ -6871,6 +6891,14 @@ export class ReportController extends Controller { }, @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(); } /** @@ -6888,6 +6916,64 @@ export class ReportController extends Controller { }, @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 ออกคำสั่ง + * + * @summary ออกคำสั่ง + * + * @param {string} id Guid, *Id ผังเงินเดือน + */ + @Post("command/officer/report/delete") + async SalaryOfficerReportCommandDelete( + @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: "PENDING", + })); + await this.salaryProfileRepository.save(data); + return new HttpSuccess(); + } + /** + * API ออกคำสั่ง + * + * @summary ออกคำสั่ง + * + * @param {string} id Guid, *Id ผังเงินเดือน + */ + @Post("command/employee/report/delete") + async SalaryEmployeeReportCommandDelete( + @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: "PENDING", + })); + await this.salaryProfileEmployeeRepository.save(data); return new HttpSuccess(); } }