阅片配置表
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
/// <summary> TaskAllocationRuleView 列表视图模型 </summary>
|
||||
@@ -17,24 +19,42 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
|
||||
|
||||
public int? TotalTaskCount { get; set; }
|
||||
|
||||
public int? SelfTaskCount { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary>TaskAllocationRuleQuery 列表查询参数模型</summary>
|
||||
public class TaskAllocationRuleQuery
|
||||
{
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
///<summary> TaskAllocationRuleAddOrEdit 列表查询参数模型</summary>
|
||||
public class TaskAllocationRuleAddOrEdit
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public int PlanReadingRatio { get; set; }
|
||||
public Guid DoctorId { get; set; }
|
||||
public Guid DoctorUserId { get; set; }
|
||||
public bool IsEnable { get; set; }
|
||||
public int GroupEnum { get; set; }
|
||||
public int AllocationObjectEnum { get; set; }
|
||||
public string Note { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class TrialDoctorUserSelectView
|
||||
{
|
||||
public Guid DoctorUserId { get; set; }
|
||||
|
||||
public string UserCode { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string FullName { get; set; }
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public string TaskCode { get; set; }
|
||||
public bool IsUrgent { get; set; }
|
||||
public int ArmEnum { get; set; }
|
||||
public Guid? DoctorId { get; set; }
|
||||
public Guid? DoctorUserId { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -63,13 +63,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public string TaskName { get; set; } = String.Empty;
|
||||
|
||||
public Guid? DoctorId { get; set; }
|
||||
public Guid? DoctorUserId { get; set; }
|
||||
|
||||
public ReadingCategory? ReadingCategory { get; set; }
|
||||
|
||||
public TaskState? TaskState { get; set; }
|
||||
|
||||
public DateTime? BeginAllocateDate { get; set; }
|
||||
|
||||
public DateTime? EndAllocateDate { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,19 +18,19 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
||||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
private readonly IRepository<User> _userRepository;
|
||||
|
||||
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository)
|
||||
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository)
|
||||
{
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<List<TaskAllocationRuleView>> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
||||
{
|
||||
|
||||
|
||||
var taskAllocationRuleQueryable = _repository.GetQueryable<TaskAllocationRule>()
|
||||
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider);
|
||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t=>t.TrialId== queryTaskAllocationRule.TrialId)
|
||||
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await taskAllocationRuleQueryable.ToListAsync();
|
||||
}
|
||||
@@ -38,8 +38,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
|
||||
{
|
||||
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
|
||||
{
|
||||
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId,
|
||||
VerifyMsg = "已有该医生配置,不允许继续增加"
|
||||
};
|
||||
|
||||
var entity = await _taskAllocationRuleRepository.InsertOrUpdateAsync(addOrEditTaskAllocationRule, true);
|
||||
var entity = await _taskAllocationRuleRepository.InsertOrUpdateAsync(addOrEditTaskAllocationRule, true, verifyExp1);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
@@ -55,6 +60,22 @@ namespace IRaCIS.Core.Application.Service
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目下 医生账户信息下拉
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="_enrollRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<TrialDoctorUserSelectView>> GetDoctorUserSelectList(Guid trialId,[FromServices] IRepository<Enroll> _enrollRepository)
|
||||
{
|
||||
var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId)
|
||||
join user in _userRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId
|
||||
select user;
|
||||
|
||||
return query.ProjectTo<TrialDoctorUserSelectView>(_mapper.ConfigurationProvider).ToList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +32,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorId != null, t => t.DoctorId == queryVisitTask.DoctorId)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime> queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate.Value.AddDays(1))
|
||||
.ProjectTo<VisitTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId) };
|
||||
|
||||
@@ -11,7 +11,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
public AllocationConfig()
|
||||
{
|
||||
|
||||
CreateMap<TaskAllocationRule, TaskAllocationRuleView>();
|
||||
CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
|
||||
.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)));
|
||||
|
||||
CreateMap<VisitTask, VisitTaskView>()
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
@@ -19,7 +21,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code));
|
||||
|
||||
|
||||
CreateMap<TaskAllocationRuleAddOrEdit, TaskAllocationRule>();
|
||||
|
||||
|
||||
CreateMap<User, TrialDoctorUserSelectView>()
|
||||
.ForMember(o => o.DoctorUserId, t => t.MapFrom(u => u.Id))
|
||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.FullName));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user