批量重新分配
parent
0d6db93e67
commit
ec193d7794
|
@ -65,7 +65,7 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.AssignSubjectDoctor(IRaCIS.Core.Application.ViewModel.AssginSubjectDoctorCommand)">
|
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.AssignSubjectDoctor(IRaCIS.Core.Application.ViewModel.AssginSubjectDoctorCommand)">
|
||||||
<summary>
|
<summary>
|
||||||
批量为 多个Subject 分配医生 手动分配
|
批量为 多个Subject 分配医生 手动分配 IsReAssign 为true 批量删除 重新分配
|
||||||
</summary>
|
</summary>
|
||||||
<param name="assginSubjectDoctorCommand"></param>
|
<param name="assginSubjectDoctorCommand"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
|
|
|
@ -133,6 +133,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public bool IsReAssign { get; set; }
|
||||||
|
|
||||||
public List<Guid> SubjectIdList { get; set; }
|
public List<Guid> SubjectIdList { get; set; }
|
||||||
|
|
||||||
public List<Guid> DoctorUserIdList { get; set; }
|
public List<Guid> DoctorUserIdList { get; set; }
|
||||||
|
|
|
@ -90,13 +90,18 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 批量为 多个Subject 分配医生 手动分配
|
/// 批量为 多个Subject 分配医生 手动分配 IsReAssign 为true 批量删除 重新分配
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assginSubjectDoctorCommand"></param>
|
/// <param name="assginSubjectDoctorCommand"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AssignSubjectDoctor(AssginSubjectDoctorCommand assginSubjectDoctorCommand)
|
public async Task<IResponseOutput> AssignSubjectDoctor(AssginSubjectDoctorCommand assginSubjectDoctorCommand)
|
||||||
{
|
{
|
||||||
|
if (assginSubjectDoctorCommand.IsReAssign)
|
||||||
|
{
|
||||||
|
await _subjectUserRepository.BatchDeleteNoTrackingAsync(t => assginSubjectDoctorCommand.DoctorUserIdList.Contains(t.DoctorUserId) && assginSubjectDoctorCommand.SubjectIdList.Contains(t.SubjectId));
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var subjectId in assginSubjectDoctorCommand.SubjectIdList)
|
foreach (var subjectId in assginSubjectDoctorCommand.SubjectIdList)
|
||||||
{
|
{
|
||||||
foreach (var doctorUserId in assginSubjectDoctorCommand.DoctorUserIdList)
|
foreach (var doctorUserId in assginSubjectDoctorCommand.DoctorUserIdList)
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(o => o.TotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count()))
|
.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)))
|
.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.TotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count()))
|
||||||
/* .ForMember(o => o.SelfSubjectCount, t => t.MapFrom(u => u.Trial.su.Where(t => t.DoctorUserId == u.DoctorUserId).Select(t=>t.SubjectId).Distinct().Count())*/;
|
.ForMember(o => o.SelfSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId).Count()));
|
||||||
|
|
||||||
CreateMap<TaskAllocationRule, AllocateInfo>()
|
CreateMap<TaskAllocationRule, AllocateInfo>()
|
||||||
.ForMember(o => o.ArmList, t => t.MapFrom(u => u.VisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
.ForMember(o => o.ArmList, t => t.MapFrom(u => u.VisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
TrialDicList = new List<TrialDictionary>();
|
TrialDicList = new List<TrialDictionary>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SubjectUser> SubjectDoctorUserList { get; set; }=new List<SubjectUser>();
|
||||||
public List<VisitTask> VisitTaskList { get; set; }=new List<VisitTask>(){ };
|
public List<VisitTask> VisitTaskList { get; set; }=new List<VisitTask>(){ };
|
||||||
|
|
||||||
public List<TrialSiteSurvey> TrialSiteSurveyList { get; set; } = new List<TrialSiteSurvey>();
|
public List<TrialSiteSurvey> TrialSiteSurveyList { get; set; } = new List<TrialSiteSurvey>();
|
||||||
|
|
Loading…
Reference in New Issue