fix: 优化重复报名检查逻辑 - 只检查registration_status=1的记录,跳过而非拒绝重复报名
This commit is contained in:
+9
-7
@@ -334,12 +334,13 @@ public class MartialRegistrationOrderController extends BladeController {
|
|||||||
teamCheckWrapper.eq(MartialAthlete::getCompetitionId, dto.getCompetitionId())
|
teamCheckWrapper.eq(MartialAthlete::getCompetitionId, dto.getCompetitionId())
|
||||||
.eq(MartialAthlete::getProjectId, projectId)
|
.eq(MartialAthlete::getProjectId, projectId)
|
||||||
.eq(MartialAthlete::getTeamName, team.getTeamName())
|
.eq(MartialAthlete::getTeamName, team.getTeamName())
|
||||||
.eq(MartialAthlete::getIsDeleted, 0);
|
.eq(MartialAthlete::getIsDeleted, 0)
|
||||||
|
.eq(MartialAthlete::getRegistrationStatus, 1);
|
||||||
MartialAthlete existingTeamRecord = athleteService.getOne(teamCheckWrapper, false);
|
MartialAthlete existingTeamRecord = athleteService.getOne(teamCheckWrapper, false);
|
||||||
|
|
||||||
if (existingTeamRecord != null) {
|
if (existingTeamRecord != null) {
|
||||||
log.warn("集体重复报名: teamName={}, projectId={}", team.getTeamName(), projectId);
|
log.warn("集体重复报名,已跳过: teamName={}, projectId={}", team.getTeamName(), projectId);
|
||||||
return R.fail("集体 " + team.getTeamName() + " 已报名该项目,请勿重复报名");
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
MartialAthlete teamAthlete = new MartialAthlete();
|
MartialAthlete teamAthlete = new MartialAthlete();
|
||||||
@@ -377,13 +378,14 @@ public class MartialRegistrationOrderController extends BladeController {
|
|||||||
checkWrapper.eq(MartialAthlete::getCompetitionId, dto.getCompetitionId())
|
checkWrapper.eq(MartialAthlete::getCompetitionId, dto.getCompetitionId())
|
||||||
.eq(MartialAthlete::getProjectId, projectId)
|
.eq(MartialAthlete::getProjectId, projectId)
|
||||||
.eq(MartialAthlete::getIdCard, existingAthlete.getIdCard())
|
.eq(MartialAthlete::getIdCard, existingAthlete.getIdCard())
|
||||||
.eq(MartialAthlete::getIsDeleted, 0);
|
.eq(MartialAthlete::getIsDeleted, 0)
|
||||||
|
.eq(MartialAthlete::getRegistrationStatus, 1);
|
||||||
MartialAthlete existingRecord = athleteService.getOne(checkWrapper, false);
|
MartialAthlete existingRecord = athleteService.getOne(checkWrapper, false);
|
||||||
|
|
||||||
if (existingRecord != null) {
|
if (existingRecord != null) {
|
||||||
// Reject duplicate registration
|
// Skip duplicate registration
|
||||||
log.warn("选手重复报名: playerName={}, projectId={}", existingAthlete.getPlayerName(), projectId);
|
log.warn("选手重复报名,已跳过: playerName={}, projectId={}", existingAthlete.getPlayerName(), projectId);
|
||||||
return R.fail("选手 " + existingAthlete.getPlayerName() + " 已报名该项目,请勿重复报名");
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// Create new record
|
// Create new record
|
||||||
MartialAthlete newRecord = new MartialAthlete();
|
MartialAthlete newRecord = new MartialAthlete();
|
||||||
|
|||||||
Reference in New Issue
Block a user