Uat_Study
hang 2022-07-14 15:28:45 +08:00
parent a032c23f5c
commit 72ae929898
3 changed files with 21 additions and 6 deletions

View File

@ -95,7 +95,7 @@
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.TaskConsistentRuleService.GetIQueryableDoctorSelfConsistentSubjectView(IRaCIS.Core.Domain.Models.TaskConsistentRule,System.Guid,System.Collections.Generic.List{System.Guid})"> <member name="M:IRaCIS.Core.Application.Service.TaskConsistentRuleService.GetIQueryableDoctorSelfConsistentSubjectView(IRaCIS.Core.Domain.Models.TaskConsistentRule,System.Guid,System.Collections.Generic.List{System.Guid})">
<summary> <summary>
仅仅组内一致性时使用( 仅仅自身一致性时使用(
</summary> </summary>
<param name="filterObj"></param> <param name="filterObj"></param>
<param name="doctorUserId"></param> <param name="doctorUserId"></param>

View File

@ -227,7 +227,7 @@ namespace IRaCIS.Core.Application.ViewModel
{ {
public Guid? Id { get; set; } public Guid? Id { get; set; }
public bool IsEnable { get; set; } public bool IsEnable { get; set; }
public string Note { get; set; } public string Note { get; set; } = string.Empty;
public Guid TrialId { get; set; } public Guid TrialId { get; set; }
public int PlanSubjectCount { get; set; } public int PlanSubjectCount { get; set; }
public int PlanVisitCount { get; set; } public int PlanVisitCount { get; set; }

View File

@ -161,6 +161,8 @@ namespace IRaCIS.Core.Application.Service
GenerataConsistentTaskList = subject.VisitTaskList.Where(t => t.IsHaveGeneratedTask == false).ToList() GenerataConsistentTaskList = subject.VisitTaskList.Where(t => t.IsHaveGeneratedTask == false).ToList()
}); });
await _visitTaskRepository.SaveChangesAsync();
} }
} }
@ -192,7 +194,11 @@ namespace IRaCIS.Core.Application.Service
//所选访视数量 的访视 其中必有一个访视后有全局任务 //所选访视数量 的访视 其中必有一个访视后有全局任务
if (filterObj.IsHaveReadingPeriod == true) if (filterObj.IsHaveReadingPeriod == true)
{ {
visitTaskFilter = visitTaskFilter.And(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Any(u => u.VisitTaskNum == t.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] && u.ReadingCategory == ReadingCategory.Global)); //visitTaskFilter = visitTaskFilter.And(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Any(u => u.VisitTaskNum == t.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] && u.ReadingCategory == ReadingCategory.Global));
//这里的过滤条件 不能用 where(comonTaskFilter) 会报错,奇怪的问题 只能重新写一遍
visitTaskFilter = visitTaskFilter.And(c => c.Subject.SubjectVisitTaskList.Any(t => t.VisitTaskNum == c.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] && t.ReadingCategory == ReadingCategory.Global && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned &&
t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7) < DateTime.Now && (t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject)));
} }
@ -305,6 +311,11 @@ namespace IRaCIS.Core.Application.Service
var needAddDoctorUserIdList = configDoctorUserIdList.Except(subject.VisitTaskList.Select(t => (Guid)t.DoctorUserId)).ToList(); var needAddDoctorUserIdList = configDoctorUserIdList.Except(subject.VisitTaskList.Select(t => (Guid)t.DoctorUserId)).ToList();
if (needAddDoctorUserIdList.Count == 0)
{
throw new BusinessValidationFailedException("请配置一致性分析的医生");
}
foreach (var needAddDoctorUserId in needAddDoctorUserIdList) foreach (var needAddDoctorUserId in needAddDoctorUserIdList)
{ {
@ -348,6 +359,8 @@ namespace IRaCIS.Core.Application.Service
GenerataGroupConsistentTaskList = subjectAddTaskList GenerataGroupConsistentTaskList = subjectAddTaskList
}); });
await _taskConsistentRuleRepository.SaveChangesAsync();
} }
@ -360,7 +373,7 @@ namespace IRaCIS.Core.Application.Service
/// <summary> /// <summary>
/// 仅仅组内一致性时使用( /// 仅仅自身一致性时使用(
/// </summary> /// </summary>
/// <param name="filterObj"></param> /// <param name="filterObj"></param>
/// <param name="doctorUserId"></param> /// <param name="doctorUserId"></param>
@ -388,7 +401,9 @@ namespace IRaCIS.Core.Application.Service
//所选访视数量 的访视 其中必有一个访视后有全局任务 //所选访视数量 的访视 其中必有一个访视后有全局任务
if (filterObj.IsHaveReadingPeriod == true) if (filterObj.IsHaveReadingPeriod == true)
{ {
visitTaskFilter = visitTaskFilter.And(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Any(u => u.VisitTaskNum == t.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] && u.ReadingCategory == ReadingCategory.Global)); //这里的过滤条件 不能用 where(comonTaskFilter) 会报错,奇怪的问题 只能重新写一遍
visitTaskFilter = visitTaskFilter.And(c => c.Subject.SubjectVisitTaskList.Any(t => t.VisitTaskNum == c.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] &&t.ReadingCategory==ReadingCategory.Global && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned &&
t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7) < DateTime.Now && (t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject)));
} }
@ -471,7 +486,7 @@ namespace IRaCIS.Core.Application.Service
var taskConsistentRuleQueryable = from enroll in _repository.Where<Enroll>(t => t.TrialId == trialId) var taskConsistentRuleQueryable = from enroll in _repository.Where<Enroll>(t => t.TrialId == trialId)
join user in _repository.Where<User>() on enroll.DoctorId equals user.DoctorId join user in _repository.Where<User>() on enroll.DoctorId equals user.DoctorId
join taskConsistentRule in _repository.Where<TaskConsistentRule>(t => t.TrialId == trialId) on enroll.TrialId equals taskConsistentRule.TrialId join taskConsistentRule in _repository.Where<TaskConsistentRule>(t => t.TrialId == trialId && t.IsSelfAnalysis) on enroll.TrialId equals taskConsistentRule.TrialId
select new TaskConsistentRuleView() select new TaskConsistentRuleView()
{ {
Id = taskConsistentRule.Id, Id = taskConsistentRule.Id,