From f3b21e4cd4c318756bd5ef600965a1fc8b0269b0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 8 Jun 2022 10:39:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 7 ++++++ .../Interface/ITaskAllocationRuleService.cs | 2 +- .../Allocation/TaskAllocationRuleService.cs | 17 +++++++++++--- .../Service/Allocation/VisitTaskService.cs | 10 +++++++++ .../TrialSiteUser/DTO/TrialConfigDTO.cs | 9 ++++++++ .../TrialSiteUser/TrialConfigService.cs | 14 ++++++++++++ .../Service/TrialSiteUser/_MapConfig.cs | 4 ++++ .../Allocation/AllocationRelation.cs | 22 +++++++++++++++++++ IRaCIS.Core.Domain/Trial/Trial.cs | 5 +++++ 9 files changed, 86 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 4c0762f30..c96da135b 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2465,6 +2465,13 @@ + + + 配置项目任务信息 + + + + 添加访视计划 要给改项目下的所有Subject 添加该访视 diff --git a/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs index a7f46ba9a..1395a4779 100644 --- a/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs @@ -14,7 +14,7 @@ namespace IRaCIS.Core.Application.Interfaces { - Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule); + //Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule); Task AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule); diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index 66016b216..4bc2e0f74 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -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 { /// @@ -20,22 +22,31 @@ namespace IRaCIS.Core.Application.Service private readonly IRepository _taskAllocationRuleRepository; private readonly IRepository _userRepository; - public TaskAllocationRuleService(IRepository taskAllocationRuleRepository, IRepository userRepository) + private readonly IRepository _trialRepository; + + + + public TaskAllocationRuleService(IRepository taskAllocationRuleRepository, IRepository userRepository, IRepository trialRepository) { _taskAllocationRuleRepository = taskAllocationRuleRepository; _userRepository = userRepository; + _trialRepository= trialRepository; } [HttpPost] - public async Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule) + public async Task<(List,object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule) { var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t=>t.TrialId== queryTaskAllocationRule.TrialId) .ProjectTo(_mapper.ConfigurationProvider); - return await taskAllocationRuleQueryable.ToListAsync(); + + var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo(_mapper.ConfigurationProvider); + return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig); } + + public async Task AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule) { var verifyExp1 = new EntityVerifyExp() diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index a96ec91a9..bb4c9c21b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -49,6 +49,16 @@ namespace IRaCIS.Core.Application.Service } + ///// + ///// 给医生用户 分配任务 + ///// + ///// + ///// + //public async Task AllocateDoctorUserTask(string queryVisitTaskId) + //{ + + //} + } } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs index 83e77a1b0..ac3e23409 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs @@ -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; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 8d38f69b9..574f42102 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -348,6 +348,20 @@ namespace IRaCIS.Core.Application } + /// + /// 配置项目任务信息 + /// + /// + /// + [HttpPut] + public async Task ConfigTrialTaskInfo(TrialTaskConfig trialConfig) + { + var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException(); + + _mapper.Map(trialConfig, trialInfo); + + return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync()); + } } } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs index c496b8727..83e98c540 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs @@ -17,6 +17,10 @@ namespace IRaCIS.Core.Application.Service //CreateMap().ForMember(t => t.UserTypes, u => u.MapFrom(k => string.Join(',', k.UserTypeList))); + + + CreateMap().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap(); + CreateMap(); CreateMap() diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs index 4c9dfa695..b389d3a25 100644 --- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs +++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs @@ -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, + } + } diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index a95cec3a8..2e0d3abfb 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -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")]