修改命名空间

This commit is contained in:
2022-06-17 13:19:13 +08:00
parent a68360a07c
commit d8a379dd55
45 changed files with 146 additions and 60 deletions
@@ -46,8 +46,8 @@ namespace IRaCIS.Core.Application.ViewModel
//系统 Subject数
public int? TotalSubjectCount { get; set; }
//已分配但是未处理的任务量
public int? SelfUndoTaskCount { get; set; }
}
@@ -304,6 +304,14 @@ namespace IRaCIS.Core.Application.ViewModel
}
public class ApplySubjectCommand
{
public Guid TrialId { get; set; }
public List<Guid> SubjectIdList { get; set; } = new List<Guid>();
}
public class AssignConfirmCommand
{
public Guid TrialId { get; set; }
@@ -46,6 +46,18 @@ namespace IRaCIS.Core.Application.Service
}
/// <summary>
/// 获取应用Subject后 医生比率情况
/// </summary>
/// <returns></returns>
public async Task<List<TaskAllocationRuleView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
{
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId)
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList });
return await taskAllocationRuleQueryable.ToListAsync();
}
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
@@ -144,8 +144,6 @@ namespace IRaCIS.Core.Application.Service
throw new BusinessValidationFailedException("请确认是否改了配置,或者手动分配时,只分配了一个Arm ");
}
}
#endregion
@@ -235,7 +235,6 @@ namespace IRaCIS.Core.Application.Service
}
/// <summary>
/// IR 已阅片任务
/// </summary>
@@ -269,8 +268,6 @@ namespace IRaCIS.Core.Application.Service
}
/// <summary>
/// 获取IR 重阅影像阅片列表
/// </summary>
@@ -466,6 +463,9 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.Ok();
}
/// <summary>
/// 自动一次性分配所有未分配的 Subject 给医生
/// </summary>
@@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Application.Service
{
@@ -11,6 +12,8 @@ namespace IRaCIS.Core.Application.Service
public AllocationConfig()
{
List<Guid> subjectIdList=new List<Guid> ();
CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
@@ -18,21 +21,26 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
.ForMember(o => o.TotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count()))
.ForMember(o => o.ApplyedTotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t=>t.DoctorUserId != null)))
//.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => u.Trial.SubjectList.Where(c => c.SubjectDoctorList.Any(d => d.DoctorUserId == u.DoctorUserId))
// .SelectMany(t=>t.SubjectVisitTaskList.Where(t=>t.DoctorUserId==null)).Count()))
.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId)
.SelectMany(t => t.SubjectArmVisitTaskList.Where(t => t.DoctorUserId == null)).Count()))
.ForMember(o => o.ApplyedTotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId != null)))
.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => subjectIdList.Count==0? u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId)
.SelectMany(t => t.SubjectArmVisitTaskList.Where(t => t.DoctorUserId == null)).Count():
u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId && subjectIdList.Contains(d.SubjectId))
.SelectMany(t => t.SubjectArmVisitTaskList.Where(t => t.DoctorUserId == null)).Count()
))
.ForMember(o => o.SelfUndoTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId && t.ReadingTaskState != ReadingTaskState.HaveSigned)))
.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.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c=>c.SubjectDoctorList.Any(d=>d.DoctorUserId==u.DoctorUserId))))
.ForMember(o => o.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c => c.SubjectVisitTaskList.Any(d => d.DoctorUserId !=null))))
.ForMember(o => o.SelfSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId).Count()));
CreateMap<TaskAllocationRule, AllocateInfo>()
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
.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)));
@@ -60,7 +68,7 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
.ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList));
CreateMap<VisitTask, ReadingTaskView>()
@@ -74,7 +82,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap<VisitTask, ReReadingTaskView>()
.ForMember(o => o.ReReadingOriginalTaskCode, t => t.MapFrom(u => u.OriginalReReadingTask.TaskCode))
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
@@ -88,7 +96,7 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
;
@@ -105,12 +113,12 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.TrialSite.TrialSiteCode))
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Code))
.ForMember(o => o.IsAssignedDoctorUser, t => t.MapFrom(u => u.SubjectDoctorList.Any()))
.ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.OrderBy(t=>t.ArmEnum)));
.ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.OrderBy(t => t.ArmEnum)));
CreateMap<SubjectUser, AssignDoctorView>()
//.ForMember(o => o.AssignTime, t => t.MapFrom(u => u.AssignTime))
//.ForMember(o => o.AssignTime, t => t.MapFrom(u => u.AssignTime))
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
@@ -3,7 +3,7 @@
// 生成时间 2021-11-22 11:27:53
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Application.Contracts
{
@@ -1150,16 +1150,29 @@ namespace IRaCIS.Core.Application.Image.QA
dbSubjectVisit.SubmitState = SubmitStateEnum.Submitted;
dbSubjectVisit.SubmitTime = DateTime.Now;
//维护统一状态
dbSubjectVisit.ReadingStatus = ReadingStatusEnum.ImageQuality;
}
//不审 直接QC通过 可能一致性核查 也可能不一致性核查
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
{
dbSubjectVisit.AuditState = AuditStateEnum.QCPassed;
//维护统一状态
dbSubjectVisit.ReadingStatus = ReadingStatusEnum.ConsistencyCheck;
// 不一致性核查 就CVPassed ToForward 否则就是待核查
dbSubjectVisit.CheckState = trialConfig.IsImageConsistencyVerification ? CheckStateEnum.ToCheck : CheckStateEnum.CVPassed;
if(dbSubjectVisit.CheckState== CheckStateEnum.CVPassed)
//维护统一状态
dbSubjectVisit.ReadingStatus = trialConfig.IsImageConsistencyVerification ? ReadingStatusEnum.ConsistencyCheck: ReadingStatusEnum.TaskAllocate;
if (dbSubjectVisit.CheckState== CheckStateEnum.CVPassed)
{
dbSubjectVisit.CheckPassedTime = DateTime.Now;
}
@@ -1170,6 +1183,7 @@ namespace IRaCIS.Core.Application.Image.QA
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
{
dbSubjectVisit.AuditState = AuditStateEnum.ToAudit;
}
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
{
@@ -1229,6 +1243,10 @@ namespace IRaCIS.Core.Application.Image.QA
await VerifyIsCanQCAsync(dbSubjectVisit);
//维护统一状态
dbSubjectVisit.ReadingStatus = ReadingStatusEnum.ConsistencyCheck;
//有人QC Passed
if (auditState == AuditStateEnum.QCPassed)
{
@@ -1255,6 +1273,10 @@ namespace IRaCIS.Core.Application.Image.QA
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.Id;
dbSubjectVisit.PreliminaryAuditTime = DateTime.Now;
//维护统一状态
dbSubjectVisit.ReadingStatus = trialConfig.IsImageConsistencyVerification ? ReadingStatusEnum.ConsistencyCheck : ReadingStatusEnum.TaskAllocate;
}
else
{
@@ -1298,6 +1320,8 @@ namespace IRaCIS.Core.Application.Image.QA
dbSubjectVisit.ReviewAuditTime = DateTime.Now;
//维护统一状态
dbSubjectVisit.ReadingStatus = trialConfig.IsImageConsistencyVerification ? ReadingStatusEnum.ConsistencyCheck : ReadingStatusEnum.TaskAllocate;
}
else
@@ -1344,6 +1368,8 @@ namespace IRaCIS.Core.Application.Image.QA
}
}
dbSubjectVisit.Auditor = _userInfo.Id;
dbSubjectVisit.IsTake = false;
@@ -7,7 +7,7 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
using MassTransit;
namespace IRaCIS.Application.Services
@@ -1,4 +1,4 @@
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -1,5 +1,4 @@
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Domain.Share.Reading;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -1,4 +1,4 @@
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -1,4 +1,4 @@
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -5,7 +5,7 @@
//--------------------------------------------------------------------
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Application.Contracts
{
@@ -7,7 +7,7 @@
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Application.Contracts
{
@@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using MassTransit;
using Panda.DynamicWebApi.Attributes;
using IRaCIS.Core.Application.Contracts;
@@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using MassTransit;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
@@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using MassTransit;
using IRaCIS.Core.Application.Service.Reading;
using IRaCIS.Core.Infra.EFCore.Common;
@@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using MassTransit;
using IRaCIS.Core.Infra.EFCore.Common;
@@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
using MassTransit;
using IRaCIS.Core.Application.Service.Reading;
using IRaCIS.Core.Infra.EFCore.Common;
@@ -8,7 +8,6 @@ using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Infra.EFCore.Common;
using MassTransit;