增加项目任务配置
parent
e26ee1d14a
commit
f3b21e4cd4
|
@ -2465,6 +2465,13 @@
|
|||
<param name="trialConfig"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.ConfigTrialTaskInfo(IRaCIS.Core.Application.Contracts.TrialTaskConfig)">
|
||||
<summary>
|
||||
配置项目任务信息
|
||||
</summary>
|
||||
<param name="trialConfig"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Triggers.AddVisitPlanTrigger">
|
||||
<summary>
|
||||
添加访视计划 要给改项目下的所有Subject 添加该访视
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
|||
{
|
||||
|
||||
|
||||
Task<List<TaskAllocationRuleView>> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule);
|
||||
//Task<List<TaskAllocationRuleView>> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule);
|
||||
|
||||
Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule);
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ using IRaCIS.Core.Domain.Models;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -20,22 +22,31 @@ namespace IRaCIS.Core.Application.Service
|
|||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
private readonly IRepository<User> _userRepository;
|
||||
|
||||
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository)
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
|
||||
|
||||
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository, IRepository<Trial> trialRepository)
|
||||
{
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_userRepository = userRepository;
|
||||
_trialRepository= trialRepository;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<List<TaskAllocationRuleView>> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
||||
public async Task<(List<TaskAllocationRuleView>,object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
||||
{
|
||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t=>t.TrialId== queryTaskAllocationRule.TrialId)
|
||||
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await taskAllocationRuleQueryable.ToListAsync();
|
||||
|
||||
var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfig>(_mapper.ConfigurationProvider);
|
||||
return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
|
||||
{
|
||||
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
|
||||
|
|
|
@ -49,6 +49,16 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 给医生用户 分配任务
|
||||
///// </summary>
|
||||
///// <param name="queryVisitTaskId"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<IResponseOutput> AllocateDoctorUserTask(string queryVisitTaskId)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,6 +121,15 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
|
||||
public class TrialTaskConfig
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public TaskAllocateObj TaskAllocateObjEnum { get; set; }
|
||||
|
||||
public TaskAllocateDefaultState TaskAllocateDefaultState { get; set; }
|
||||
}
|
||||
|
||||
public class TrialUrgentConfig
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
|
@ -348,6 +348,20 @@ namespace IRaCIS.Core.Application
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 配置项目任务信息
|
||||
/// </summary>
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> ConfigTrialTaskInfo(TrialTaskConfig trialConfig)
|
||||
{
|
||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
||||
|
||||
_mapper.Map(trialConfig, trialInfo);
|
||||
|
||||
return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
//CreateMap<TrialAttachmentCommand, TrialAttachment>().ForMember(t => t.UserTypes, u => u.MapFrom(k => string.Join(',', k.UserTypeList)));
|
||||
|
||||
|
||||
|
||||
|
||||
CreateMap<TrialTaskConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap();
|
||||
|
||||
CreateMap<UserTrialCommand, TrialUser>();
|
||||
|
||||
CreateMap<TrialSiteCommand, TrialSite>()
|
||||
|
|
|
@ -19,9 +19,31 @@ namespace IRaCIS.Core.Domain.Share
|
|||
//未分配
|
||||
NotAllocate = 0,
|
||||
|
||||
|
||||
|
||||
|
||||
//已分配
|
||||
Allocated = 2,
|
||||
}
|
||||
|
||||
|
||||
public enum TaskAllocateObj
|
||||
{
|
||||
Subject=0,
|
||||
|
||||
SubjectVisit=1
|
||||
}
|
||||
|
||||
public enum TaskAllocateDefaultState
|
||||
{
|
||||
//默认值 看是否需要项目初始化时就给默认值
|
||||
None =0,
|
||||
|
||||
//预分配
|
||||
InitAllocated = 1,
|
||||
|
||||
//已分配
|
||||
Allocated = 2,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -314,6 +314,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid? DeleteUserId { get; set; }
|
||||
|
||||
|
||||
public TaskAllocateObj TaskAllocateObjEnum { get; set; }
|
||||
|
||||
public TaskAllocateDefaultState TaskAllocateDefaultState { get; set; }
|
||||
|
||||
|
||||
//public Guid? ReviewTypeId { get; set; } = Guid.Empty;
|
||||
|
||||
//[ForeignKey("ReviewTypeId")]
|
||||
|
|
Loading…
Reference in New Issue