修改查询条件
parent
f4693292e6
commit
05d96e9de1
|
@ -722,6 +722,11 @@
|
||||||
数据
|
数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.SubjectVisitPlanView.Id">
|
||||||
|
<summary>
|
||||||
|
Id(阅片期Id 或者 访视ID)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFInDto.TrialId">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFInDto.TrialId">
|
||||||
<summary>
|
<summary>
|
||||||
项目Id
|
项目Id
|
||||||
|
@ -3163,6 +3168,13 @@
|
||||||
生成的阅片模块(在大列表上展示的) 阅片期
|
生成的阅片模块(在大列表上展示的) 阅片期
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadModuleService.GetReadPlanList(IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto)">
|
||||||
|
<summary>
|
||||||
|
获取读片计划列表 byZhouhang
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadModuleService.GetReadModuleList(IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto)">
|
<member name="M:IRaCIS.Application.Services.ReadModuleService.GetReadModuleList(IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取读片模块
|
获取读片模块
|
||||||
|
|
|
@ -65,6 +65,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
///<summary> TypeValue</summary>
|
///<summary> TypeValue</summary>
|
||||||
public string Type { get; set; }=String.Empty;
|
public string Type { get; set; }=String.Empty;
|
||||||
|
|
||||||
|
public bool? IsEnable { get; set; }
|
||||||
|
|
||||||
|
public bool? IsRequired { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
var trialQCQuestionQueryable = _trialQcQuestionRepository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId)
|
var trialQCQuestionQueryable = _trialQcQuestionRepository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.QuestionName), t => t.QuestionName.Contains(queryTrialQCQuestionConfigure.QuestionName))
|
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.QuestionName), t => t.QuestionName.Contains(queryTrialQCQuestionConfigure.QuestionName))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.Type), t => t.Type.Contains(queryTrialQCQuestionConfigure.Type))
|
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.Type), t => t.Type.Contains(queryTrialQCQuestionConfigure.Type))
|
||||||
|
.WhereIf(queryTrialQCQuestionConfigure.IsEnable!=null, t => t.IsEnable== queryTrialQCQuestionConfigure.IsEnable)
|
||||||
|
.WhereIf(queryTrialQCQuestionConfigure.IsRequired != null, t => t.IsRequired == queryTrialQCQuestionConfigure.IsRequired)
|
||||||
|
|
||||||
|
|
||||||
.ProjectTo<TrialQCQuestionConfigureView>(_mapper.ConfigurationProvider);
|
.ProjectTo<TrialQCQuestionConfigureView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var list = await trialQCQuestionQueryable.OrderBy(t => t.ShowOrder).ToListAsync();
|
var list = await trialQCQuestionQueryable.OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
|
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public class GetReadModuleDto:PageInput
|
public class GetReadModuleDto : PageInput
|
||||||
{
|
{
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class ReadModuleAddOrEdit: ReadModule
|
public class ReadModuleAddOrEdit : ReadModule
|
||||||
{
|
{
|
||||||
public new Guid? Id { get; set; }
|
public new Guid? Id { get; set; }
|
||||||
|
|
||||||
|
@ -347,4 +347,72 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public List<ReadModuleView> Data { get; set; }
|
public List<ReadModuleView> Data { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class ReadPlanView
|
||||||
|
{
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
|
||||||
|
public string TrialSiteCode { get; set; }
|
||||||
|
|
||||||
|
public string SiteCode { get; set; }
|
||||||
|
|
||||||
|
public Guid SiteId { get; set; }
|
||||||
|
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<SubjectVisitPlanView> SubjectVisitPlanList { get; set; }
|
||||||
|
|
||||||
|
public List<ReadMoudleView> ReadMoudlePlanList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ReadMoudleView
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SubjectVisitPlanView
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id(阅片期Id 或者 访视ID)
|
||||||
|
/// </summary>
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public ModuleTypeEnum ModuleType { get; set; }
|
||||||
|
|
||||||
|
public ReadModuleEnum? Status { get; set; }
|
||||||
|
|
||||||
|
public bool? IsUrgent { get; set; }
|
||||||
|
|
||||||
|
public Guid SubjectVisitId { get; set; }
|
||||||
|
|
||||||
|
public string SubjectVisitName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsFinalVisit { get; set; } = false;
|
||||||
|
|
||||||
|
public Guid? OutPlanPreviousVisitId { get; set; }
|
||||||
|
|
||||||
|
public string OutPlanPreviousVisitName { get; set; }
|
||||||
|
|
||||||
|
public Guid? SiteId { get; set; }
|
||||||
|
|
||||||
|
public bool IsVisit { get; set; } = true;
|
||||||
|
|
||||||
|
public decimal? VisitNum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public PDStateEnum PDState { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnrollmentConfirm { get; set; } = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,86 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取读片计划列表 byZhouhang
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<(PageOutput<ReadPlanView>, object)> GetReadPlanList(GetReadModuleDto dto)
|
||||||
|
{
|
||||||
|
var subjectQuery = _subjectRepository
|
||||||
|
.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
||||||
|
.WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId)
|
||||||
|
.WhereIf(dto.TrialSiteCode != null, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode)
|
||||||
|
.WhereIf(dto.SubjectCode != null, x => x.Code == dto.SubjectCode)
|
||||||
|
.Select(x => new ReadPlanView
|
||||||
|
{
|
||||||
|
TrialSiteCode = x.TrialSite.TrialSiteCode,
|
||||||
|
SiteCode = x.TrialSite.TrialSiteCode,
|
||||||
|
SiteId = x.SiteId,
|
||||||
|
SubjectCode = x.Code,
|
||||||
|
SubjectId = x.Id,
|
||||||
|
|
||||||
|
//Data = x.SubjectVisitList.OrderByDescending(y => y.VisitNum).Select(y => new GetReadModuleOutDto()
|
||||||
|
//{
|
||||||
|
// Id = y.Id, //id
|
||||||
|
// Name = y.VisitName,
|
||||||
|
// ModuleType = y.InPlan ? ModuleTypeEnum.InPlanSubjectVisit : ModuleTypeEnum.OutPlanSubjectVisit, // 模块类型
|
||||||
|
// IsUrgent = x.IsUrgent, // 是否加急
|
||||||
|
// SubjectVisitId = y.Id, // 访视ID
|
||||||
|
// SubjectVisitName = y.VisitName, // 访视名称
|
||||||
|
// Status = ReadingCommon.GetVisitSubmitStateEnum(y), // 状态
|
||||||
|
// CreateTime = y.CreateTime, // 创建时间
|
||||||
|
// SubjectCode = y.Subject.Code, // 受试者code
|
||||||
|
// TrialSiteCode = x.TrialSite.TrialSiteCode, // 中心Code
|
||||||
|
// VisitNum = y.VisitNum,
|
||||||
|
|
||||||
|
// IsFinalVisit = y.IsFinalVisit, // 是否为末次评估
|
||||||
|
// OutPlanPreviousVisitId = y.OutPlanPreviousVisitId, // 上一访视
|
||||||
|
// OutPlanPreviousVisitName = y.OutPlanPreviousVisit.VisitName, // 上一访视名称
|
||||||
|
// SiteId = x.Site.Id, // 中心ID
|
||||||
|
// IsVisit = true, // 是否为访视
|
||||||
|
// PDState = y.PDState, // PD 进展
|
||||||
|
// IsEnrollmentConfirm = y.IsEnrollmentConfirm, // 入组
|
||||||
|
// SubjectId = x.Id,
|
||||||
|
//}).ToList(),
|
||||||
|
|
||||||
|
//ReadModuleData = x.ReadModuleList.Select(
|
||||||
|
// z => new GetReadModuleOutDto()
|
||||||
|
// {
|
||||||
|
// CreateTime = z.CreateTime,
|
||||||
|
// Id = z.Id,
|
||||||
|
// Name = z.ModuleName,
|
||||||
|
// SubjectId = x.Id,
|
||||||
|
// ModuleType = z.ModuleType,
|
||||||
|
// Status = ReadingCommon.GetVisitSubmitStateEnum(z.SubjectVisit),
|
||||||
|
// SubjectCode = x.Code,
|
||||||
|
// TrialSiteCode = x.TrialSite.TrialSiteCode,
|
||||||
|
// SubjectVisitId = z.SubjectVisitId,
|
||||||
|
// SubjectVisitName = z.SubjectVisit.VisitName, // 截止访视名称
|
||||||
|
// CutOffVisitId = z.SubjectVisitId, // 截止访视
|
||||||
|
// CutOffVisitName = z.SubjectVisit.VisitName, // 截止访视名称
|
||||||
|
// ReadModuleId = z.ReadModuleId,
|
||||||
|
// ReadModuleName = z.ReadModuleModel.ModuleName,
|
||||||
|
// IsUrgent = z.IsUrgent
|
||||||
|
// }).ToList(),
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var pageList = await subjectQuery.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField == null || dto.SortField == string.Empty ? "SiteCode" : dto.SortField,
|
||||||
|
dto.Asc);
|
||||||
|
|
||||||
|
return (pageList, new
|
||||||
|
{
|
||||||
|
MaxLength = pageList.CurrentPageData.ToList().Count()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取读片模块
|
/// 获取读片模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -63,16 +143,18 @@ namespace IRaCIS.Application.Services
|
||||||
public async Task<(PageOutput<GetReadModuleDtoOut>,object)> GetReadModuleList(GetReadModuleDto dto)
|
public async Task<(PageOutput<GetReadModuleDtoOut>,object)> GetReadModuleList(GetReadModuleDto dto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region MyRegion
|
||||||
|
|
||||||
var subjectQuery = _readModuleViewRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
var subjectQuery = _readModuleViewRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
||||||
.WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId)
|
.WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId)
|
||||||
.WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode!=String.Empty, x => x.TrialSiteCode == dto.TrialSiteCode)
|
.WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != String.Empty, x => x.TrialSiteCode == dto.TrialSiteCode)
|
||||||
.WhereIf(dto.SubjectCode != null && dto.SubjectCode != String.Empty, x => x.SubjectCode == dto.SubjectCode)
|
.WhereIf(dto.SubjectCode != null && dto.SubjectCode != String.Empty, x => x.SubjectCode == dto.SubjectCode)
|
||||||
.WhereIf(dto.ModuleType != null, x => x.ModuleType == dto.ModuleType)
|
.WhereIf(dto.ModuleType != null, x => x.ModuleType == dto.ModuleType)
|
||||||
.WhereIf(dto.Status != null, x => x.Status == dto.Status)
|
.WhereIf(dto.Status != null, x => x.Status == dto.Status)
|
||||||
.WhereIf(dto.Name != null, x => x.Name.Contains(x.Name)).OrderBy(x=>x.SiteCode);
|
.WhereIf(dto.Name != null, x => x.Name.Contains(x.Name)).OrderBy(x => x.SiteCode);
|
||||||
|
|
||||||
var subjectIds =await subjectQuery.Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
var subjectIds = await subjectQuery.Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
List<ReadModuleView> ReadModuleViewList =await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).ToListAsync();
|
List<ReadModuleView> ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).ToListAsync();
|
||||||
List<GetReadModuleDtoOut> getReadList = ReadModuleViewList.GroupBy(x => new { x.SubjectId, x.SiteId, x.TrialSiteCode, x.SubjectCode })
|
List<GetReadModuleDtoOut> getReadList = ReadModuleViewList.GroupBy(x => new { x.SubjectId, x.SiteId, x.TrialSiteCode, x.SubjectCode })
|
||||||
.Select(x => new GetReadModuleDtoOut()
|
.Select(x => new GetReadModuleDtoOut()
|
||||||
{
|
{
|
||||||
|
@ -90,11 +172,12 @@ namespace IRaCIS.Application.Services
|
||||||
PageSize = dto.PageSize,
|
PageSize = dto.PageSize,
|
||||||
CurrentPageData = getReadList,
|
CurrentPageData = getReadList,
|
||||||
PageIndex = dto.PageIndex,
|
PageIndex = dto.PageIndex,
|
||||||
TotalCount =await subjectQuery.Select(x => x.SubjectId).Distinct().CountAsync(),
|
TotalCount = await subjectQuery.Select(x => x.SubjectId).Distinct().CountAsync(),
|
||||||
};
|
};
|
||||||
|
|
||||||
var maxcount = 0;
|
var maxcount = 0;
|
||||||
pageOutput.CurrentPageData.ForEach(x => {
|
pageOutput.CurrentPageData.ForEach(x =>
|
||||||
|
{
|
||||||
maxcount = maxcount < x.Data.Count ? x.Data.Count : maxcount;
|
maxcount = maxcount < x.Data.Count ? x.Data.Count : maxcount;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -103,10 +186,11 @@ namespace IRaCIS.Application.Services
|
||||||
MaxLength = maxcount
|
MaxLength = maxcount
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 用导航属性写的 有问题
|
#region 用导航属性写的 有问题
|
||||||
//var subjectQuery = _subjectRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
//var subjectQuery = _subjectRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
||||||
// .WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId)
|
// .WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId).Include(x => x.SubjectVisitList).Include(x => x.Site).Include(x => x.TrialSite)
|
||||||
// .Include(x => x.SubjectVisitList).Include(x => x.Site).Include(x => x.TrialSite)
|
|
||||||
// .WhereIf(dto.TrialSiteCode != null, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode)
|
// .WhereIf(dto.TrialSiteCode != null, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode)
|
||||||
// .WhereIf(dto.SubjectCode != null, x => x.Code == dto.SubjectCode)
|
// .WhereIf(dto.SubjectCode != null, x => x.Code == dto.SubjectCode)
|
||||||
|
|
||||||
|
@ -206,37 +290,6 @@ namespace IRaCIS.Application.Services
|
||||||
//var readModules = await _readModuleRepository.Where(x => subjectIds.Contains(x.SubjectId)).Include(x => x.SubjectVisit)
|
//var readModules = await _readModuleRepository.Where(x => subjectIds.Contains(x.SubjectId)).Include(x => x.SubjectVisit)
|
||||||
// .Include(x => x.ReadModuleModel).ToListAsync();
|
// .Include(x => x.ReadModuleModel).ToListAsync();
|
||||||
|
|
||||||
////pageList.CurrentPageData.ForEach(x => {
|
|
||||||
//// x.Data.AddRange(readModules.Where(y => y.SubjectId == x.SubjectId).Select(
|
|
||||||
//// y => new GetReadModuleOutDto()
|
|
||||||
//// {
|
|
||||||
//// CreateTime = y.CreateTime,
|
|
||||||
//// Id = y.Id,
|
|
||||||
//// Name=y.ModuleName,
|
|
||||||
//// SubjectId=x.SubjectId,
|
|
||||||
//// ModuleType=y.ModuleType,
|
|
||||||
//// Status= ReadingCommon.GetVisitSubmitStateEnum(y.SubjectVisit),
|
|
||||||
//// SubjectCode= x.SubjectCode,
|
|
||||||
//// TrialSiteCode = x.TrialSiteCode,
|
|
||||||
//// SubjectVisitId= y.SubjectVisitId,
|
|
||||||
//// SubjectVisitName=y.SubjectVisit?.VisitName, // 截止访视名称
|
|
||||||
//// CutOffVisitId = y.SubjectVisitId, // 截止访视
|
|
||||||
//// CutOffVisitName = y.SubjectVisit?.VisitName, // 截止访视名称
|
|
||||||
//// ReadModuleId=y.ReadModuleId,
|
|
||||||
//// ReadModuleName=y.ReadModuleModel?.ModuleName,
|
|
||||||
//// IsUrgent = y.IsUrgent
|
|
||||||
|
|
||||||
//// }));
|
|
||||||
|
|
||||||
//// x.Data= x.Data.OrderBy(y => y.ModuleType).ThenBy(x=>x.VisitNum).ToList();
|
|
||||||
////});
|
|
||||||
|
|
||||||
//pageList.CurrentPageData.ForEach(x => {
|
|
||||||
|
|
||||||
//});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//return (pageList, new
|
//return (pageList, new
|
||||||
//{
|
//{
|
||||||
|
|
Loading…
Reference in New Issue