feat: 批量导入裁判时根据refereeType自动设置角色
- batchGenerateInviteCode方法查询裁判的refereeType - refereeType=1 自动设置为chief_judge(裁判长) - 其他情况设置为judge(普通裁判) 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -162,16 +162,26 @@ public class MartialJudgeInviteServiceImpl extends ServiceImpl<MartialJudgeInvit
|
||||
|
||||
for (Long judgeId : dto.getJudgeIds()) {
|
||||
try {
|
||||
// 查询裁判信息,根据refereeType自动设置角色
|
||||
MartialJudge judge = martialJudgeService.getById(judgeId);
|
||||
String role = dto.getRole(); // 默认使用传入的角色
|
||||
if (judge != null && judge.getRefereeType() != null) {
|
||||
// refereeType=1 为主裁判,设置为chief_judge
|
||||
role = judge.getRefereeType() == 1 ? "chief_judge" : "judge";
|
||||
}
|
||||
|
||||
GenerateInviteDTO generateDto = new GenerateInviteDTO();
|
||||
generateDto.setCompetitionId(dto.getCompetitionId());
|
||||
generateDto.setJudgeId(judgeId);
|
||||
generateDto.setRole(dto.getRole());
|
||||
generateDto.setRole(role);
|
||||
generateDto.setExpireDays(dto.getExpireDays());
|
||||
generateDto.setVenueId(dto.getVenueId());
|
||||
generateDto.setProjects(dto.getProjects());
|
||||
|
||||
MartialJudgeInvite invite = generateInviteCode(generateDto);
|
||||
invites.add(invite);
|
||||
|
||||
log.info("为评委{}生成邀请码,角色:{}", judgeId, role);
|
||||
} catch (Exception e) {
|
||||
log.warn("为评委{}生成邀请码失败:{}", judgeId, e.getMessage());
|
||||
failedJudges.add(judgeId.toString());
|
||||
|
||||
Reference in New Issue
Block a user