diff --git a/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta b/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta index 6e532fd..eb4341d 100644 Binary files a/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta and b/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/.usage-cache.bin.bkp/xl.meta b/minio_data/.minio.sys/buckets/.usage-cache.bin.bkp/xl.meta index 386c071..56a7627 100644 Binary files a/minio_data/.minio.sys/buckets/.usage-cache.bin.bkp/xl.meta and b/minio_data/.minio.sys/buckets/.usage-cache.bin.bkp/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/.usage-cache.bin/xl.meta b/minio_data/.minio.sys/buckets/.usage-cache.bin/xl.meta index 56aa44b..43e5dbf 100644 Binary files a/minio_data/.minio.sys/buckets/.usage-cache.bin/xl.meta and b/minio_data/.minio.sys/buckets/.usage-cache.bin/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/.usage.json/xl.meta b/minio_data/.minio.sys/buckets/.usage.json/xl.meta index 0c0288d..efc0698 100644 Binary files a/minio_data/.minio.sys/buckets/.usage.json/xl.meta and b/minio_data/.minio.sys/buckets/.usage.json/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin.bkp/xl.meta b/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin.bkp/xl.meta index 213831c..18e091a 100644 Binary files a/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin.bkp/xl.meta and b/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin.bkp/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin/xl.meta b/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin/xl.meta index f6ab057..0c049ae 100644 Binary files a/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin/xl.meta and b/minio_data/.minio.sys/buckets/000000-assets/.usage-cache.bin/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/assets/.usage-cache.bin.bkp/xl.meta b/minio_data/.minio.sys/buckets/assets/.usage-cache.bin.bkp/xl.meta index 3b33275..5bf6433 100644 Binary files a/minio_data/.minio.sys/buckets/assets/.usage-cache.bin.bkp/xl.meta and b/minio_data/.minio.sys/buckets/assets/.usage-cache.bin.bkp/xl.meta differ diff --git a/minio_data/.minio.sys/buckets/assets/.usage-cache.bin/xl.meta b/minio_data/.minio.sys/buckets/assets/.usage-cache.bin/xl.meta index 13fffdf..e054dca 100644 Binary files a/minio_data/.minio.sys/buckets/assets/.usage-cache.bin/xl.meta and b/minio_data/.minio.sys/buckets/assets/.usage-cache.bin/xl.meta differ diff --git a/src/main/java/org/springblade/modules/martial/service/impl/MartialScheduleServiceImpl.java b/src/main/java/org/springblade/modules/martial/service/impl/MartialScheduleServiceImpl.java index e5450f9..aabfc03 100644 --- a/src/main/java/org/springblade/modules/martial/service/impl/MartialScheduleServiceImpl.java +++ b/src/main/java/org/springblade/modules/martial/service/impl/MartialScheduleServiceImpl.java @@ -767,159 +767,28 @@ public class MartialScheduleServiceImpl extends ServiceImpl details = scheduleDetailMapper.selectList( - new QueryWrapper() - .eq("competition_id", competitionId) - .eq("venue_id", venueId) - .eq("time_slot_index", timeSlotIndex) - .eq("is_deleted", 0) - .orderByAsc("sort_order") - ); - - if (details.isEmpty()) { - // 返回空数据 - org.springblade.modules.martial.pojo.vo.DispatchDataVO vo = new org.springblade.modules.martial.pojo.vo.DispatchDataVO(); - vo.setGroups(new ArrayList<>()); - return vo; - } - - // 2. 构建返回数据 - List groups = new ArrayList<>(); - - for (MartialScheduleDetail detail : details) { - // 查询分组信息 - MartialScheduleGroup group = scheduleGroupMapper.selectById(detail.getScheduleGroupId()); - if (group == null) { - continue; - } - - // 查询该明细下的所有参赛者 - List participants = scheduleParticipantMapper.selectList( - new QueryWrapper() - .eq("schedule_detail_id", detail.getId()) - .eq("is_deleted", 0) - .orderByAsc("performance_order") - ); - - // 转换为VO - org.springblade.modules.martial.pojo.vo.DispatchDataVO.DispatchGroup groupVO = - new org.springblade.modules.martial.pojo.vo.DispatchDataVO.DispatchGroup(); - groupVO.setGroupId(group.getId()); - groupVO.setGroupName(group.getGroupName()); - groupVO.setDetailId(detail.getId()); - groupVO.setProjectType(group.getProjectType()); - - List participantVOs = - participants.stream().map(p -> { - org.springblade.modules.martial.pojo.vo.DispatchDataVO.DispatchParticipant pVO = - new org.springblade.modules.martial.pojo.vo.DispatchDataVO.DispatchParticipant(); - pVO.setId(p.getId()); - pVO.setParticipantId(p.getParticipantId()); - pVO.setOrganization(p.getOrganization()); - pVO.setPlayerName(p.getPlayerName()); - pVO.setProjectName(p.getProjectName()); - pVO.setCategory(p.getCategory()); - pVO.setPerformanceOrder(p.getPerformanceOrder()); - return pVO; - }).collect(Collectors.toList()); - - groupVO.setParticipants(participantVOs); - groups.add(groupVO); - } - - org.springblade.modules.martial.pojo.vo.DispatchDataVO result = - new org.springblade.modules.martial.pojo.vo.DispatchDataVO(); - result.setGroups(groups); - return result; + // Delegated to ScheduleDispatchService + return scheduleDispatchService.getDispatchData(competitionId, venueId, timeSlotIndex); } + @Override @Transactional(rollbackFor = Exception.class) public boolean adjustOrder(org.springblade.modules.martial.pojo.dto.AdjustOrderDTO dto) { - // 1. 查询当前参赛者 - MartialScheduleParticipant current = scheduleParticipantMapper.selectById(dto.getParticipantId()); - if (current == null) { - throw new RuntimeException("参赛者不存在"); - } - - // 2. 查询同一明细下的所有参赛者 - List participants = scheduleParticipantMapper.selectList( - new QueryWrapper() - .eq("schedule_detail_id", dto.getDetailId()) - .eq("is_deleted", 0) - .orderByAsc("performance_order") - ); - - // 3. 根据动作调整顺序 - int currentIndex = -1; - for (int i = 0; i < participants.size(); i++) { - if (participants.get(i).getId().equals(dto.getParticipantId())) { - currentIndex = i; - break; - } - } - - if (currentIndex == -1) { - throw new RuntimeException("未找到参赛者"); - } - - // 4. 执行调整 - if ("move_up".equals(dto.getAction())) { - // 上移 - if (currentIndex == 0) { - throw new RuntimeException("已经是第一个,无法上移"); - } - // 交换位置 - Collections.swap(participants, currentIndex, currentIndex - 1); - } else if ("move_down".equals(dto.getAction())) { - // 下移 - if (currentIndex == participants.size() - 1) { - throw new RuntimeException("已经是最后一个,无法下移"); - } - // 交换位置 - Collections.swap(participants, currentIndex, currentIndex + 1); - } else if ("swap".equals(dto.getAction())) { - // 交换到指定位置 - if (dto.getTargetOrder() == null || dto.getTargetOrder() < 1 || dto.getTargetOrder() > participants.size()) { - throw new RuntimeException("目标顺序无效"); - } - int targetIndex = dto.getTargetOrder() - 1; - Collections.swap(participants, currentIndex, targetIndex); - } - - // 5. 更新所有参赛者的顺序 - for (int i = 0; i < participants.size(); i++) { - MartialScheduleParticipant p = participants.get(i); - p.setPerformanceOrder(i + 1); - scheduleParticipantMapper.updateById(p); - } - - return true; + // Delegated to ScheduleDispatchService + return scheduleDispatchService.adjustOrder(dto); } + @Override @Transactional(rollbackFor = Exception.class) public boolean saveDispatch(org.springblade.modules.martial.pojo.dto.SaveDispatchDTO dto) { - if (dto.getAdjustments() == null || dto.getAdjustments().isEmpty()) { - return true; - } - - // 批量更新所有参赛者的出场顺序 - for (org.springblade.modules.martial.pojo.dto.SaveDispatchDTO.DetailAdjustment adjustment : dto.getAdjustments()) { - for (org.springblade.modules.martial.pojo.dto.SaveDispatchDTO.ParticipantOrder po : adjustment.getParticipants()) { - MartialScheduleParticipant participant = scheduleParticipantMapper.selectById(po.getId()); - if (participant != null) { - participant.setPerformanceOrder(po.getPerformanceOrder()); - scheduleParticipantMapper.updateById(participant); - } - } - } - - return true; + // Delegated to ScheduleDispatchService + return scheduleDispatchService.saveDispatch(dto); } + @Override @Transactional(rollbackFor = Exception.class) public boolean updateParticipantCheckInStatus(Long participantId, String status) {