修改命名空间
This commit is contained in:
@@ -46,8 +46,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
//系统 Subject数
|
||||
public int? TotalSubjectCount { get; set; }
|
||||
|
||||
|
||||
|
||||
//已分配但是未处理的任务量
|
||||
public int? SelfUndoTaskCount { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -304,6 +304,14 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
}
|
||||
|
||||
|
||||
public class ApplySubjectCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public List<Guid> SubjectIdList { get; set; } = new List<Guid>();
|
||||
}
|
||||
|
||||
|
||||
public class AssignConfirmCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
@@ -46,6 +46,18 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取应用Subject后 医生比率情况
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<TaskAllocationRuleView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
|
||||
{
|
||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId)
|
||||
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList });
|
||||
|
||||
return await taskAllocationRuleQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
|
||||
|
||||
@@ -144,8 +144,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
throw new BusinessValidationFailedException("请确认是否改了配置,或者手动分配时,只分配了一个Arm ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -235,7 +235,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IR 已阅片任务
|
||||
/// </summary>
|
||||
@@ -269,8 +268,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取IR 重阅影像阅片列表
|
||||
/// </summary>
|
||||
@@ -466,6 +463,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自动一次性分配所有未分配的 Subject 给医生
|
||||
/// </summary>
|
||||
|
||||
@@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -11,6 +12,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
public AllocationConfig()
|
||||
{
|
||||
|
||||
List<Guid> subjectIdList=new List<Guid> ();
|
||||
|
||||
CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
|
||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
@@ -18,21 +21,26 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
|
||||
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
||||
.ForMember(o => o.TotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count()))
|
||||
.ForMember(o => o.ApplyedTotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t=>t.DoctorUserId != null)))
|
||||
//.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => u.Trial.SubjectList.Where(c => c.SubjectDoctorList.Any(d => d.DoctorUserId == u.DoctorUserId))
|
||||
// .SelectMany(t=>t.SubjectVisitTaskList.Where(t=>t.DoctorUserId==null)).Count()))
|
||||
|
||||
.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId)
|
||||
.SelectMany(t => t.SubjectArmVisitTaskList.Where(t => t.DoctorUserId == null)).Count()))
|
||||
|
||||
.ForMember(o => o.ApplyedTotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId != null)))
|
||||
.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => subjectIdList.Count==0? u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId)
|
||||
.SelectMany(t => t.SubjectArmVisitTaskList.Where(t => t.DoctorUserId == null)).Count():
|
||||
u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId && subjectIdList.Contains(d.SubjectId))
|
||||
.SelectMany(t => t.SubjectArmVisitTaskList.Where(t => t.DoctorUserId == null)).Count()
|
||||
))
|
||||
|
||||
.ForMember(o => o.SelfUndoTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId && t.ReadingTaskState != ReadingTaskState.HaveSigned)))
|
||||
.ForMember(o => o.SelfTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId)))
|
||||
.ForMember(o => o.TotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count()))
|
||||
.ForMember(o => o.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c=>c.SubjectDoctorList.Any(d=>d.DoctorUserId==u.DoctorUserId))))
|
||||
.ForMember(o => o.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c => c.SubjectVisitTaskList.Any(d => d.DoctorUserId !=null))))
|
||||
.ForMember(o => o.SelfSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId).Count()));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CreateMap<TaskAllocationRule, AllocateInfo>()
|
||||
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
||||
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
||||
.ForMember(o => o.TotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count()))
|
||||
|
||||
.ForMember(o => o.SelfTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId)));
|
||||
@@ -60,7 +68,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
||||
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
|
||||
|
||||
|
||||
.ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList));
|
||||
|
||||
CreateMap<VisitTask, ReadingTaskView>()
|
||||
@@ -74,7 +82,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<VisitTask, ReReadingTaskView>()
|
||||
.ForMember(o => o.ReReadingOriginalTaskCode, t => t.MapFrom(u => u.OriginalReReadingTask.TaskCode))
|
||||
|
||||
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
@@ -88,7 +96,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -105,12 +113,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Code))
|
||||
.ForMember(o => o.IsAssignedDoctorUser, t => t.MapFrom(u => u.SubjectDoctorList.Any()))
|
||||
|
||||
|
||||
.ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.OrderBy(t=>t.ArmEnum)));
|
||||
|
||||
|
||||
.ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.OrderBy(t => t.ArmEnum)));
|
||||
|
||||
CreateMap<SubjectUser, AssignDoctorView>()
|
||||
//.ForMember(o => o.AssignTime, t => t.MapFrom(u => u.AssignTime))
|
||||
//.ForMember(o => o.AssignTime, t => t.MapFrom(u => u.AssignTime))
|
||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
||||
|
||||
Reference in New Issue
Block a user