diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 98ab411b7..901e3268a 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -637,6 +637,71 @@ 是否生效 + + + id + + + + + 项目ID + + + + + 阅片期名称 + + + + + 阅片范围 + + + + + 截止日期 + + + + + 截止访视 + + + + + 访视计划ID + + + + + 是否生效 + + + + + 创建时间 + + + + + 创建人 + + + + + 备注 + + + + + 中心Id + + + + + 中心name + + 项目ID @@ -2807,6 +2872,13 @@ + + + 获取单挑 + + + + 设置阅片期配置是否生效 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs index 3bc46742c..f33b8b63d 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs @@ -99,6 +99,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string SiteCode { get; set; } + public bool IsFinalVisit { get; set; } = false; + + public string VisitName { get; set; } public Guid? SiteId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs index d7fcab940..bee32dceb 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs @@ -54,9 +54,74 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class ReadingPeriodSetView : ReadingPeriodSet + public class ReadingPeriodSetView { - + /// + /// id + /// + + public Guid Id { get; set; } + + /// + /// 项目ID + /// + public Guid? TrialId { get; set; } + + /// + /// 阅片期名称 + /// + public string ReadingPeriodName { get; set; } + + /// + /// 阅片范围 + /// + public ReadingScopeEnum? ReadingScope { get; set; } + + /// + /// 截止日期 + /// + public DateTime? ExpirationDate { get; set; } + + /// + /// 截止访视 + /// + public decimal? ExpirationVisit { get; set; } + + /// + /// 访视计划ID + /// + public Guid? VisitStageId { get; set; } + + /// + /// 是否生效 + /// + public int? IsTakeEffect { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 中心Id + /// + public List SiteIds { get; set; } + + /// + /// 中心name + /// + public List SiteCodes { get; set; } } public class SetReadingPeriodSetEffect diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index 9e90e002b..fca2a94c9 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -51,16 +51,17 @@ namespace IRaCIS.Application.Services { CreateTime = y.CreateTime, Id = y.Id, + IsFinalVisit=y.IsFinalVisit, // 是否末次访视 SubjectId = x.Id, SubjectVisitId = y.Id, IsUrgent = x.IsUrgent, - ModuleName = y.InPlan ? "计划内访视" : "计划外访视", - ModuleType = y.InPlan ? ModuleTypeEnum.InPlanSubjectVisit : ModuleTypeEnum.OutPlanSubjectVisit, + ModuleType = y.InPlan ? ModuleTypeEnum.InPlanSubjectVisit : ModuleTypeEnum.OutPlanSubjectVisit, // SubjectCode = y.Subject.Code, SiteCode = x.Site.SiteCode, SiteId = x.Site.Id, VisitName = y.VisitName, + }).ToList() }); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs index f7b7185d2..03750bfdb 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs @@ -20,13 +20,16 @@ namespace IRaCIS.Application.Services public IRepository _subjectVisitRepository; private readonly IRepository _readingPeriodSetRepository; + private readonly IRepository _siteSetRepository; public ReadingPeriodSetService(IRepository subjectVisitRepository, - IRepository ReadingPeriodSetRepository + IRepository ReadingPeriodSetRepository, + IRepository SiteSetRepository ) { _subjectVisitRepository = subjectVisitRepository; _readingPeriodSetRepository = ReadingPeriodSetRepository; + _siteSetRepository = SiteSetRepository; } @@ -73,7 +76,6 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetReadingPeriodSetList(ReadingPeriodSetQuery query) { - var readquery =_readingPeriodSetRepository.AsQueryable().Include(x=>x.ReadingPeriodSites) .WhereIf(query.TrialId!=null,x=>x.TrialId==query.TrialId) .WhereIf(query.ReadingPeriodName != null, x => x.ReadingPeriodName.Contains(query.ReadingPeriodName)) @@ -84,6 +86,20 @@ namespace IRaCIS.Application.Services return pageList; } + /// + /// 获取单挑 + /// + /// + /// + [HttpPost("ReadingPeriodSet/GetReadingPeriodSet/{id:guid}")] + public async Task GetReadingPeriodSet(Guid id) + { + var data = await _readingPeriodSetRepository.AsQueryable().Include(x => x.ReadingPeriodSites).Where(x => x.Id == id).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); + + return data; + + } + /// /// 设置阅片期配置是否生效 @@ -91,15 +107,13 @@ namespace IRaCIS.Application.Services /// /// [HttpPut] - public async Task SetReadingPeriodSetEffect(SetReadingPeriodSetEffect indto) + public async Task SetReadingPeriodSetEffect(SetReadingPeriodSetEffect indto) { - var readquery =await _readingPeriodSetRepository.UpdatePartialNowNoQueryAsync(indto.Id, x => new ReadingPeriodSet() { IsTakeEffect = indto.IsTakeEffect }); - - - await _readingPeriodSetRepository.SaveChangesAsync(); + bool result= await _readingPeriodSetRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); } diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index b6b794624..402261fb2 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -12,9 +12,14 @@ namespace IRaCIS.Core.Application.Service public ReadingConfig() { CreateMap(); - - CreateMap(); + + CreateMap() + .ForMember(d => d.SiteIds, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.SiteId))) + .ForMember(d => d.SiteCodes, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.Site.SiteCode))); + + //.ForMember(d => d.SiteNames, u => u.MapFrom(s => s.ReadingPeriodSites.SelectMany(x => x.Site.SiteName).ToList())); + CreateMap().ReverseMap(); diff --git a/IRaCIS.Core.Domain/Reading/ReadModule.cs b/IRaCIS.Core.Domain/Reading/ReadModule.cs index 60b874103..60eeecdbd 100644 --- a/IRaCIS.Core.Domain/Reading/ReadModule.cs +++ b/IRaCIS.Core.Domain/Reading/ReadModule.cs @@ -55,6 +55,16 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } + /// + /// 阅片计划ID + /// + public Guid? ReadingPeriodSetId { get; set; } + + /// + /// 上一次访视(截止访视) + /// + public Guid? LastVisitIdSetId { get; set; } + } diff --git a/IRaCIS.Core.Domain/Reading/ReadingPeriodSite.cs b/IRaCIS.Core.Domain/Reading/ReadingPeriodSite.cs index cb6828163..957e6e1b1 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingPeriodSite.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingPeriodSite.cs @@ -38,6 +38,11 @@ namespace IRaCIS.Core.Domain.Models public ReadingPeriodSet ReadingPeriodSet { get; set; } + /// + /// 中心 + /// + public Site Site { get; set; } + }