赛事详情个人项目限制
This commit is contained in:
parent
779336987b
commit
84b7983567
@ -628,6 +628,16 @@ public class CancelExecuteOutput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string TeamName { get; set; }
|
public string TeamName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 报名结束时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime RegistrationEndTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 赛事状态
|
||||||
|
/// </summary>
|
||||||
|
public int EventStatus { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目列表
|
/// 项目列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -535,7 +535,9 @@ public class UserEventRecordService : IDynamicApiController, ITransient
|
|||||||
RegistrationId = registration.Id,
|
RegistrationId = registration.Id,
|
||||||
EventId = registration.EventId,
|
EventId = registration.EventId,
|
||||||
EventName = eventInfo?.EventName ?? "",
|
EventName = eventInfo?.EventName ?? "",
|
||||||
TeamName = registration.TeamName ?? ""
|
TeamName = registration.TeamName ?? "",
|
||||||
|
RegistrationEndTime = eventInfo.RegistrationEndTime,
|
||||||
|
EventStatus = (int)eventInfo.EventStatus
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
@ -605,6 +607,19 @@ public class UserEventRecordService : IDynamicApiController, ITransient
|
|||||||
var eventInfo = await _eventRepository.GetFirstAsync(x => x.Id == registration.EventId);
|
var eventInfo = await _eventRepository.GetFirstAsync(x => x.Id == registration.EventId);
|
||||||
if (eventInfo == null) throw Oops.Bah("赛事信息不存在");
|
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 registrationItems = await _registrationItemRepository.GetListAsync(x => x.RegistrationId == input.RegistrationId);
|
||||||
var eventProjectIds = registrationItems.Select(x => x.ProjectId).Distinct().ToList();
|
var eventProjectIds = registrationItems.Select(x => x.ProjectId).Distinct().ToList();
|
||||||
|
|||||||
@ -163,42 +163,6 @@ public class MerchantCertificationService : BaseService<MerchantCertification>,
|
|||||||
certification.AuditRemark = input.Remark;
|
certification.AuditRemark = input.Remark;
|
||||||
certification.UpdatedUserId = userId;
|
certification.UpdatedUserId = userId;
|
||||||
certification.UpdatedTime = DateTime.Now;
|
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);
|
await _repository.UpdateRangeAsync(certifications);
|
||||||
|
|||||||
@ -5426,6 +5426,16 @@
|
|||||||
团队名称
|
团队名称
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Event.Dtos.RegistrationDetailWithItemsDto.RegistrationEndTime">
|
||||||
|
<summary>
|
||||||
|
报名结束时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Event.Dtos.RegistrationDetailWithItemsDto.EventStatus">
|
||||||
|
<summary>
|
||||||
|
赛事状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.RegistrationDetailWithItemsDto.Items">
|
<member name="P:YD_Event.Application.Event.Dtos.RegistrationDetailWithItemsDto.Items">
|
||||||
<summary>
|
<summary>
|
||||||
项目列表
|
项目列表
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user