|
@@ -184,36 +184,36 @@ export class MatchExtController implements BaseController {
|
|
@Post('/step3', { routerName: '初审阶段-公示名单' })
|
|
@Post('/step3', { routerName: '初审阶段-公示名单' })
|
|
async step3(@Body() data: object) {
|
|
async step3(@Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "2"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status => "3" 变为 初审阶段-公示名单
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "2" => '3'
|
|
|
|
- */
|
|
|
|
- const match_id = get(data, 'match_id')
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "2")
|
|
|
|
- await this.service.update({ match_id }, { status: '2' })
|
|
|
|
- await this.matchRegService.update({ match_id, ext_status: '1' }, { ext_status: '2' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "2"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status => "3" 变为 初审阶段-公示名单
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "2" => '3'
|
|
|
|
+ */
|
|
|
|
+ const match_id = get(data, 'match_id');
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '2');
|
|
|
|
+ await this.service.update({ match_id }, { status: '3' });
|
|
|
|
+ await this.matchRegService.update({ match_id, ext_status: '2' }, { ext_status: '3' });
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 查询初审名单
|
|
* 查询初审名单
|
|
* @param match_id 赛事id
|
|
* @param match_id 赛事id
|
|
*/
|
|
*/
|
|
- @Get('/step3/nameList/match_id', { routerName: '初审阶段-公示名单-名单查询' })
|
|
|
|
|
|
+ @Get('/step3/nameList/:match_id', { routerName: '初审阶段-公示名单-名单查询' })
|
|
async step3NameList(@Param('match_id') match_id: string) {
|
|
async step3NameList(@Param('match_id') match_id: string) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "3"
|
|
|
|
- * 查询内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "3";
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "3")
|
|
|
|
- const data = await this.matchRegService.query({ match_id, ext_status: '3' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "3"
|
|
|
|
+ * 查询内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "3";
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '3');
|
|
|
|
+ const data = await this.matchRegService.query({ match_id, ext_status: '3' });
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -225,19 +225,19 @@ export class MatchExtController implements BaseController {
|
|
@Post('/step4', { routerName: '初审阶段-赛事进行' })
|
|
@Post('/step4', { routerName: '初审阶段-赛事进行' })
|
|
async step4(@Body() data: object) {
|
|
async step4(@Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "3"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status => "4" 变为 初审阶段-赛事进行
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "3" => '4'
|
|
|
|
- */
|
|
|
|
- const match_id = get(data, 'match_id')
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "3")
|
|
|
|
- await this.service.update({ match_id }, { status: '4' })
|
|
|
|
- await this.matchRegService.update({ match_id, ext_status: '3' }, { ext_status: '4' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "3"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status => "4" 变为 初审阶段-赛事进行
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "3" => '4'
|
|
|
|
+ */
|
|
|
|
+ const match_id = get(data, 'match_id');
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '3');
|
|
|
|
+ await this.service.update({ match_id }, { status: '4' });
|
|
|
|
+ await this.matchRegService.update({ match_id, ext_status: '3' }, { ext_status: '4' });
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 初审阶段-赛事进行-上传成绩, 只上传分数
|
|
* 初审阶段-赛事进行-上传成绩, 只上传分数
|
|
@@ -249,26 +249,26 @@ export class MatchExtController implements BaseController {
|
|
@Post('/step4/score/:match_id', { routerName: '初审阶段-赛事进行-上传成绩' })
|
|
@Post('/step4/score/:match_id', { routerName: '初审阶段-赛事进行-上传成绩' })
|
|
async step4Score(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async step4Score(@Param('match_id') match_id: string, @Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "4"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "4"
|
|
|
|
- * reg.status: '0'
|
|
|
|
- * reg.score = ${score}
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "4")
|
|
|
|
- const reg_id = get(data, 'reg_id')
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "4"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "4"
|
|
|
|
+ * reg.status: '0'
|
|
|
|
+ * reg.score = ${score}
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '4');
|
|
|
|
+ const reg_id = get(data, 'reg_id');
|
|
// const status = get(data, 'status')
|
|
// const status = get(data, 'status')
|
|
- const score = get(data, 'score')
|
|
|
|
- const query = { id: reg_id, ext_status: '4', status: '0' }
|
|
|
|
- const regData = await this.matchRegService.fetch(query)
|
|
|
|
|
|
+ const score = get(data, 'score');
|
|
|
|
+ const query = { id: reg_id, ext_status: '4', status: '0' };
|
|
|
|
+ const regData = await this.matchRegService.fetch(query);
|
|
if (!regData) {
|
|
if (!regData) {
|
|
// 抛出异常: 该选手不符合上传成绩的要求,请检查选手信息
|
|
// 抛出异常: 该选手不符合上传成绩的要求,请检查选手信息
|
|
throw new ServiceError(ErrorCode.MATCH_REG_USER_ERROR);
|
|
throw new ServiceError(ErrorCode.MATCH_REG_USER_ERROR);
|
|
}
|
|
}
|
|
- await this.matchRegService.update({ id: reg_id }, { score })
|
|
|
|
|
|
+ await this.matchRegService.update({ id: reg_id }, { score });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -277,44 +277,44 @@ export class MatchExtController implements BaseController {
|
|
* @param data body
|
|
* @param data body
|
|
* @property ids 报名信息id
|
|
* @property ids 报名信息id
|
|
*/
|
|
*/
|
|
- @Post('/step4/to5/:match_id', { routerName: "初审阶段-赛事进行-选择决赛名单" })
|
|
|
|
|
|
+ @Post('/step4/to5/:match_id', { routerName: '初审阶段-赛事进行-选择决赛名单' })
|
|
async step4To5(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async step4To5(@Param('match_id') match_id: string, @Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "4"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "4"
|
|
|
|
- * reg.status: '0'
|
|
|
|
- * reg.status: '0' => '1'
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "4")
|
|
|
|
- const ids = get(data, 'ids', [])
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "4"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "4"
|
|
|
|
+ * reg.status: '0'
|
|
|
|
+ * reg.status: '0' => '1'
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '4');
|
|
|
|
+ const ids = get(data, 'ids', []);
|
|
for (const id of ids) {
|
|
for (const id of ids) {
|
|
- await this.matchRegService.update({ id: id, ext_status: '4', status: '0' }, { status: '1' })
|
|
|
|
|
|
+ await this.matchRegService.update({ id: id, ext_status: '4', status: '0' }, { status: '1' });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Post('/step5', { routerName: '决赛阶段-组织决赛' })
|
|
@Post('/step5', { routerName: '决赛阶段-组织决赛' })
|
|
async step5(@Body() data: object) {
|
|
async step5(@Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "4"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status => "5"
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "4"
|
|
|
|
- * reg.status: '1'
|
|
|
|
- * reg.status: '1' => '0'
|
|
|
|
- * reg.ext_status: '4' => '5'
|
|
|
|
- */
|
|
|
|
- const match_id = get(data, 'match_id')
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "4")
|
|
|
|
- await this.service.update({ id: match_id }, { status: '5' })
|
|
|
|
- await this.matchRegService.update({ match_id, ext_status: '4', status: '1' }, { status: '0', ext_status: '5' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "4"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status => "5"
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "4"
|
|
|
|
+ * reg.status: '1'
|
|
|
|
+ * reg.status: '1' => '0'
|
|
|
|
+ * reg.ext_status: '4' => '5'
|
|
|
|
+ */
|
|
|
|
+ const match_id = get(data, 'match_id');
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '4');
|
|
|
|
+ await this.service.update({ id: match_id }, { status: '5' });
|
|
|
|
+ await this.matchRegService.update({ match_id, ext_status: '4', status: '1' }, { status: '0', ext_status: '5' });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -327,32 +327,31 @@ export class MatchExtController implements BaseController {
|
|
@Post('/step5/time/:match_id', { routerName: '决赛阶段-组织决赛-设置决赛时间' })
|
|
@Post('/step5/time/:match_id', { routerName: '决赛阶段-组织决赛-设置决赛时间' })
|
|
async step5SetTime(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async step5SetTime(@Param('match_id') match_id: string, @Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "5"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status: "5"
|
|
|
|
- * reg.status: '0'
|
|
|
|
- * reg.final_start_time => ${start_time}
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- const ids = get(data, 'ids', [])
|
|
|
|
- const start_time = get(data, 'start_time')
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "5"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status: "5"
|
|
|
|
+ * reg.status: '0'
|
|
|
|
+ * reg.final_start_time => ${start_time}
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ const ids = get(data, 'ids', []);
|
|
|
|
+ const start_time = get(data, 'start_time');
|
|
for (const id of ids) {
|
|
for (const id of ids) {
|
|
- await this.matchRegService.update({ id, ext_status: '5', status: '0' }, { final_start_time: start_time })
|
|
|
|
|
|
+ await this.matchRegService.update({ id, ext_status: '5', status: '0' }, { final_start_time: start_time });
|
|
}
|
|
}
|
|
- return 'ok'
|
|
|
|
|
|
+ return 'ok';
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
@Get('/step5/sms/:match_id', { routerName: '决赛阶段-组织决赛-短信通知' })
|
|
@Get('/step5/sms/:match_id', { routerName: '决赛阶段-组织决赛-短信通知' })
|
|
async step5Sms(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async step5Sms(@Param('match_id') match_id: string, @Body() data: object) {
|
|
/**
|
|
/**
|
|
* 检查内容:
|
|
* 检查内容:
|
|
* 赛事拓展表:
|
|
* 赛事拓展表:
|
|
* ext.status = "5"
|
|
* ext.status = "5"
|
|
- * 组织内容:
|
|
|
|
|
|
+ * 组织内容:
|
|
* 赛事报名表:
|
|
* 赛事报名表:
|
|
* reg.ext_status:'5'
|
|
* reg.ext_status:'5'
|
|
* reg.status: '0'
|
|
* reg.status: '0'
|
|
@@ -360,26 +359,25 @@ export class MatchExtController implements BaseController {
|
|
* 1.获取赛事信息----标题
|
|
* 1.获取赛事信息----标题
|
|
* 2.获取赛事报名信息----每个人的决赛时间
|
|
* 2.获取赛事报名信息----每个人的决赛时间
|
|
* 3.获取用户信息----昵称,电话
|
|
* 3.获取用户信息----昵称,电话
|
|
- * 4.组织短信: ${昵称} 您参加的赛事: ${标题} 将于 ${决赛时间} 开始,
|
|
|
|
|
|
+ * 4.组织短信: ${昵称} 您参加的赛事: ${标题} 将于 ${决赛时间} 开始,
|
|
* 请您在网站或小程序中进行确认,以避免主办方将您误认为拒赛而采用其他选手代替
|
|
* 请您在网站或小程序中进行确认,以避免主办方将您误认为拒赛而采用其他选手代替
|
|
*/
|
|
*/
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- const matchInfo = await this.matchService.fetch({ id: match_id })
|
|
|
|
- const match_name = get(matchInfo, 'name')
|
|
|
|
- const { data: extList } = await this.service.query({ match_id, ext_status: '5', status: '0', final_confirm: '1' })
|
|
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ const matchInfo = await this.matchService.fetch({ id: match_id });
|
|
|
|
+ const match_name = get(matchInfo, 'name');
|
|
|
|
+ const { data: extList } = await this.service.query({ match_id, ext_status: '5', status: '0', final_confirm: '1' });
|
|
for (const i of extList) {
|
|
for (const i of extList) {
|
|
- const user_id = get(i, 'user_id')
|
|
|
|
|
|
+ const user_id = get(i, 'user_id');
|
|
if (!user_id) continue;
|
|
if (!user_id) continue;
|
|
- const userInfo = this.userService.fetch({ id: user_id })
|
|
|
|
|
|
+ const userInfo = this.userService.fetch({ id: user_id });
|
|
if (!userInfo) continue;
|
|
if (!userInfo) continue;
|
|
- const phone = get(userInfo, 'phone')
|
|
|
|
|
|
+ const phone = get(userInfo, 'phone');
|
|
if (!phone) continue;
|
|
if (!phone) continue;
|
|
- const nick_name = get(userInfo, 'nick_name')
|
|
|
|
|
|
+ const nick_name = get(userInfo, 'nick_name');
|
|
if (!nick_name) continue;
|
|
if (!nick_name) continue;
|
|
- const start_time = get(i, 'start_time')
|
|
|
|
- const smsMsg = `${nick_name} 您参加的赛事: ${match_name} 将于 ${start_time} 开始, 请您在网站或小程序中进行确认,以避免主办方将您误认为拒赛而采用其他选手代替`
|
|
|
|
|
|
+ const start_time = get(i, 'start_time');
|
|
|
|
+ const smsMsg = `${nick_name} 您参加的赛事: ${match_name} 将于 ${start_time} 开始, 请您在网站或小程序中进行确认,以避免主办方将您误认为拒赛而采用其他选手代替`;
|
|
// TODO: 发短信
|
|
// TODO: 发短信
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -395,32 +393,32 @@ export class MatchExtController implements BaseController {
|
|
* 检查内容:
|
|
* 检查内容:
|
|
* 赛事拓展表:
|
|
* 赛事拓展表:
|
|
* ext.status = "5"
|
|
* ext.status = "5"
|
|
- * 修改内容:
|
|
|
|
|
|
+ * 修改内容:
|
|
* 赛事报名表:
|
|
* 赛事报名表:
|
|
* reg.ext_status:'5'
|
|
* reg.ext_status:'5'
|
|
* reg.status: '0'
|
|
* reg.status: '0'
|
|
* final_confirm => '0'
|
|
* final_confirm => '0'
|
|
*/
|
|
*/
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- const user_id = get(data, 'user_id')
|
|
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ const user_id = get(data, 'user_id');
|
|
// 默认规定顺序,先来后到
|
|
// 默认规定顺序,先来后到
|
|
- const { data: list } = await this.matchRegService.query({ match_id, ext_status: '5', status: '0', final_confirm: '0' })
|
|
|
|
|
|
+ const { data: list } = await this.matchRegService.query({ match_id, ext_status: '5', status: '0', final_confirm: '0' });
|
|
// 做默认序号,将已经确认的人查出来,然后排查序号,如果中间有缺少的序号,就先补充到缺少的序号中;如果没有缺少,那就往后默认排
|
|
// 做默认序号,将已经确认的人查出来,然后排查序号,如果中间有缺少的序号,就先补充到缺少的序号中;如果没有缺少,那就往后默认排
|
|
let lastOrderNum = 1;
|
|
let lastOrderNum = 1;
|
|
for (const i of list) {
|
|
for (const i of list) {
|
|
- const thisOrderNum = get(i, 'final_order_no')
|
|
|
|
|
|
+ const thisOrderNum = get(i, 'final_order_no');
|
|
// 按理说,不应该出现没有排序的情况
|
|
// 按理说,不应该出现没有排序的情况
|
|
if (!thisOrderNum) continue;
|
|
if (!thisOrderNum) continue;
|
|
// 顺序不一致,说明少了
|
|
// 顺序不一致,说明少了
|
|
if (lastOrderNum != thisOrderNum) {
|
|
if (lastOrderNum != thisOrderNum) {
|
|
- // 少了就需要把当前的补上.会出现2种情况, 正常顺序<当前顺序: 按正常顺序进行补充;
|
|
|
|
|
|
+ // 少了就需要把当前的补上.会出现2种情况, 正常顺序<当前顺序: 按正常顺序进行补充;
|
|
// 正常顺序>当前顺序:说明从此开始,后面的序号都是乱的,是不应该出现的情况.如果出现了,就需要人为调整了.所以只考虑第一个情况
|
|
// 正常顺序>当前顺序:说明从此开始,后面的序号都是乱的,是不应该出现的情况.如果出现了,就需要人为调整了.所以只考虑第一个情况
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
// 下一个,如果不循环了,那就直接给新数据用
|
|
// 下一个,如果不循环了,那就直接给新数据用
|
|
lastOrderNum = lastOrderNum + 1;
|
|
lastOrderNum = lastOrderNum + 1;
|
|
}
|
|
}
|
|
- await this.matchRegService.update({ match_id, user_id, ext_status: '5', status: '0' }, { final_confirm: '0', final_order_no: lastOrderNum })
|
|
|
|
|
|
+ await this.matchRegService.update({ match_id, user_id, ext_status: '5', status: '0' }, { final_confirm: '0', final_order_no: lastOrderNum });
|
|
}
|
|
}
|
|
|
|
|
|
@Post('/step5/refuse/:match_id', { routerName: '决赛阶段-组织决赛-拒绝参加决赛' })
|
|
@Post('/step5/refuse/:match_id', { routerName: '决赛阶段-组织决赛-拒绝参加决赛' })
|
|
@@ -429,15 +427,15 @@ export class MatchExtController implements BaseController {
|
|
* 检查内容:
|
|
* 检查内容:
|
|
* 赛事拓展表:
|
|
* 赛事拓展表:
|
|
* ext.status = "5"
|
|
* ext.status = "5"
|
|
- * 修改内容:
|
|
|
|
|
|
+ * 修改内容:
|
|
* 赛事报名表:
|
|
* 赛事报名表:
|
|
* reg.ext_status:'5'
|
|
* reg.ext_status:'5'
|
|
* reg.status: '0'
|
|
* reg.status: '0'
|
|
* reg.status => '2'
|
|
* reg.status => '2'
|
|
*/
|
|
*/
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- const user_id = get(data, 'user_id')
|
|
|
|
- await this.matchRegService.update({ match_id, user_id, ext_status: '5', status: '0' }, { status: '2' })
|
|
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ const user_id = get(data, 'user_id');
|
|
|
|
+ await this.matchRegService.update({ match_id, user_id, ext_status: '5', status: '0' }, { status: '2' });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -449,37 +447,36 @@ export class MatchExtController implements BaseController {
|
|
@Post('/step5/supplement/:match_id', { routerName: '决赛阶段-组织决赛-补充决赛人员' })
|
|
@Post('/step5/supplement/:match_id', { routerName: '决赛阶段-组织决赛-补充决赛人员' })
|
|
async step5Supplement(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async step5Supplement(@Param('match_id') match_id: string, @Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "5"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status:'4'=>'5'
|
|
|
|
- * reg.status =>'0'
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- const user_id = get(data, 'user_id')
|
|
|
|
- await this.matchRegService.update({ match_id, user_id, ext_status: '4' }, { ext_status: '5', status: '0' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "5"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status:'4'=>'5'
|
|
|
|
+ * reg.status =>'0'
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ const user_id = get(data, 'user_id');
|
|
|
|
+ await this.matchRegService.update({ match_id, user_id, ext_status: '4' }, { ext_status: '5', status: '0' });
|
|
}
|
|
}
|
|
|
|
|
|
@Get('/step5/list/:match_id', { routerName: '决赛阶段-组织决赛-决赛人员名单' })
|
|
@Get('/step5/list/:match_id', { routerName: '决赛阶段-组织决赛-决赛人员名单' })
|
|
async step5NameList(@Param('match_id') match_id: string) {
|
|
async step5NameList(@Param('match_id') match_id: string) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "5"
|
|
|
|
- * 组织内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.ext_status:'5'
|
|
|
|
- * reg.final_confirm =>'0'
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "5"
|
|
|
|
+ * 组织内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.ext_status:'5'
|
|
|
|
+ * reg.final_confirm =>'0'
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
// 决赛名单,根据顺序升序
|
|
// 决赛名单,根据顺序升序
|
|
- const { data: list } = await this.matchRegService.query({ match_id, ext_status: '5', final_confirm: '0' }, { order: { final_order_no: 'ASC' } })
|
|
|
|
|
|
+ const { data: list } = await this.matchRegService.query({ match_id, ext_status: '5', final_confirm: '0' }, { order: { final_order_no: 'ASC' } });
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 决赛人员排序
|
|
* 决赛人员排序
|
|
* @param match_id 赛事id
|
|
* @param match_id 赛事id
|
|
@@ -490,23 +487,23 @@ export class MatchExtController implements BaseController {
|
|
@Post('/step5/order/:match_id', { routerName: '决赛阶段-组织决赛-人员排序' })
|
|
@Post('/step5/order/:match_id', { routerName: '决赛阶段-组织决赛-人员排序' })
|
|
async step5Order(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async step5Order(@Param('match_id') match_id: string, @Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "5"
|
|
|
|
- * 组织内容:
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.final_order_no =>'0'
|
|
|
|
- */
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- const { data: list } = await this.matchRegService.query({ match_id, ext_status: '5', final_confirm: '0' }, { order: { final_order_no: 'ASC' } })
|
|
|
|
- const id = get(data, 'id')
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "5"
|
|
|
|
+ * 组织内容:
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.final_order_no =>'0'
|
|
|
|
+ */
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ const { data: list } = await this.matchRegService.query({ match_id, ext_status: '5', final_confirm: '0' }, { order: { final_order_no: 'ASC' } });
|
|
|
|
+ const id = get(data, 'id');
|
|
if (!id) {
|
|
if (!id) {
|
|
// 抛出异常:缺少报名信息
|
|
// 抛出异常:缺少报名信息
|
|
- throw new ServiceError(ErrorCode.MATCH_EXT_DATA_NOT_FOUND)
|
|
|
|
|
|
+ throw new ServiceError(ErrorCode.MATCH_EXT_DATA_NOT_FOUND);
|
|
}
|
|
}
|
|
const order_no = get(data, 'order_no');
|
|
const order_no = get(data, 'order_no');
|
|
// 没写,直接不该
|
|
// 没写,直接不该
|
|
- if (!order_no) return 'ok'
|
|
|
|
|
|
+ if (!order_no) return 'ok';
|
|
/**数据原索引 */
|
|
/**数据原索引 */
|
|
const oldIndex = list.findIndex(f => f.id === id);
|
|
const oldIndex = list.findIndex(f => f.id === id);
|
|
// 没数据,不改
|
|
// 没数据,不改
|
|
@@ -527,58 +524,58 @@ export class MatchExtController implements BaseController {
|
|
// 移动的索引要+1
|
|
// 移动的索引要+1
|
|
targetIndex = targetIndex + 1;
|
|
targetIndex = targetIndex + 1;
|
|
}
|
|
}
|
|
- list.splice(targetIndex, 0, oldData)
|
|
|
|
- list.splice(removeIndex, 1)
|
|
|
|
|
|
+ list.splice(targetIndex, 0, oldData);
|
|
|
|
+ list.splice(removeIndex, 1);
|
|
// 重新排列
|
|
// 重新排列
|
|
for (let index = 0; index < list.length; index++) {
|
|
for (let index = 0; index < list.length; index++) {
|
|
const e = list[index];
|
|
const e = list[index];
|
|
- const id = get(e, 'id')
|
|
|
|
- await this.matchRegService.update({ id }, { final_order_no: index + 1 })
|
|
|
|
|
|
+ const id = get(e, 'id');
|
|
|
|
+ await this.matchRegService.update({ id }, { final_order_no: index + 1 });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Post('/step6', { routerName: '决赛阶段-名单公示' })
|
|
@Post('/step6', { routerName: '决赛阶段-名单公示' })
|
|
async step6(@Body() data: object) {
|
|
async step6(@Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "5"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status => "6" 变为 决赛阶段-名单公示
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.final_confirm:'0'
|
|
|
|
- * reg.ext_status: "5" => '6'
|
|
|
|
- */
|
|
|
|
- const match_id = get(data, 'match_id')
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "5")
|
|
|
|
- await this.service.update({ match_id }, { status: '6' })
|
|
|
|
- await this.matchRegService.update({ match_id, ext_status: '5', final_confirm: '0' }, { ext_status: '6' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "5"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status => "6" 变为 决赛阶段-名单公示
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.final_confirm:'0'
|
|
|
|
+ * reg.ext_status: "5" => '6'
|
|
|
|
+ */
|
|
|
|
+ const match_id = get(data, 'match_id');
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '5');
|
|
|
|
+ await this.service.update({ match_id }, { status: '6' });
|
|
|
|
+ await this.matchRegService.update({ match_id, ext_status: '5', final_confirm: '0' }, { ext_status: '6' });
|
|
}
|
|
}
|
|
|
|
|
|
@Post('/step7', { routerName: '决赛阶段-赛事进行' })
|
|
@Post('/step7', { routerName: '决赛阶段-赛事进行' })
|
|
- async step7(@Body() data: object) {
|
|
|
|
|
|
+ async step7(@Body() data: object) {
|
|
/**
|
|
/**
|
|
- * 检查内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status = "6"
|
|
|
|
- * 修改内容:
|
|
|
|
- * 赛事拓展表:
|
|
|
|
- * ext.status => "7" 变为 决赛阶段-赛事进行
|
|
|
|
- * 赛事报名表:
|
|
|
|
- * reg.final_confirm:'0'
|
|
|
|
- * reg.ext_status: "6" => '7'
|
|
|
|
- */
|
|
|
|
- const match_id = get(data, 'match_id')
|
|
|
|
- await this.service.checkMatchExtStatus(match_id, "6")
|
|
|
|
- await this.service.update({ match_id }, { status: '7' })
|
|
|
|
- await this.matchRegService.update({ match_id, ext_status: '6', final_confirm: '0' }, { ext_status: '7' })
|
|
|
|
|
|
+ * 检查内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status = "6"
|
|
|
|
+ * 修改内容:
|
|
|
|
+ * 赛事拓展表:
|
|
|
|
+ * ext.status => "7" 变为 决赛阶段-赛事进行
|
|
|
|
+ * 赛事报名表:
|
|
|
|
+ * reg.final_confirm:'0'
|
|
|
|
+ * reg.ext_status: "6" => '7'
|
|
|
|
+ */
|
|
|
|
+ const match_id = get(data, 'match_id');
|
|
|
|
+ await this.service.checkMatchExtStatus(match_id, '6');
|
|
|
|
+ await this.service.update({ match_id }, { status: '7' });
|
|
|
|
+ await this.matchRegService.update({ match_id, ext_status: '6', final_confirm: '0' }, { ext_status: '7' });
|
|
}
|
|
}
|
|
|
|
|
|
// TODO:决赛大屏,评委打分
|
|
// TODO:决赛大屏,评委打分
|
|
|
|
|
|
@Post('/step8', { routerName: '决赛阶段-赛事结束' })
|
|
@Post('/step8', { routerName: '决赛阶段-赛事结束' })
|
|
- async step8(@Body() data: object) { }
|
|
|
|
|
|
+ async step8(@Body() data: object) {}
|
|
|
|
|
|
@Get('/firstStep/:match_id', { routerName: '进入初审阶段' })
|
|
@Get('/firstStep/:match_id', { routerName: '进入初审阶段' })
|
|
async toFirstStep(@Param('match_id') match_id: string, @Body() data: object) {
|
|
async toFirstStep(@Param('match_id') match_id: string, @Body() data: object) {
|