修复入组bug
parent
6e4788e27b
commit
839d72f05a
|
@ -130,8 +130,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
public Guid EnrollId { get; set; }
|
public Guid EnrollId { get; set; }
|
||||||
//public Guid DoctorUserId { get; set; }
|
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
public int PlanSubjectCount { get; set; }
|
public int PlanSubjectCount { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpDelete("{taskAllocationRuleId:guid}")]
|
[HttpDelete("{taskAllocationRuleId:guid}")]
|
||||||
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId)
|
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId)
|
||||||
{
|
{
|
||||||
if (await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId).AnyAsync(t => t.Enroll.DoctorTrialVisitTaskList.Any()))
|
if (await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId).AnyAsync(t => t.DoctorUser.VisitTaskList.Any()))
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
|
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.OrderBy(t => t.ReadingCategory).Select(t=>t.ReadingCategory).ToList()));
|
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.OrderBy(t => t.ReadingCategory).Select(t=>t.ReadingCategory).ToList()));
|
||||||
|
|
||||||
CreateMap<TaskAllocationRule, AssignDoctorStatView>().IncludeBase<TaskAllocationRule, TaskAllocationRuleDTO>()
|
CreateMap<TaskAllocationRule, AssignDoctorStatView>().IncludeBase<TaskAllocationRule, TaskAllocationRuleDTO>()
|
||||||
.ForMember(o => o.AssignedSubjectCount, t => t.MapFrom(u => u.Enroll.DoctorTrialVisitTaskList.Select(t=>t.SubjectId).Distinct().Count()))
|
.ForMember(o => o.AssignedSubjectCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t=>t.TrialId==u.TrialId).Select(t=>t.SubjectId).Distinct().Count()))
|
||||||
.ForMember(o => o.WaitDealTrialTaskCount, t => t.MapFrom(u => u.Enroll.DoctorTrialVisitTaskList.Where(t=>t.ReadingTaskState!=ReadingTaskState.HaveSigned && t.TaskState==TaskState.Effect).Count()))
|
.ForMember(o => o.WaitDealTrialTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.TrialId == u.TrialId).Where(t=>t.ReadingTaskState!=ReadingTaskState.HaveSigned && t.TaskState==TaskState.Effect).Count()))
|
||||||
.ForMember(o => o.WaitDealAllTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect).Count()));
|
.ForMember(o => o.WaitDealAllTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect).Count()));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public Enroll Enroll { get; set; }
|
public Enroll Enroll { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//是否是裁判医生 裁判医生单独加入
|
//是否是裁判医生 裁判医生单独加入
|
||||||
public bool IsJudgeDoctor { get; set; }
|
public bool IsJudgeDoctor { get; set; }
|
||||||
public Guid DoctorUserId { get; set; }
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public User DoctorUser { get; set; }
|
public User DoctorUser { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<VisitTask> DoctorTrialVisitTaskList { get; set; } = new List<VisitTask>();
|
//public List<VisitTask> DoctorTrialVisitTaskList { get; set; } = new List<VisitTask>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,9 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
modelBuilder.Entity<User>().HasMany(t => t.VisitTaskList).WithOne(t => t.DoctorUser).HasForeignKey(t => t.DoctorUserId);
|
modelBuilder.Entity<User>().HasMany(t => t.VisitTaskList).WithOne(t => t.DoctorUser).HasForeignKey(t => t.DoctorUserId);
|
||||||
|
|
||||||
modelBuilder.Entity<VisitTask>().HasOne(t => t.Enroll).WithMany(t => t.DoctorTrialVisitTaskList).HasForeignKey(t => new { t.DoctorUserId, t.TrialId }).HasPrincipalKey(u => new { u.DoctorUserId, u.TrialId });
|
//modelBuilder.Entity<Enroll>().HasMany(t => t.DoctorTrialVisitTaskList).WithOne(t => t.Enroll).HasForeignKey(t => new { t.DoctorUserId, t.TrialId }).HasPrincipalKey(u => new { u.DoctorUserId, u.TrialId }).IsRequired(false);
|
||||||
|
|
||||||
|
//modelBuilder.Entity<VisitTask>().HasOne(t => t.Enroll).WithMany(t => t.DoctorTrialVisitTaskList).HasForeignKey(t => new { t.DoctorUserId, t.TrialId }).IsRequired(false).HasPrincipalKey(u => new { u.DoctorUserId, u.TrialId }).IsRequired(false);
|
||||||
|
|
||||||
//modelBuilder.Entity<TaskAllocationRule>().HasMany(t => t.DoctorVisitTaskList).WithOne(t => t.DoctorTaskAllocationRule).HasForeignKey(t => new { t.DoctorUserId, t.TrialId }).HasPrincipalKey(u => new { u.DoctorUserId, u.TrialId });
|
//modelBuilder.Entity<TaskAllocationRule>().HasMany(t => t.DoctorVisitTaskList).WithOne(t => t.DoctorTaskAllocationRule).HasForeignKey(t => new { t.DoctorUserId, t.TrialId }).HasPrincipalKey(u => new { u.DoctorUserId, u.TrialId });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue