diff --git a/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta b/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta index 1d0a0b1..90163f5 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 6cd8659..f9240af 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 fd1de93..bf1b9ef 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 f4a6685..67db226 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 b5ac1d4..852717d 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 c162aa0..0cbb604 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 a8d346a..183f6a9 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 be7dfdb..5393b9d 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 fda2cb1..e2d24ef 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 @@ -439,167 +439,11 @@ public class MartialScheduleServiceImpl extends ServiceImpl() - .eq("competition_id", dto.getCompetitionId()) - .eq("project_id", projectId) - .eq("is_deleted", 0) - .last("LIMIT 1") - ); - } - - // Determine project type from DTO - Integer projectType = null; - if ("集体".equals(groupDTO.getType())) { - projectType = 2; - } else if ("单人".equals(groupDTO.getType())) { - projectType = 1; - } - - // Calculate participant/team counts - int participantCount = groupDTO.getParticipants() != null ? groupDTO.getParticipants().size() : 0; - - if (existingGroup != null) { - realGroupId = existingGroup.getId(); - existingGroup.setGroupName(groupDTO.getTitle()); - existingGroup.setProjectType(projectType); - existingGroup.setTotalParticipants(participantCount); - existingGroup.setTotalTeams(participantCount); - existingGroup.setCategory(groupDTO.getCode()); - scheduleGroupMapper.updateById(existingGroup); - } else { - MartialScheduleGroup newGroup = new MartialScheduleGroup(); - newGroup.setCompetitionId(Long.valueOf(dto.getCompetitionId())); - newGroup.setProjectId(projectId); - newGroup.setGroupName(groupDTO.getTitle()); - newGroup.setProjectType(projectType); - newGroup.setTotalParticipants(participantCount); - newGroup.setTotalTeams(participantCount); - newGroup.setCategory(groupDTO.getCode()); - scheduleGroupMapper.insert(newGroup); - realGroupId = newGroup.getId(); - } - } - - MartialScheduleDetail detail = scheduleDetailMapper.selectOne( - new QueryWrapper() - .eq("schedule_group_id", realGroupId) - .eq("is_deleted", 0) - .last("LIMIT 1") - ); - - if (detail == null) { - detail = new MartialScheduleDetail(); - detail.setScheduleGroupId(realGroupId); - detail.setCompetitionId(dto.getCompetitionId()); - } - - detail.setVenueId(groupDTO.getVenueId()); - detail.setVenueName(groupDTO.getVenueName()); - detail.setTimeSlot(groupDTO.getTimeSlot()); - - // 设置时间段(上午/下午) - if (groupDTO.getTimeSlot() != null && groupDTO.getTimeSlot().contains("上午")) { - detail.setTimePeriod("morning"); - } else if (groupDTO.getTimeSlot() != null && groupDTO.getTimeSlot().contains("下午")) { - detail.setTimePeriod("afternoon"); - } else { - detail.setTimePeriod("morning"); // 默认上午 - } - - // 解析日期 - if (groupDTO.getTimeSlot() != null && groupDTO.getTimeSlot().contains("年")) { - try { - String dateStr = groupDTO.getTimeSlot().split(" ")[0]; - dateStr = dateStr.replace("年", "-").replace("月", "-").replace("日", ""); - detail.setScheduleDate(LocalDate.parse(dateStr)); - } catch (Exception e) { - // 日期解析失败,使用当天日期 - detail.setScheduleDate(LocalDate.now()); - } - } - - // 如果日期仍为空,设置默认日期 - if (detail.getScheduleDate() == null) { - detail.setScheduleDate(LocalDate.now()); - } - - if (detail.getId() == null) { - scheduleDetailMapper.insert(detail); - } else { - scheduleDetailMapper.updateById(detail); - } - - // 1.5 同步更新项目的venue_id,保持数据一致性 - if (groupDTO.getVenueId() != null) { - MartialScheduleGroup group = scheduleGroupMapper.selectById(realGroupId); - if (group != null && group.getProjectId() != null) { - MartialProject project = projectService.getById(group.getProjectId()); - if (project != null) { - project.setVenueId(groupDTO.getVenueId()); - projectService.updateById(project); - } - } - } - - // 2. 更新参赛者信息 - if (groupDTO.getParticipants() != null) { - for (ParticipantDTO participantDTO : groupDTO.getParticipants()) { - // Query by participant_id (registration ID) and schedule_group_id, not by primary key - MartialScheduleParticipant participant = scheduleParticipantMapper.selectOne( - new QueryWrapper() - .eq("participant_id", participantDTO.getId()) - .eq("schedule_group_id", realGroupId) - .eq("is_deleted", 0) - .last("LIMIT 1") - ); - if (participant != null) { - participant.setCheckInStatus(participantDTO.getStatus()); - participant.setPerformanceOrder(participantDTO.getSortOrder()); - participant.setScheduleStatus("draft"); - scheduleParticipantMapper.updateById(participant); - } else { - // Create new participant record if not exists - MartialScheduleParticipant newParticipant = new MartialScheduleParticipant(); - newParticipant.setScheduleGroupId(realGroupId); - newParticipant.setScheduleDetailId(detail.getId()); // Set schedule_detail_id - newParticipant.setParticipantId(Long.valueOf(participantDTO.getId())); - newParticipant.setOrganization(participantDTO.getSchoolUnit()); - newParticipant.setCheckInStatus(participantDTO.getStatus()); - newParticipant.setPerformanceOrder(participantDTO.getSortOrder()); - newParticipant.setScheduleStatus("draft"); - scheduleParticipantMapper.insert(newParticipant); - } - } - } - } - - return true; + // Delegated to ScheduleArrangeService + return scheduleArrangeService.saveDraftSchedule(dto); } + /** * 完成编排并锁定 *