赛事管理返回性别和年龄
This commit is contained in:
parent
5abbae9e6c
commit
c96e7a63b3
@ -180,6 +180,11 @@ public class EventDetailDto : EventListDto
|
||||
/// 项目列表
|
||||
/// </summary>
|
||||
public List<EventProjectDto> Projects { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上级项目类型名称
|
||||
/// </summary>
|
||||
public string? ParentProjectTypeName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -26,6 +26,7 @@ public class EventClientController : IDynamicApiController
|
||||
private readonly ISqlSugarRepository<EventUnit> _unitRepository;
|
||||
private readonly ISqlSugarRepository<EventRegistrationPerson> _personRepository;
|
||||
private readonly ISqlSugarRepository<EventRegistrationLimit> _limitRepository;
|
||||
private readonly ISqlSugarRepository<ProjectType> _projectTypeRepository;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly IIdGenerator _idGenerator;
|
||||
|
||||
@ -40,6 +41,7 @@ public class EventClientController : IDynamicApiController
|
||||
ISqlSugarRepository<EventUnit> unitRepository,
|
||||
ISqlSugarRepository<EventRegistrationPerson> personRepository,
|
||||
ISqlSugarRepository<EventRegistrationLimit> limitRepository,
|
||||
ISqlSugarRepository<ProjectType> projectTypeRepository,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IIdGenerator idGenerator)
|
||||
{
|
||||
@ -53,6 +55,7 @@ public class EventClientController : IDynamicApiController
|
||||
_unitRepository = unitRepository;
|
||||
_personRepository = personRepository;
|
||||
_limitRepository = limitRepository;
|
||||
_projectTypeRepository = projectTypeRepository;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_idGenerator = idGenerator;
|
||||
}
|
||||
@ -179,6 +182,7 @@ public class EventClientController : IDynamicApiController
|
||||
.Select((p, t) => new {
|
||||
p.Id,
|
||||
p.Name,
|
||||
ProjectTypeId = t.Id,
|
||||
TypeName = t.Name
|
||||
})
|
||||
.ToListAsync();
|
||||
@ -186,6 +190,24 @@ public class EventClientController : IDynamicApiController
|
||||
var groups = await _groupRepository.AsQueryable()
|
||||
.Where(g => projectIds.Contains(g.ProjectId) && !g.DeleteMark)
|
||||
.ToListAsync();
|
||||
|
||||
// 获取所有项目类型
|
||||
var allProjectTypes = await _projectTypeRepository.AsQueryable()
|
||||
.Where(t => !t.DeleteMark && t.Status == AvailabilityStatus.Enable)
|
||||
.ToListAsync();
|
||||
|
||||
// 获取上级项目类型名称(如果有项目,取第一个项目的上级类型名称)
|
||||
string? parentProjectTypeName = null;
|
||||
if (baseProjects.Any())
|
||||
{
|
||||
var firstProject = baseProjects.First();
|
||||
var currentProjectType = allProjectTypes.FirstOrDefault(t => t.Id == firstProject.ProjectTypeId);
|
||||
if (currentProjectType != null && currentProjectType.ParentId > 0)
|
||||
{
|
||||
var parentProjectType = allProjectTypes.FirstOrDefault(t => t.Id == currentProjectType.ParentId);
|
||||
parentProjectTypeName = parentProjectType?.Name;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取单位
|
||||
var units = await _unitRepository.AsQueryable()
|
||||
@ -221,6 +243,7 @@ public class EventClientController : IDynamicApiController
|
||||
|
||||
IndividualProjectLimit = limit?.IndividualProjectLimit ?? 0,
|
||||
TeamProjectLimit = limit?.TeamProjectLimit ?? 0,
|
||||
ParentProjectTypeName = parentProjectTypeName,
|
||||
|
||||
Units = units.Select(u => new EventUnitDto
|
||||
{
|
||||
|
||||
@ -147,4 +147,14 @@ public class TeamMemberOutput
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
public string? Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出生日期
|
||||
/// </summary>
|
||||
public DateTime? BirthDate { get; set; }
|
||||
}
|
||||
|
||||
@ -92,7 +92,9 @@ public class TeamService : BaseService<Core.Entities.Team>, IDynamicApiControlle
|
||||
UserId = m.UserId,
|
||||
Name = u.Name,
|
||||
Mobile = u.Mobile,
|
||||
PersonType = m.PersonType
|
||||
PersonType = m.PersonType,
|
||||
Gender = u.Gender,
|
||||
BirthDate = u.BirthDate
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
@ -1665,6 +1665,11 @@
|
||||
项目列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Client.Dtos.EventDetailDto.ParentProjectTypeName">
|
||||
<summary>
|
||||
上级项目类型名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Client.Dtos.EventProjectDto">
|
||||
<summary>
|
||||
赛事项目DTO
|
||||
@ -8254,6 +8259,16 @@
|
||||
联系电话
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Team.Dtos.TeamMemberOutput.Gender">
|
||||
<summary>
|
||||
性别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Team.Dtos.TeamMemberOutput.BirthDate">
|
||||
<summary>
|
||||
出生日期
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Team.TeamService">
|
||||
<summary>
|
||||
团队管理服务
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user