赛事管理返回性别和年龄
This commit is contained in:
parent
5abbae9e6c
commit
c96e7a63b3
@ -180,6 +180,11 @@ public class EventDetailDto : EventListDto
|
|||||||
/// 项目列表
|
/// 项目列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<EventProjectDto> Projects { get; set; }
|
public List<EventProjectDto> Projects { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上级项目类型名称
|
||||||
|
/// </summary>
|
||||||
|
public string? ParentProjectTypeName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ public class EventClientController : IDynamicApiController
|
|||||||
private readonly ISqlSugarRepository<EventUnit> _unitRepository;
|
private readonly ISqlSugarRepository<EventUnit> _unitRepository;
|
||||||
private readonly ISqlSugarRepository<EventRegistrationPerson> _personRepository;
|
private readonly ISqlSugarRepository<EventRegistrationPerson> _personRepository;
|
||||||
private readonly ISqlSugarRepository<EventRegistrationLimit> _limitRepository;
|
private readonly ISqlSugarRepository<EventRegistrationLimit> _limitRepository;
|
||||||
|
private readonly ISqlSugarRepository<ProjectType> _projectTypeRepository;
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
private readonly IIdGenerator _idGenerator;
|
private readonly IIdGenerator _idGenerator;
|
||||||
|
|
||||||
@ -40,6 +41,7 @@ public class EventClientController : IDynamicApiController
|
|||||||
ISqlSugarRepository<EventUnit> unitRepository,
|
ISqlSugarRepository<EventUnit> unitRepository,
|
||||||
ISqlSugarRepository<EventRegistrationPerson> personRepository,
|
ISqlSugarRepository<EventRegistrationPerson> personRepository,
|
||||||
ISqlSugarRepository<EventRegistrationLimit> limitRepository,
|
ISqlSugarRepository<EventRegistrationLimit> limitRepository,
|
||||||
|
ISqlSugarRepository<ProjectType> projectTypeRepository,
|
||||||
IHttpContextAccessor httpContextAccessor,
|
IHttpContextAccessor httpContextAccessor,
|
||||||
IIdGenerator idGenerator)
|
IIdGenerator idGenerator)
|
||||||
{
|
{
|
||||||
@ -53,6 +55,7 @@ public class EventClientController : IDynamicApiController
|
|||||||
_unitRepository = unitRepository;
|
_unitRepository = unitRepository;
|
||||||
_personRepository = personRepository;
|
_personRepository = personRepository;
|
||||||
_limitRepository = limitRepository;
|
_limitRepository = limitRepository;
|
||||||
|
_projectTypeRepository = projectTypeRepository;
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
_idGenerator = idGenerator;
|
_idGenerator = idGenerator;
|
||||||
}
|
}
|
||||||
@ -179,6 +182,7 @@ public class EventClientController : IDynamicApiController
|
|||||||
.Select((p, t) => new {
|
.Select((p, t) => new {
|
||||||
p.Id,
|
p.Id,
|
||||||
p.Name,
|
p.Name,
|
||||||
|
ProjectTypeId = t.Id,
|
||||||
TypeName = t.Name
|
TypeName = t.Name
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
@ -187,6 +191,24 @@ public class EventClientController : IDynamicApiController
|
|||||||
.Where(g => projectIds.Contains(g.ProjectId) && !g.DeleteMark)
|
.Where(g => projectIds.Contains(g.ProjectId) && !g.DeleteMark)
|
||||||
.ToListAsync();
|
.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()
|
var units = await _unitRepository.AsQueryable()
|
||||||
.Where(u => u.EventId == id && !u.DeleteMark)
|
.Where(u => u.EventId == id && !u.DeleteMark)
|
||||||
@ -221,6 +243,7 @@ public class EventClientController : IDynamicApiController
|
|||||||
|
|
||||||
IndividualProjectLimit = limit?.IndividualProjectLimit ?? 0,
|
IndividualProjectLimit = limit?.IndividualProjectLimit ?? 0,
|
||||||
TeamProjectLimit = limit?.TeamProjectLimit ?? 0,
|
TeamProjectLimit = limit?.TeamProjectLimit ?? 0,
|
||||||
|
ParentProjectTypeName = parentProjectTypeName,
|
||||||
|
|
||||||
Units = units.Select(u => new EventUnitDto
|
Units = units.Select(u => new EventUnitDto
|
||||||
{
|
{
|
||||||
|
|||||||
@ -147,4 +147,14 @@ public class TeamMemberOutput
|
|||||||
/// 联系电话
|
/// 联系电话
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Mobile { get; set; }
|
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,
|
UserId = m.UserId,
|
||||||
Name = u.Name,
|
Name = u.Name,
|
||||||
Mobile = u.Mobile,
|
Mobile = u.Mobile,
|
||||||
PersonType = m.PersonType
|
PersonType = m.PersonType,
|
||||||
|
Gender = u.Gender,
|
||||||
|
BirthDate = u.BirthDate
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@ -1665,6 +1665,11 @@
|
|||||||
项目列表
|
项目列表
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Client.Dtos.EventDetailDto.ParentProjectTypeName">
|
||||||
|
<summary>
|
||||||
|
上级项目类型名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:YD_Event.Application.Client.Dtos.EventProjectDto">
|
<member name="T:YD_Event.Application.Client.Dtos.EventProjectDto">
|
||||||
<summary>
|
<summary>
|
||||||
赛事项目DTO
|
赛事项目DTO
|
||||||
@ -8254,6 +8259,16 @@
|
|||||||
联系电话
|
联系电话
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</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">
|
<member name="T:YD_Event.Application.Team.TeamService">
|
||||||
<summary>
|
<summary>
|
||||||
团队管理服务
|
团队管理服务
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user