From 5fbaef17ee7eebedaff3ed488873c2cd1dcaaaf8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 5 Jul 2022 11:53:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/IRaCIS.Core.API.xml | 7 ++ .../IRaCIS.Core.Application.xml | 86 +++++++++++++++--- .../DTO/TaskConsistentRuleViewModel.cs | 7 +- .../Allocation/DTO/VisitTaskViewModel.cs | 8 +- .../Allocation/TaskConsistentRuleService.cs | 87 +++++++++++-------- .../Service/Allocation/VisitTaskService.cs | 5 -- .../Service/Allocation/_MapConfig.cs | 11 +-- .../Reading/ReadingImageTaskService.cs | 6 +- .../Allocation/AllocationRelation.cs | 10 +++ .../Allocation/TaskConsistentRule.cs | 2 + IRaCIS.Core.Domain/Allocation/VisitTask.cs | 12 ++- .../Context/IRaCISDBContext.cs | 7 ++ .../Extention/IEnumerableExtensions.cs | 26 +++--- 13 files changed, 193 insertions(+), 81 deletions(-) diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index 4542724c4..144782e94 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -90,6 +90,13 @@ + + + 医学审核完成 + + + + 确认项目医学审核问题 diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index b61f9820f..c03729d73 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1472,9 +1472,44 @@ 答案 - + - 是否完成 + 阅片人是否认同 + + + + + 不同意重阅原因 + + + + + 是否申请重阅 + + + + + 对话内容 + + + + + 用户角色 + + + + + 用户角色枚举 + + + + + 创建人 + + + + + 创建时间 @@ -1482,6 +1517,11 @@ 是否关闭 + + + 是否关闭 + + 是否有问题 @@ -1502,11 +1542,6 @@ 审核建议 - - - 是否关闭 - - 是否有问题 @@ -1527,11 +1562,6 @@ 审核建议 - - - 是否完成 - - 是否关闭 @@ -2332,6 +2362,12 @@ + + + 关闭医学审核对话 + + + 发送对话消息 @@ -2339,6 +2375,27 @@ + + + 获取医学审核对话 + + + + + + + 完成医学审核 + + + + + + + IR回复确认医学审核 + + + + 医学审核问题 @@ -2524,6 +2581,11 @@ TaskMedicalReviewView 列表视图模型 + + + 审核建议 + + TaskMedicalReviewQuery 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index b378834dd..c773f8103 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -59,7 +59,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid SiteId => VisitTaskList.Select(t => t.SiteId).First(); public String TrialSiteCode => VisitTaskList.Select(t => t.TrialSiteCode).First(); - public string SubjectCode => VisitTaskList.Select(t => t.TrialSiteCode).First(); + public string SubjectCode => VisitTaskList.Select(t => t.SubjectCode).First(); public Guid SubjectId { get; set; } @@ -70,7 +70,7 @@ namespace IRaCIS.Core.Application.ViewModel public List VisitTaskList { get; set; } - //public List HistoryDoctorUserList => VisitTaskList.Select(t => t.DoctorUser).Distinct().ToList(); + public List HistoryDoctorUserList => VisitTaskList.SelectMany(t => t.RelationDoctorUserList).DistinctBy(t=>t.UserId).ToList(); } public class VisitTaskSimpleView @@ -99,12 +99,13 @@ namespace IRaCIS.Core.Application.ViewModel public String TrialSiteCode { get; set; } = String.Empty; public string SubjectCode { get; set; } = String.Empty; - //public UserSimpleInfo DoctorUser { get; set; } + public List RelationDoctorUserList { get; set; } [JsonIgnore] public Guid? DoctorUserId { get; set; } [JsonIgnore] public Guid? TaskConsistentRuleId { get; set; } + public bool IsHaveGeneratedTask { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 511211d15..fcc3e7e45 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -86,13 +86,17 @@ namespace IRaCIS.Core.Application.ViewModel public ReadingTaskState ReadingTaskState { get; set; } - - public ReReadingApplyState ReReadingApplyState { get; set; } public DateTime? SuggesteFinishedTime { get; set; } } + + public class AnalysisTaskView: ReadingTaskView + { + public bool IsSelfAnalysis { get; set; } + } + //public class IRReReadingTaskView: ReReadingTaskView //{ diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index eef9c464d..70a055f8c 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -24,12 +24,14 @@ namespace IRaCIS.Core.Application.Service private readonly IRepository _taskConsistentRuleRepository; private readonly IRepository _visitTaskRepository; private readonly IRepository _subjectUserRepository; + private readonly IRepository _subjectRepository; - public TaskConsistentRuleService(IRepository visitTaskRepository, IRepository taskConsistentRuleRepository, IRepository subjectUserRepository) + public TaskConsistentRuleService(IRepository visitTaskRepository, IRepository taskConsistentRuleRepository, IRepository subjectUserRepository ,IRepository subjectRepository) { _taskConsistentRuleRepository = taskConsistentRuleRepository; _visitTaskRepository = visitTaskRepository; _subjectUserRepository = subjectUserRepository; + _subjectRepository = subjectRepository; } @@ -39,7 +41,7 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task> GetAnalysisTaskList(VisitTaskQuery queryVisitTask) + public async Task> GetAnalysisTaskList(VisitTaskQuery queryVisitTask) { var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId) .Where(t => t.IsAnalysisCreate) @@ -55,7 +57,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate) .WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate.Value.AddDays(1)) - .ProjectTo(_mapper.ConfigurationProvider); + .ProjectTo(_mapper.ConfigurationProvider); var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId) }; @@ -90,34 +92,36 @@ namespace IRaCIS.Core.Application.Service var doctorUserId = isSelfAnalysis ? filterObj.AnalysisDoctorUserId : filterObj.CompareDoctorUserId; - var group = _visitTaskRepository.Where(t => t.TrialId == filterObj.TrialId) - // 自身一致性分析 - .WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId) - // 组内一致性分析 - .WhereIf(isSelfAnalysis == false && subjectfilter !=null, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId)) - .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) - .Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now) - //重阅产生的访视任务 要把之前的访视任务去除 - .Where(t => t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject) - .WhereIf(filterObj.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit) - .WhereIf(filterObj.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global) - .GroupBy(t => t.SubjectId) - .Where(g => g.Count() >= filterObj.PlanVisitCount); + #region 以任务为维度 + var group = _visitTaskRepository.Where(t => t.TrialId == filterObj.TrialId && t.IsAnalysisCreate==false) + // 自身一致性分析 + .WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId) + // 组内一致性分析 + .WhereIf(isSelfAnalysis == false && subjectfilter != null, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId)) + .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) + .Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now) + //重阅产生的访视任务 要把之前的访视任务去除 + .Where(t => t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject) + + .WhereIf(filterObj.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit) + .WhereIf(filterObj.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global) + .GroupBy(t => t.SubjectId) + .Where(g => g.Count() >= filterObj.PlanVisitCount); var query = group.Select(g => new DoctorConsistentRuleSubjectView() { SubjectId = g.Key, - IsHaveGeneratedTask = g.Any(t => t.IsAnalysisCreate && t.SubjectId == g.Key && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id), + IsHaveGeneratedTask = g.Any(c => c.Subject.SubjectVisitTaskList.Any(t => t.IsAnalysisCreate && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id)), - VisitTaskList = g.Where(t => t.IsAnalysisCreate == false).OrderBy(t => t.VisitTaskNum) + VisitTaskList = g.OrderBy(t => t.VisitTaskNum) .Select(c => new VisitTaskSimpleView() { Id = c.Id, ReadingCategory = c.ReadingCategory, - ReadingTaskState=c.ReadingTaskState, + ReadingTaskState = c.ReadingTaskState, TaskBlindName = c.TaskBlindName, TaskCode = c.TaskCode, TaskName = c.TaskName, @@ -129,18 +133,24 @@ namespace IRaCIS.Core.Application.Service SubjectCode = c.Subject.Code, TrialSiteCode = c.Subject.TrialSite.TrialSiteCode, - //DoctorUser=new UserSimpleInfo() - //{ - // FullName=c.DoctorUser.FullName, - // UserCode=c.DoctorUser.UserCode, - // UserId=c.DoctorUser.Id, - // UserName=c.DoctorUser.UserName - //} + RelationDoctorUserList=c.SameVisitTaskList/*Where(t=>t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)*/.Select(c=> new UserSimpleInfo() + { + FullName = c.DoctorUser.FullName, + UserCode = c.DoctorUser.UserCode, + UserId = c.DoctorUser.Id, + UserName = c.DoctorUser.UserName + }).ToList(), + + IsHaveGeneratedTask = c.Subject.SubjectVisitTaskList.Any(t => t.IsAnalysisCreate && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id), + }).ToList(), ValidTaskCount = g.Count() }); + #endregion + + var count = group.Count(); @@ -185,10 +195,10 @@ namespace IRaCIS.Core.Application.Service - var group = _visitTaskRepository.Where(t => t.TrialId == filterObj.TrialId && inCommand.SubejctIdList.Contains(t.SubjectId)) - // 自身一致性分析 + var group = _visitTaskRepository.Where(t => t.TrialId == filterObj.TrialId && inCommand.SubejctIdList.Contains(t.SubjectId) && t.IsAnalysisCreate == false) + // 自身一致性分析 .WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId) - // 组内一致性分析 + // 组内一致性分析 .WhereIf(isSelfAnalysis == false && subjectfilter != null, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId)) .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) .Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now) @@ -205,9 +215,9 @@ namespace IRaCIS.Core.Application.Service { SubjectId = g.Key, - IsHaveGeneratedTask = g.Any(t => t.IsAnalysisCreate && t.SubjectId == g.Key && t.DoctorUserId == doctorUserId), + IsHaveGeneratedTask = g.Any(c => c.Subject.SubjectVisitTaskList.Any(t => t.IsAnalysisCreate && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id)), - VisitTaskList = g.Where(t => t.IsAnalysisCreate == false).OrderBy(t => t.VisitTaskNum).Select(c => new VisitTaskSimpleView() + VisitTaskList = g.OrderBy(t => t.VisitTaskNum).Select(c => new VisitTaskSimpleView() { Id = c.Id, ReadingCategory = c.ReadingCategory, @@ -217,28 +227,31 @@ namespace IRaCIS.Core.Application.Service TaskState = c.TaskState, ArmEnum = c.ArmEnum, SubjectId = c.SubjectId, - SiteId=c.Subject.SiteId, + SiteId = c.Subject.SiteId, TrialId = c.TrialId, SubjectCode = c.Subject.Code, TrialSiteCode = c.Subject.TrialSite.TrialSiteCode, - }).Take(filterObj.PlanVisitCount).ToList(), + + IsHaveGeneratedTask = c.Subject.SubjectVisitTaskList.Any(t => t.IsAnalysisCreate && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id), + + }).ToList(), ValidTaskCount = g.Count() }); - var list = query.ToList(); + var list = query.OrderByDescending(t=>t.IsHaveGeneratedTask).ToList(); foreach (var subject in list) { - subject.VisitTaskList.ForEach(t => { t.DoctorUserId = doctorUserId; t.TaskConsistentRuleId = filterObj.Id; }); + subject.VisitTaskList.Take(filterObj.PlanVisitCount).ForEach(t => { t.DoctorUserId = doctorUserId; t.TaskConsistentRuleId = filterObj.Id; }); await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand() { - TrialId= filterObj.TrialId, + TrialId = filterObj.TrialId, ReadingCategory = ReadingCategory.Consistent, - GenerataConsistentTaskList = subject.VisitTaskList + GenerataConsistentTaskList = subject.VisitTaskList.Where(t=>t.IsHaveGeneratedTask==false).ToList() }); } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 1aa553fc9..415b14dd4 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -201,11 +201,6 @@ namespace IRaCIS.Core.Application.Service - - - - - /// /// PM 重阅追踪 /// diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 921de1e28..3933eec4c 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -83,14 +83,15 @@ namespace IRaCIS.Core.Application.Service - CreateMap().IncludeBase() + CreateMap().IncludeBase() .ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList)); CreateMap().IncludeBase(); - + CreateMap().IncludeBase() + .ForMember(o => o.IsSelfAnalysis, t => t.MapFrom(u => u.TaskConsistentRule.CompareDoctorUserId == null)); @@ -105,8 +106,8 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId)) - .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate? u.BlindTrialSiteCode: u.Subject.TrialSite.TrialSiteCode)) - .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate ? u.BlindSubjectCode: u.Subject.Code)); + .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode)) + .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate ? u.BlindSubjectCode : u.Subject.Code)); @@ -193,7 +194,7 @@ namespace IRaCIS.Core.Application.Service //.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.DoctorUser)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)); - + } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index d0d34513f..bf7c44798 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -91,7 +91,7 @@ namespace IRaCIS.Application.Services SubjectId=x.SubjectId, ReadingCategory = x.ReadingCategory, VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId, - VisitNum = x.SourceSubjectVisitId != null ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum, + VisitNum = x.SourceSubjectVisitId != null ? x.SourceSubjectVisit.VisitNum : x.ReadModule.VisitNum, }).FirstOrDefaultAsync(); @@ -122,7 +122,7 @@ namespace IRaCIS.Application.Services TaskBlindName=x.TaskBlindName, ReadingCategory = x.ReadingCategory, VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId, - VisitNum = x.SourceSubjectVisitId != null ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum, + VisitNum = x.SourceSubjectVisitId != null ? x.SourceSubjectVisit.VisitNum : x.ReadModule.VisitNum, }).OrderBy(x => x.VisitNum).ThenBy(x => x.ReadingCategory); task =await taskquery.FirstOrDefaultAsync(); @@ -142,7 +142,7 @@ namespace IRaCIS.Application.Services TaskBlindName = x.TaskBlindName, ReadingCategory = x.ReadingCategory, VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId, - VisitNum = x.SourceSubjectVisitId != null ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum, + VisitNum = x.SourceSubjectVisitId != null ? x.SourceSubjectVisit.VisitNum : x.ReadModule.VisitNum, SubjectId=x.SubjectId, SubjectCode=x.Subject.Code, }).FirstOrDefaultAsync(); diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs index ef4ea8915..8a71f4197 100644 --- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs +++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs @@ -169,6 +169,16 @@ namespace IRaCIS.Core.Domain.Share } + + //public enum AnalysisType + //{ + // Default=0, + + // Self=1, + + // InnerGroup=2 + //} + // public enum RequestReReadingType { diff --git a/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs b/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs index ec48332c5..0cd0a8be5 100644 --- a/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs +++ b/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs @@ -63,6 +63,8 @@ namespace IRaCIS.Core.Domain.Models public List DoctorVisitTaskList { get; set; } + + //[Projectable] //public List DoctorConsistentTaskList => DoctorVisitTaskList.Where(t => t.IsAnalysisCreate && t.TaskConsistentRuleId == Id).ToList(); } diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index f6fda178d..0c87bef13 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -78,7 +78,15 @@ namespace IRaCIS.Core.Domain.Models public ReadModule ReadModule { get; set; } [ForeignKey("SourceSubjectVisitId")] - public SubjectVisit SubjectVisit { get; set; } + public SubjectVisit SourceSubjectVisit { get; set; } + + + //排除一致性分析 因为souceVisitId 没值 + public List SameVisitTaskList { get; set; } + + + + public TaskConsistentRule TaskConsistentRule { get; set; } public TaskAllocationRule DoctorTaskAllocationRule { get; set; } @@ -113,6 +121,8 @@ namespace IRaCIS.Core.Domain.Models //是否是一致性分析产生 public bool IsAnalysisCreate { get; set; } + + public string BlindSubjectCode { get; set; } = string.Empty; public string BlindTrialSiteCode { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index cbbb55969..0a1358562 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -96,6 +96,13 @@ namespace IRaCIS.Core.Infra.EFCore modelBuilder.Entity().HasMany(t => t.SubjectArmVisitTaskList).WithOne(t=>t.SujectArm).HasForeignKey(t => new { t.SubjectId,t.ArmEnum}).HasPrincipalKey(u => new { u.SubjectId,u.ArmEnum }); modelBuilder.Entity().HasMany(t => t.JudgeVisitList).WithOne(t=>t.JudgeVisitTask); + + modelBuilder.Entity().HasMany(t => t.SameVisitTaskList).WithOne().HasForeignKey(t=>t.SourceSubjectVisitId).HasPrincipalKey(u=>u.SourceSubjectVisitId); + + //modelBuilder.Entity().HasMany(t => t.AnalysisVisitTaskList).WithOne().HasForeignKey(t => t.TaskConsistentRuleId).HasPrincipalKey(u => u.SourceSubjectVisitId); + + + modelBuilder.Entity().HasMany(t => t.ChildList).WithOne(t => t.Parent); modelBuilder.Entity().HasMany(t => t.EarlierSubjectUserList).WithOne(t => t.OrignalSubjectUser); if (_userInfo.IsEn_Us) diff --git a/IRaCIS.Core.Infrastructure/Extention/IEnumerableExtensions.cs b/IRaCIS.Core.Infrastructure/Extention/IEnumerableExtensions.cs index 735378a37..f96f34c13 100644 --- a/IRaCIS.Core.Infrastructure/Extention/IEnumerableExtensions.cs +++ b/IRaCIS.Core.Infrastructure/Extention/IEnumerableExtensions.cs @@ -11,19 +11,19 @@ namespace IRaCIS.Core.Infrastructure.Extention public static partial class IEnumerableExtensions { - /// - /// 按字段去重 - /// - /// - /// - /// - /// - /// - public static IEnumerable DistinctBy(this IEnumerable source, Func keySelector) - { - var hash = new HashSet(); - return source.Where(p => hash.Add(keySelector(p))); - } + ///// + ///// 按字段去重 + ///// + ///// + ///// + ///// + ///// + ///// + //public static IEnumerable DistinctBy(this IEnumerable source, Func keySelector) + //{ + // var hash = new HashSet(); + // return source.Where(p => hash.Add(keySelector(p))); + //} ///