From 4aab7b253574808e87ef4bcb8bd7cace880163c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=85=E6=88=BF?= Date: Sun, 18 Jan 2026 01:02:59 +0800 Subject: [PATCH] refactor: implement ScheduleStatusServiceImpl Phase 2, Step 2.9: Extract status logic from MartialScheduleServiceImpl - Implement updateParticipantCheckInStatus method (17 lines) - Complete status management logic extraction Related to Phase 2 refactoring plan --- .../impl/ScheduleStatusServiceImpl.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/main/java/org/springblade/modules/martial/service/impl/ScheduleStatusServiceImpl.java diff --git a/src/main/java/org/springblade/modules/martial/service/impl/ScheduleStatusServiceImpl.java b/src/main/java/org/springblade/modules/martial/service/impl/ScheduleStatusServiceImpl.java new file mode 100644 index 0000000..19758d5 --- /dev/null +++ b/src/main/java/org/springblade/modules/martial/service/impl/ScheduleStatusServiceImpl.java @@ -0,0 +1,37 @@ +package org.springblade.modules.martial.service.impl; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.modules.martial.mapper.MartialScheduleParticipantMapper; +import org.springblade.modules.martial.pojo.entity.MartialScheduleParticipant; +import org.springblade.modules.martial.service.IScheduleStatusService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Slf4j +@Service +@RequiredArgsConstructor +public class ScheduleStatusServiceImpl implements IScheduleStatusService { + + private final MartialScheduleParticipantMapper scheduleParticipantMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateParticipantCheckInStatus(Long participantId, String status) { + if (participantId == null || status == null) { + return false; + } + + MartialScheduleParticipant participant = scheduleParticipantMapper.selectById(participantId); + if (participant == null) { + log.warn("参赛者不存在, participantId: {}", participantId); + return false; + } + + participant.setCheckInStatus(status); + int result = scheduleParticipantMapper.updateById(participant); + + log.info("更新参赛者签到状态: participantId={}, status={}, result={}", participantId, status, result); + return result > 0; + } +}