修改退回逻辑
							parent
							
								
									ed3d18b168
								
							
						
					
					
						commit
						66af10f522
					
				| 
						 | 
					@ -585,8 +585,9 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                            TrialId = trialId,
 | 
					                                            TrialId = trialId,
 | 
				
			||||||
                                            SubjectId = subjectVisit.SubjectId,
 | 
					                                            SubjectId = subjectVisit.SubjectId,
 | 
				
			||||||
                                            IsUrgent = subjectVisit.IsUrgent,
 | 
					 | 
				
			||||||
                                            TaskBlindName = blindTaskName,
 | 
					                                            TaskBlindName = blindTaskName,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                            IsUrgent = subjectVisit.IsUrgent,
 | 
				
			||||||
                                            TaskUrgentType = taskUrgentType,
 | 
					                                            TaskUrgentType = taskUrgentType,
 | 
				
			||||||
                                            IsCanEditUrgentState = isCanEditUrgentState,
 | 
					                                            IsCanEditUrgentState = isCanEditUrgentState,
 | 
				
			||||||
                                            TaskName = subjectVisit.VisitName,
 | 
					                                            TaskName = subjectVisit.VisitName,
 | 
				
			||||||
| 
						 | 
					@ -611,9 +612,10 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                            TrialId = trialId,
 | 
					                                            TrialId = trialId,
 | 
				
			||||||
                                            SubjectId = subjectVisit.SubjectId,
 | 
					                                            SubjectId = subjectVisit.SubjectId,
 | 
				
			||||||
                                            IsUrgent = subjectVisit.IsUrgent,
 | 
					 | 
				
			||||||
                                            TaskBlindName = blindTaskName,
 | 
					                                            TaskBlindName = blindTaskName,
 | 
				
			||||||
                                            TaskName = subjectVisit.VisitName,
 | 
					                                            TaskName = subjectVisit.VisitName,
 | 
				
			||||||
 | 
					                                            IsUrgent = subjectVisit.IsUrgent,
 | 
				
			||||||
 | 
					                     
 | 
				
			||||||
                                            TaskUrgentType = taskUrgentType,
 | 
					                                            TaskUrgentType = taskUrgentType,
 | 
				
			||||||
                                            IsCanEditUrgentState = isCanEditUrgentState,
 | 
					                                            IsCanEditUrgentState = isCanEditUrgentState,
 | 
				
			||||||
                                            VisitTaskNum = subjectVisit.VisitNum,
 | 
					                                            VisitTaskNum = subjectVisit.VisitNum,
 | 
				
			||||||
| 
						 | 
					@ -716,6 +718,32 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                                        //每个访视去判断  是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
 | 
					                                                        //每个访视去判断  是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
 | 
				
			||||||
                                                        foreach (var visitGroup in followVisitGroup)
 | 
					                                                        foreach (var visitGroup in followVisitGroup)
 | 
				
			||||||
                                                        {
 | 
					                                                        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                                            var visit = await _subjectVisitRepository.Where(x => x.Id == visitGroup.First().SourceSubjectVisitId).Select(x => new
 | 
				
			||||||
 | 
					                                                            {
 | 
				
			||||||
 | 
					                                                                x.PDState,
 | 
				
			||||||
 | 
					                                                                x.IsEnrollmentConfirm,
 | 
				
			||||||
 | 
					                                                                x.IsUrgent,
 | 
				
			||||||
 | 
					                                                            }).FirstNotNullAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                                            TaskUrgentType? urgentType = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                                            if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
 | 
				
			||||||
 | 
					                                                            {
 | 
				
			||||||
 | 
					                                                                urgentType = TaskUrgentType.PDProgress;
 | 
				
			||||||
 | 
					                                                            }
 | 
				
			||||||
 | 
					                                                            else if (subjectVisitInfo.IsEnrollmentConfirm)
 | 
				
			||||||
 | 
					                                                            {
 | 
				
			||||||
 | 
					                                                                urgentType = TaskUrgentType.EnrollmentConfirm;
 | 
				
			||||||
 | 
					                                                            }
 | 
				
			||||||
 | 
					                                                            else if (subjectVisitInfo.IsUrgent)
 | 
				
			||||||
 | 
					                                                            {
 | 
				
			||||||
 | 
					                                                                urgentType = TaskUrgentType.VisitUrgent;
 | 
				
			||||||
 | 
					                                                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                                            bool isCanEdit = urgentType == TaskUrgentType.EnrollmentConfirm || urgentType == TaskUrgentType.PDProgress ? false : true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                                            //如果后续访视已分配有效 就不用处理
 | 
					                                                            //如果后续访视已分配有效 就不用处理
 | 
				
			||||||
                                                            if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
 | 
					                                                            if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
 | 
				
			||||||
                                                            {
 | 
					                                                            {
 | 
				
			||||||
| 
						 | 
					@ -731,6 +759,9 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                                                    //有可能仅仅只分配了一个Subject   未分配  那么
 | 
					                                                                    //有可能仅仅只分配了一个Subject   未分配  那么
 | 
				
			||||||
                                                                    if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
 | 
					                                                                    if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
 | 
				
			||||||
                                                                    {
 | 
					                                                                    {
 | 
				
			||||||
 | 
					                                                                        arm1.IsUrgent = visit.IsUrgent;
 | 
				
			||||||
 | 
					                                                                        arm1.TaskUrgentType = urgentType;
 | 
				
			||||||
 | 
					                                                                        arm1.IsCanEditUrgentState = isCanEdit;
 | 
				
			||||||
                                                                        arm1.TaskAllocationState = TaskAllocationState.Allocated;
 | 
					                                                                        arm1.TaskAllocationState = TaskAllocationState.Allocated;
 | 
				
			||||||
                                                                        arm1.AllocateTime = DateTime.Now;
 | 
					                                                                        arm1.AllocateTime = DateTime.Now;
 | 
				
			||||||
                                                                        arm1.DoctorUserId = task1.DoctorUserId;
 | 
					                                                                        arm1.DoctorUserId = task1.DoctorUserId;
 | 
				
			||||||
| 
						 | 
					@ -742,11 +773,16 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                                                {
 | 
					                                                                {
 | 
				
			||||||
                                                                    var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
 | 
					                                                                    var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                                                  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                                                    var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
 | 
					                                                                    var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
 | 
				
			||||||
                                                                    {
 | 
					                                                                    {
 | 
				
			||||||
                                                                        TrialId = trialId,
 | 
					                                                                        TrialId = trialId,
 | 
				
			||||||
                                                                        SubjectId = subjectVisit.SubjectId,
 | 
					                                                                        SubjectId = subjectVisit.SubjectId,
 | 
				
			||||||
                                                                        IsUrgent = subjectVisit.IsUrgent,
 | 
					                                                                        IsUrgent = visit.IsUrgent,
 | 
				
			||||||
 | 
					                                                                        TaskUrgentType = urgentType,
 | 
				
			||||||
 | 
					                                                                        IsCanEditUrgentState = isCanEdit,
 | 
				
			||||||
                                                                        ArmEnum = Arm.DoubleReadingArm1,//特殊
 | 
					                                                                        ArmEnum = Arm.DoubleReadingArm1,//特殊
 | 
				
			||||||
                                                                        Code = currentMaxCodeInt + 1,
 | 
					                                                                        Code = currentMaxCodeInt + 1,
 | 
				
			||||||
                                                                        TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
 | 
					                                                                        TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
 | 
				
			||||||
| 
						 | 
					@ -790,6 +826,9 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                                                    //有可能仅仅只分配了一个Subject
 | 
					                                                                    //有可能仅仅只分配了一个Subject
 | 
				
			||||||
                                                                    if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
 | 
					                                                                    if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
 | 
				
			||||||
                                                                    {
 | 
					                                                                    {
 | 
				
			||||||
 | 
					                                                                        arm2.IsUrgent = visit.IsUrgent;
 | 
				
			||||||
 | 
					                                                                        arm2.TaskUrgentType = urgentType;
 | 
				
			||||||
 | 
					                                                                        arm2.IsCanEditUrgentState = isCanEdit;
 | 
				
			||||||
                                                                        arm2.TaskAllocationState = TaskAllocationState.Allocated;
 | 
					                                                                        arm2.TaskAllocationState = TaskAllocationState.Allocated;
 | 
				
			||||||
                                                                        arm2.AllocateTime = DateTime.Now;
 | 
					                                                                        arm2.AllocateTime = DateTime.Now;
 | 
				
			||||||
                                                                        arm2.DoctorUserId = task2.DoctorUserId;
 | 
					                                                                        arm2.DoctorUserId = task2.DoctorUserId;
 | 
				
			||||||
| 
						 | 
					@ -805,7 +844,9 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                                                    {
 | 
					                                                                    {
 | 
				
			||||||
                                                                        TrialId = trialId,
 | 
					                                                                        TrialId = trialId,
 | 
				
			||||||
                                                                        SubjectId = subjectVisit.SubjectId,
 | 
					                                                                        SubjectId = subjectVisit.SubjectId,
 | 
				
			||||||
                                                                        IsUrgent = subjectVisit.IsUrgent,
 | 
					                                                                        IsUrgent = visit.IsUrgent,
 | 
				
			||||||
 | 
					                                                                        TaskUrgentType = urgentType,
 | 
				
			||||||
 | 
					                                                                        IsCanEditUrgentState = isCanEdit,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                                                        //CheckPassedTime = subjectVisit.CheckPassedTime,
 | 
					                                                                        //CheckPassedTime = subjectVisit.CheckPassedTime,
 | 
				
			||||||
                                                                        ArmEnum = Arm.DoubleReadingArm2,//特殊
 | 
					                                                                        ArmEnum = Arm.DoubleReadingArm2,//特殊
 | 
				
			||||||
| 
						 | 
					@ -823,6 +864,7 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
                                                                        IsAnalysisCreate = latestTask.IsAnalysisCreate,
 | 
					                                                                        IsAnalysisCreate = latestTask.IsAnalysisCreate,
 | 
				
			||||||
                                                                        IsSelfAnalysis = latestTask.IsSelfAnalysis,
 | 
					                                                                        IsSelfAnalysis = latestTask.IsSelfAnalysis,
 | 
				
			||||||
                                                                        TaskAllocationState = TaskAllocationState.Allocated,
 | 
					                                                                        TaskAllocationState = TaskAllocationState.Allocated,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                                                        AllocateTime = DateTime.Now,
 | 
					                                                                        AllocateTime = DateTime.Now,
 | 
				
			||||||
                                                                        DoctorUserId = task2.DoctorUserId,
 | 
					                                                                        DoctorUserId = task2.DoctorUserId,
 | 
				
			||||||
                                                                        SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
 | 
					                                                                        SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2105,7 +2105,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    #region 方式二
 | 
					                    #region 方式二
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    var origenalTask = influenceTaskList.Where(t => t.Id == task.Id).First();
 | 
					                    var origenalTask = influenceTaskList.Where(t => t.Id == task.Id).FirstOrDefault();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    foreach (var influenceTask in influenceTaskList)
 | 
					                    foreach (var influenceTask in influenceTaskList)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue