diff --git a/YD_Event.Application/Event/Dtos/EventRecordDtos.cs b/YD_Event.Application/Event/Dtos/EventRecordDtos.cs index 0467b81..02a2263 100644 --- a/YD_Event.Application/Event/Dtos/EventRecordDtos.cs +++ b/YD_Event.Application/Event/Dtos/EventRecordDtos.cs @@ -628,6 +628,16 @@ public class CancelExecuteOutput /// public string TeamName { get; set; } + /// + /// 报名结束时间 + /// + public DateTime RegistrationEndTime { get; set; } + + /// + /// 赛事状态 + /// + public int EventStatus { get; set; } + /// /// 项目列表 /// diff --git a/YD_Event.Application/Event/UserEventRecordService.cs b/YD_Event.Application/Event/UserEventRecordService.cs index 4b779d1..9defe0a 100644 --- a/YD_Event.Application/Event/UserEventRecordService.cs +++ b/YD_Event.Application/Event/UserEventRecordService.cs @@ -535,7 +535,9 @@ public class UserEventRecordService : IDynamicApiController, ITransient RegistrationId = registration.Id, EventId = registration.EventId, EventName = eventInfo?.EventName ?? "", - TeamName = registration.TeamName ?? "" + TeamName = registration.TeamName ?? "", + RegistrationEndTime = eventInfo.RegistrationEndTime, + EventStatus = (int)eventInfo.EventStatus }; foreach (var item in items) @@ -605,6 +607,19 @@ public class UserEventRecordService : IDynamicApiController, ITransient var eventInfo = await _eventRepository.GetFirstAsync(x => x.Id == registration.EventId); if (eventInfo == null) throw Oops.Bah("赛事信息不存在"); + // 检查报名时间是否已结束 + var now = DateTime.Now; + if (now > eventInfo.RegistrationEndTime) + { + throw Oops.Bah("赛事报名时间已结束,无法更换参赛队员"); + } + + // 检查赛事状态,只有报名中状态才允许更换队员 + if (eventInfo.EventStatus != EventStatus.Enrolling) + { + throw Oops.Bah("当前赛事状态不允许更换参赛队员"); + } + // 获取报名项目信息 var registrationItems = await _registrationItemRepository.GetListAsync(x => x.RegistrationId == input.RegistrationId); var eventProjectIds = registrationItems.Select(x => x.ProjectId).Distinct().ToList(); diff --git a/YD_Event.Application/Merchant/MerchantCertificationService.cs b/YD_Event.Application/Merchant/MerchantCertificationService.cs index 0020acf..93ada7d 100644 --- a/YD_Event.Application/Merchant/MerchantCertificationService.cs +++ b/YD_Event.Application/Merchant/MerchantCertificationService.cs @@ -163,42 +163,6 @@ public class MerchantCertificationService : BaseService, certification.AuditRemark = input.Remark; certification.UpdatedUserId = userId; certification.UpdatedTime = DateTime.Now; - - if (input.Status == AuditStatus.Pass) - { - var merchant = await _merchantRepository.GetFirstAsync(m => m.CreatedUserId == certification.UserId && !m.DeleteMark); - if (merchant == null) - { - merchant = new YD_Event.Core.Entities.Merchant - { - Id = _idGenerator.NextId(), - MerchantName = certification.MerchantName, - CreditCode = certification.CreditCode, - BusinessLicenseUrl = certification.BusinessLicenseUrl, - Address = certification.Address, - ContactPhone = certification.ContactPhone, - BankName = "", - AccountNumber = "", - AuditStatus = AuditStatus.Pass, - Status = AvailabilityStatus.Enable, - DeleteMark = false, - CreatedUserId = certification.UserId, - CreatedTime = DateTime.Now - }; - await _merchantRepository.InsertAsync(merchant); - } - else - { - merchant.MerchantName = certification.MerchantName; - merchant.CreditCode = certification.CreditCode; - merchant.BusinessLicenseUrl = certification.BusinessLicenseUrl; - merchant.Address = certification.Address; - merchant.ContactPhone = certification.ContactPhone; - merchant.UpdatedUserId = userId; - merchant.UpdatedTime = DateTime.Now; - await _merchantRepository.UpdateAsync(merchant); - } - } } await _repository.UpdateRangeAsync(certifications); diff --git a/YD_Event.Application/YD_Event.Application.xml b/YD_Event.Application/YD_Event.Application.xml index c754d8d..78504f8 100644 --- a/YD_Event.Application/YD_Event.Application.xml +++ b/YD_Event.Application/YD_Event.Application.xml @@ -5426,6 +5426,16 @@ 团队名称 + + + 报名结束时间 + + + + + 赛事状态 + + 项目列表