diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index bd97889..7514029 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -1066,7 +1066,17 @@ export class ReportController extends Controller { salaryRef: v.templateDoc, })), }) - .then(async res => {}) + .then(async res => { + const lists = await this.personalRepository.find({ + where: { probation_status: 8, personal_id: In(body.refIds.map(x => x.refId)) }, + }) + await Promise.all( + lists.map(async list => { + list.probation_status = 9 + await this.personalRepository.save(list) + }) + ) + }) .catch(() => {}) return new HttpSuccess() } @@ -1081,6 +1091,32 @@ export class ReportController extends Controller { const lists = await this.personalRepository.find({ where: { probation_status: 2, personal_id: In(body.refIds) }, }) + await Promise.all( + lists.map(async list => { + list.probation_status = 8 + await this.personalRepository.save(list) + }) + ) + + return new HttpSuccess() + } + @Post("command11/officer/report/delete") + public async command11Delete( + @Request() req: RequestWithUser, + @Body() + body: { + refIds: string[] + } + ) { + const lists = await this.personalRepository.find({ + where: { probation_status: 8, personal_id: In(body.refIds) }, + }) + await Promise.all( + lists.map(async list => { + list.probation_status = 2 + await this.personalRepository.save(list) + }) + ) return new HttpSuccess() } @@ -1111,7 +1147,17 @@ export class ReportController extends Controller { salaryRef: v.templateDoc, })), }) - .then(async res => {}) + .then(async res => { + const lists = await this.personalRepository.find({ + where: { probation_status: 8, personal_id: In(body.refIds.map(x => x.refId)) }, + }) + await Promise.all( + lists.map(async list => { + list.probation_status = 9 + await this.personalRepository.save(list) + }) + ) + }) .catch(() => {}) return new HttpSuccess() } @@ -1126,7 +1172,31 @@ export class ReportController extends Controller { const lists = await this.personalRepository.find({ where: { probation_status: 3, personal_id: In(body.refIds) }, }) - + await Promise.all( + lists.map(async list => { + list.probation_status = 8 + await this.personalRepository.save(list) + }) + ) + return new HttpSuccess() + } + @Post("command12/officer/report/delete") + public async command12Delete( + @Request() req: RequestWithUser, + @Body() + body: { + refIds: string[] + } + ) { + const lists = await this.personalRepository.find({ + where: { probation_status: 8, personal_id: In(body.refIds) }, + }) + await Promise.all( + lists.map(async list => { + list.probation_status = 3 + await this.personalRepository.save(list) + }) + ) return new HttpSuccess() } }