From bd79b7e79075fdf4f4989dfb336c17f9ea6e4fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=85=E6=88=BF?= Date: Sun, 18 Jan 2026 13:22:53 +0800 Subject: [PATCH] refactor: Delegate saveDraftSchedule to ScheduleArrangeService MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 6 Complete: - Delegate saveDraftSchedule to ScheduleArrangeService (163 lines → 7 lines) - Implementation already exists in ScheduleArrangeServiceImpl - Method handles saving draft schedule with participants File size: 720 lines → 564 lines (-156 lines, -21.7%) Total reduction: 996 lines → 564 lines (-432 lines, -43.4%) Delegation Status: ✅ exportSchedule - FULLY DELEGATED ✅ exportScheduleTemplate2 - FULLY DELEGATED ✅ updateParticipantCheckInStatus - FULLY DELEGATED ✅ getDispatchData - FULLY DELEGATED ✅ adjustOrder - FULLY DELEGATED ✅ saveDispatch - FULLY DELEGATED ✅ moveScheduleGroup - FULLY DELEGATED ✅ saveAndLockSchedule - FULLY DELEGATED ✅ saveDraftSchedule - FULLY DELEGATED (NEW) Progress: 9/10 methods (90%) Remaining: 1 method (getScheduleResult - 324 lines, most complex) Tests passing --- .../buckets/.bloomcycle.bin/xl.meta | Bin 743 -> 743 bytes .../buckets/.usage-cache.bin.bkp/xl.meta | Bin 630 -> 637 bytes .../buckets/.usage-cache.bin/xl.meta | Bin 630 -> 637 bytes .../.minio.sys/buckets/.usage.json/xl.meta | Bin 2360 -> 2360 bytes .../.usage-cache.bin.bkp/xl.meta | Bin 636 -> 636 bytes .../000000-assets/.usage-cache.bin/xl.meta | Bin 636 -> 636 bytes .../assets/.usage-cache.bin.bkp/xl.meta | Bin 575 -> 575 bytes .../buckets/assets/.usage-cache.bin/xl.meta | Bin 575 -> 575 bytes .../impl/MartialScheduleServiceImpl.java | 162 +----------------- 9 files changed, 3 insertions(+), 159 deletions(-) diff --git a/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta b/minio_data/.minio.sys/buckets/.bloomcycle.bin/xl.meta index 1d0a0b16881461da9d75f8f9e7c5882314774d58..90163f5acda61769e3d9e0bd964f2a3556fadb61 100644 GIT binary patch delta 347 zcmaFP`kZxwCij`^cYgUFVY%fmdVHdZu|UY`E9=!Y+@5bNOk*q+J@sN@c>^n0$;3aV z>Pu2f64P%g7#pToSR|&Tnj|Nhn5S48C#RVw873O086=yT8mE~XO*Ujyt6x}lEnp67 X?s^V+(MAOKHAkipvZFYvFL40?0ugsF delta 341 zcmaFP`kZxwCU>l;N@vv(mVT2@>=R9l1$O(0A2F5mz2AGevM{uqNq=H_11ng`#6PB! zBN)}{m!y^?rr%UBFiJKzGD%BHGPN)>FilFcG%z!>NKG|LF*Z(128t{!JC~kxn&BL` zz@PJsjZ5-Mb8?O{25*17HAf-iLY5Rn7ng zEz6Tji;7b7N*I>prB;-jEuXc#xFoTtBsHb}I1ejGNoG!tJ6qfDign4A$vLUc`MCu- zsX*yF3<7Wk8Ha_eHCYkd|LhH2E8*NsYxXr~T@c)I_C?1$5!}t}m0C{_-1qDYTn~b{ aQeeBYwAoM2zXq4iN@w43j%V_B#tHzCHhHuF 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 6cd865943e42a93841edca3bc35a782dd9ebb8b9..f9240aff9d0223d64b1d652e3b885db45a035aa0 100644 GIT binary patch delta 332 zcmeyy@|R_TCij`^tLM);!XmTH-D#qUvA`VTn}4sKcDTFC;oVImueC`N%j48ftqMpi zDsc?XtV%7Oc#+}M5)cbWFZB({%uT&4(Y+gN$izRUlOq__GMA*5B&Od~NKH+%NH#XH zFibKsGB!v{O-xBNG`27>PBbtvv9w4@URZW6J?S*Vxl1bXj~N@6+9C_vDa%5-u z{i5E~e^S2=PyK%@<7jCoQ*N^N#@t^?EdT2CIW)HF|8-#yWw^@9@MZD=MrrSbt9%lR zOF|1$5=&B#^RO}iL1s>#I)|KY;OgM)%mR zIJKmBtpOP5LU@zKn3POG(i0XHS6yOkjrCZRUo6MO#LdCLF2~6rc&0&sU+Ng+1@R7} U&OAoPNn$?#XBsoVKe2f(0AnbM5&!@I delta 326 zcmey%@{MJJCU>kTbI$A|EEkU)5}#;dEU+}O^OFLijlFA zagteTa-y+8YD%(Yl0izUvAL=7WJ5+Zr-fzb(vwazoKxR$K8mq%NnUAA&XLE<-bJUH zM(yU!h_ti+Cug4KW2(byD7F2w@cn9*BIgOU92#5o|GF@UGR$RVNSS+0a_%mR?d2m*k{_D_=dE8#rTPd7S#GRRM`b zC62+FRjI`jFEX530%8H_rM@AVxv7^Wx_5&OnfS*>AvHD4BH7r)!Z69m$k-q)H8Ca8 z(AdJjIMKkw#L^-qd2$4!p4GI&7h)J2m*kb^i>0N5M{W^%J60K0Y+)>g{yoLi%UWaQW8s2kMpoH06}I> zo;rt|Zs6+R?92j>)Wn?3y!1m$ofDHYQkxg*cPvWIn6xahxHz?>c&z~#=t6jt#h8># zLDCZz6<1wiY>o9;lwT~z#Kg_Pz%IwhAb6%hfM4nu;|1{!qs}}=$4O#7|7RLAzdx~g FE&#}#fjj^J delta 311 zcmey%@{MJJCU>mJz3u0YupDmWxjE6qSU@4laoN_#K65>JWl=as({3z z635`os?_3%7a0yO0kMGeQs0ow+|U;rrDrMa~myIW)HF|8-#yWthv#kTUrIqqOzRRX&NuC7}f=i6yDWc~}{MATuY& zoqg+d*44q;nFSuHi8+~h>4%m&Cnjg4HZMyoE>0~e?pTzZF=4VAlak#+eGq%nS_3f9 zy~NlW>#-=mSdNK_n}dN}j*DRdhXU8pUyeNt3MmIVIhIN6;kdb-r|SG1$(4R*!~iLG BchUd= diff --git a/minio_data/.minio.sys/buckets/.usage.json/xl.meta b/minio_data/.minio.sys/buckets/.usage.json/xl.meta index f4a66859c41c8ab2d521fcd9979f56d13fd2fb01..67db226fe999e48ecb69de0e5489d39474928ff2 100644 GIT binary patch delta 173 zcmV;e08;Zgp&I#Rsg27pyPAIM%C-d9Gi-;dobhJluKROOP7<<;HzJ)h3IR btN|SlGBP?eH!d+VHZeIhG%z`{*a2V%U>Ql; delta 174 zcmV;f08#(A61WnODGOZ{C?YV#1eU~^t&ub{5Xt8))OMml>bZk{(I#~H`;m8m1zi;= zA~2EsH7BHHbYW-NAY?K)W@9vAHZeFbI5}f8Gc;p0VliQ1GBGeWWHMr8IFm5}9yXzN z&SzrF0M5_wc8CFiq;7R=Y{dtxWaFd0gAa1LbgE7>iB9segHYj cldJ(94>2@4G&e3WGC4CfH#Ijiv)BP(2S{~B82|tP 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 b5ac1d4188c5445a491d068d55ad2bec9346aa71..852717d2203cbf6fa5ea4fdc7977badaf964fdcf 100644 GIT binary patch delta 188 zcmeyv@`q)DCij`^QH#`%upB5z?wx32Ebu?@_^Cb7zB^`>=AU#lTDxjuc>^n0$;3aV z>Pu2f64P%gm>8NHC7T(UrWu(U86_J5L6U)4ijj%2k)eS_nvuz5Lq;{zg=Oc`lTI_7 z^S<_T43T$$1zi-Y zlh%>^HIrBYCS0UtbYW-NATwiSV>mN4Vqq{gF*su}WH@9pIAb+pIb||2G&y8uH=%aU zXJX3$&L%+o*8zc~Zgp&I#OZw25t#~qi~Ih5UKhz&8tVA$r_W0{?S^&e%}eOCL*0|J p0Wuqzs!U;XbX9Ouq0@Inmy6PSm4f+)?=4de4BRpsqPbEKBYggynz+0Wa1wi z1rtMaqhvE9(=;PfBco&^AV@MWOEEGrHZnA@NHa2-9Kook%dIu(Ib-9JywaSUBQF=6 zxA3$$b~Na~O4cU!ONATEbtcyw^-kUrD|0aVm{`KP$(tFCq!+I8Nh~f2El5c$Nj=WP Y$^ZnJIeF^r$BuuU#8kl|+@g6A0G97V-v9sr delta 173 zcmeyv@`q)DCU>kzn+VqtmW!LLeJ7e23wVX4hxhb4Y-rnY{i*S^<=qp@8(6_gCjPNe zFiuWQwlFqLN;EJtv`98gu}CqpNH$HfOf@nzu}n!bpB%xcr@Lw5uaAt4OY%x{a*n*L zxh6Q1tG@g9zq&Z_lMzy{e!N+J-rMqRTj`6l-Y>Q|-<`af(MWpcDxbvSlF)*b#FEtG ZJgf{rkeQR?&K_&;H;Ji&g@gCSMgWw?Miu}7 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 a8d346a08b9d7569d8bbfb951b52bfd69be7d7ea..183f6a9c916beac52e96f165c3d0fa219e333252 100644 GIT binary patch delta 174 zcmdnbvY%ywCij_Zd%YZvu&_E@u$gFLEU<8+_KcfB?!xN|UsxHxtZ1KD-oOf0GVza% zLb72}l4WY5v3XLGsZolViG_iIL8`I2X{v#FnpvW`$>az|J>9GuN!5&vOY%x{a*nJ~ zSL^te$k6*IoLAv(;y;Pw`&Ze!FIQP`qOFK=OY-W~)sr_fYD+I%<&#)k5?YXwSdx02 ahm`>cGIR3O*~OFhPyWg1#8N77P!a&r07L}< delta 174 zcmV;f08#(H1iu83DGOZ`F?qYh1SS>1m60?v5P0!^7oX2dqoEQlw5+81mXUXW1zi*| zdApJPJRmhOIc8xqWi>D~IWRObV>L54VK+BsH)CTkI5IP4Wnq(80WK}^;{BKbfuwGA zY;44=nA6J@#7nnWh@apld}OU8=0z1VRLj4pq2C_oUllcKc1ZEolKW@Q9CIA2c 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 be7dfdb978616deb26337b5c67eff50557fc7eae..5393b9d723cc842723f47b2068703f1ef2d0cf78 100644 GIT binary patch delta 174 zcmV;f08#(H1iu83DGSWjeLbec1fT>9laVwt5b)Kam)S!|skJ*GLl(~k^O1Le1usld}OU8=4vM2Nz?%llcKc1a%O>88;+E(*OVf delta 174 zcmdnbvY%ywCU>mx?broJSbl`mU7ToQEHJ&L;eQmD*Sr;(^4vVN3t1() - .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); } + /** * 完成编排并锁定 *