fix(mini): ensure general judge sees all projects regardless of venue

- Add check for refereeType == 3 or role == general_judge before filtering by venue
- General judges now always get all projects for the competition
- Prevents issue where general judge assigned to a venue would see no projects

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
2026-01-05 16:38:30 +08:00
parent 55ccf08246
commit 3af34506ba
10 changed files with 20 additions and 6 deletions

View File

@@ -114,16 +114,23 @@ public class MartialMiniController extends BladeController {
martialVenue = venueService.getById(invite.getVenueId());
}
// 获取项目列表:如果邀请记录中有指定项目则使用,否则根据场地获取项目
// 获取项目列表:总裁判看所有项目,其他裁判根据场地获取项目
List<MiniLoginVO.ProjectInfo> projects;
if (Func.isNotEmpty(invite.getProjects())) {
Integer refereeTypeVal = invite.getRefereeType();
String roleVal = invite.getRole();
boolean isGeneralJudge = (refereeTypeVal != null && refereeTypeVal == 3)
|| "general_judge".equals(roleVal) || "general".equals(roleVal);
if (isGeneralJudge) {
// 总裁判看所有项目
projects = getAllProjectsByCompetition(competition.getId());
} else if (Func.isNotEmpty(invite.getProjects())) {
projects = parseProjects(invite.getProjects());
} else {
// 未指定项目,根据场地获取项目;如果没有场地则获取所有项目
if (invite.getVenueId() != null) {
projects = getProjectsByVenue(invite.getVenueId());
} else {
// 总裁或未分配场地的裁判,获取所有项目
projects = getAllProjectsByCompetition(competition.getId());
}
}
@@ -522,16 +529,23 @@ public class MartialMiniController extends BladeController {
MartialCompetition competition = competitionService.getById(invite.getCompetitionId());
MartialJudge judge = judgeService.getById(invite.getJudgeId());
MartialVenue martialVenue = invite.getVenueId() != null ? venueService.getById(invite.getVenueId()) : null;
// 获取项目列表:如果邀请记录中有指定项目则使用,否则根据场地获取项目
// 获取项目列表:总裁判看所有项目,其他裁判根据场地获取项目
List<MiniLoginVO.ProjectInfo> projects;
if (Func.isNotEmpty(invite.getProjects())) {
Integer refereeTypeVal = invite.getRefereeType();
String roleVal = invite.getRole();
boolean isGeneralJudge = (refereeTypeVal != null && refereeTypeVal == 3)
|| "general_judge".equals(roleVal) || "general".equals(roleVal);
if (isGeneralJudge) {
// 总裁判看所有项目
projects = getAllProjectsByCompetition(competition.getId());
} else if (Func.isNotEmpty(invite.getProjects())) {
projects = parseProjects(invite.getProjects());
} else {
// 未指定项目,根据场地获取项目;如果没有场地则获取所有项目
if (invite.getVenueId() != null) {
projects = getProjectsByVenue(invite.getVenueId());
} else {
// 总裁或未分配场地的裁判,获取所有项目
projects = getAllProjectsByCompetition(competition.getId());
}
}