| | |
| | | import com.rongyichuang.activity.repository.ActivityPlayerRatingRepository; |
| | | import com.rongyichuang.common.entity.Media; |
| | | import com.rongyichuang.common.repository.MediaRepository; |
| | | import com.rongyichuang.message.service.MessageService; |
| | | import com.rongyichuang.player.dto.*; |
| | | import com.rongyichuang.player.entity.ActivityPlayer; |
| | | import com.rongyichuang.player.repository.ActivityPlayerRepository; |
| | |
| | | |
| | | @Autowired |
| | | private MediaRepository mediaRepository; |
| | | |
| | | @Autowired |
| | | private MessageService messageService; |
| | | |
| | | /** |
| | | * 获取比赛晋级列表 |
| | |
| | | return PromotionResult.failure("请选择要晋级的参赛者"); |
| | | } |
| | | |
| | | // 查询目标晋级阶段信息(用户点击的阶段就是要晋级到的阶段) |
| | | Activity targetStage = activityRepository.findById(input.getCompetitionId()).orElse(null); |
| | | // 查询目标晋级阶段信息 |
| | | Activity targetStage = activityRepository.findById(input.getTargetStageId()).orElse(null); |
| | | if (targetStage == null) { |
| | | return PromotionResult.failure("目标晋级阶段不存在"); |
| | | } |
| | |
| | | // 复制媒体文件 |
| | | copyMediaFiles(participant.getId(), savedParticipant.getId()); |
| | | |
| | | // 创建晋级消息 |
| | | messageService.createPromotionMessage( |
| | | savedParticipant.getId(), |
| | | savedParticipant.getPlayerId(), |
| | | savedParticipant.getProjectName() |
| | | ); |
| | | |
| | | promotedCount++; |
| | | } |
| | | } |