修改查询
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-03-10 14:17:22 +08:00
parent 4cdfb60fdf
commit e5fa3a09b3
4 changed files with 51 additions and 3 deletions

View File

@ -198,6 +198,26 @@ namespace IRaCIS.Application.Contracts
}
public class GetTrialDoctorListInDto : PageInput
{
public Guid TrialId { get; set; } = Guid.Empty;
/// <summary>
/// 亚专业
/// </summary>
public Guid? SubspecialityId { get; set; }
/// <summary>
/// 专业
/// </summary>
public Guid? SpecialityId { get; set; }
/// <summary>
/// 机构
/// </summary>
public Guid? HospitalId { get; set; }
}
public class TrialDoctorInfo : ConfirmationReviewerDTO
{
@ -245,6 +265,8 @@ namespace IRaCIS.Application.Contracts
public string OptUserName { get; set; } = String.Empty;
public DateTime? OptTime { get; set; }
}
#endregion

View File

@ -278,14 +278,19 @@ namespace IRaCIS.Core.Application.Service
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialDoctorInfo>> GetTrialDoctorList(
ReviewerConfirmationQueryDTO inQuery)
GetTrialDoctorListInDto inQuery)
{
var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.ConfirmIntoGroup)
.ProjectTo<TrialDoctorInfo>(_mapper.ConfigurationProvider);
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
var doctorPageList = await doctorQuery
.WhereIf(inQuery.HospitalId!=null,x=>x.HospitalId==inQuery.HospitalId.Value)
.WhereIf(inQuery.SpecialityId != null, x => x.SpecialityId == inQuery.SpecialityId.Value)
.WhereIf(inQuery.SubspecialityId != null, x => x.SubspecialityIds.Contains(inQuery.SpecialityId.Value))
.ToPagedListAsync(inQuery);
var enrollStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();

View File

@ -178,7 +178,25 @@ namespace IRaCIS.Core.Application.Contracts
public bool? IsConfirmed { get; set; }
/// <summary>
/// 课时状态
/// </summary>
public bool? IsDeleted { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public DateTime? StartCreateTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime? EndCreateTime { get; set; }
}
///<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>

View File

@ -473,7 +473,7 @@ namespace IRaCIS.Core.Application.Services
var trialDocQuery =
from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId)
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId
&& t.TrialUserRoleList.AsQueryable().Any(t => trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId))
)
.Where(t => inQuery.UserId != null ? t.IdentityUserId == inQuery.UserId : true)
@ -557,6 +557,9 @@ namespace IRaCIS.Core.Application.Services
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
.WhereIf(inQuery.StartCreateTime!=null, t => t.CreateTime >= inQuery.StartCreateTime.Value)
.WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime.Value)
.WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted);
var result = await unionQuery.ToPagedListAsync(inQuery);