Uat_Study
hang 2022-09-27 16:21:39 +08:00
parent c3f33a2812
commit 0cffb8daf2
7 changed files with 60 additions and 27 deletions

View File

@ -8425,6 +8425,13 @@
<param name="inDto"></param> <param name="inDto"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.UpdateTrialReviewerState(IRaCIS.Application.Contracts.SetEnrollEnableCommand)">
<summary>
修改项目医生启用禁用状态
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.UpdateReviewerReadingType(System.Guid,System.Guid,System.Int32)"> <member name="M:IRaCIS.Application.Services.DoctorWorkloadService.UpdateReviewerReadingType(System.Guid,System.Guid,System.Int32)">
<summary> <summary>
0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判

View File

@ -108,10 +108,10 @@ namespace IRaCIS.Application.Services
var query = _tumorAssessmentRepository var query = _tumorAssessmentRepository
.Where(x => x.CriterionId == inQuery.CriterionId) .Where(x => x.CriterionId == inQuery.CriterionId)
.WhereIf(inQuery.OverallEfficacy != null, x => x.OverallEfficacy == inQuery.OverallEfficacy) .WhereIf(inQuery.OverallEfficacy != null, x => x.OverallEfficacy == inQuery.OverallEfficacy)
.WhereIf(inQuery.TargetLesion != null, x => x.TargetLesion == inQuery.TargetLesion) .WhereIf(inQuery.TargetLesion != null, x => x.TargetLesion == inQuery.TargetLesion)
.WhereIf(inQuery.NonTargetLesions != null, x => x.NonTargetLesions == inQuery.NonTargetLesions) .WhereIf(inQuery.NonTargetLesions != null, x => x.NonTargetLesions == inQuery.NonTargetLesions)
.WhereIf(inQuery.NewLesion != null, x => x.NewLesion == inQuery.NewLesion) .WhereIf(inQuery.NewLesion != null, x => x.NewLesion == inQuery.NewLesion)
.ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider); .ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc); return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
} }

View File

@ -150,6 +150,20 @@ namespace IRaCIS.Application.Contracts
public List<ReadingCategory> ReadingCategorys { get; set; } public List<ReadingCategory> ReadingCategorys { get; set; }
} }
public class SetEnrollEnableCommand
{
[NotDefault]
public Guid EnrollId { get; set; }
public Guid TrialId { get; set; }
public bool IsEnable { get; set; }
}
public class WorkLoadDoctorQueryDTO : PageInput public class WorkLoadDoctorQueryDTO : PageInput
{ {
public Guid TrialId { get; set; } = Guid.Empty; public Guid TrialId { get; set; } = Guid.Empty;
@ -228,6 +242,8 @@ namespace IRaCIS.Application.Contracts
public class WorkLoadAndAgreementDTO : WorkLoadAndTrainingDTO public class WorkLoadAndAgreementDTO : WorkLoadAndTrainingDTO
{ {
public bool IsEnable { get; set; }
public Guid EnrollId { get; set; } public Guid EnrollId { get; set; }
public DateTime? OutEnrollTime { get; set; } public DateTime? OutEnrollTime { get; set; }
public Guid AgreementId { get; set; } public Guid AgreementId { get; set; }

View File

@ -23,7 +23,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<TrialRevenuesPrice> _trialRevenuesPriceRepository; private readonly IRepository<TrialRevenuesPrice> _trialRevenuesPriceRepository;
private readonly IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository; private readonly IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository;
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
public DoctorWorkloadService(IRepository<Trial> clinicalTrialProjectRepository, public DoctorWorkloadService(IRepository<Trial> clinicalTrialProjectRepository,
IRepository<Enroll> intoGroupRepository, IRepository<Enroll> intoGroupRepository,
IRepository<Doctor> doctorInfoRepository, IRepository<Doctor> doctorInfoRepository,
@ -32,9 +32,11 @@ namespace IRaCIS.Application.Services
IRepository<Attachment> attachmentRepository, IRepository<Attachment> attachmentRepository,
IRepository<Payment> costStatisticsRepository, IRepository<Payment> costStatisticsRepository,
IRepository<TrialRevenuesPrice> trialRevenuesPriceRepository, IRepository<TrialRevenuesPrice> trialRevenuesPriceRepository,
IRepository<TaskAllocationRule> taskAllocationRuleRepository,
IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository, IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository,
IMapper mapper) IMapper mapper)
{ {
_taskAllocationRuleRepository = taskAllocationRuleRepository;
_trialRepository = clinicalTrialProjectRepository; _trialRepository = clinicalTrialProjectRepository;
_enrollRepository = intoGroupRepository; _enrollRepository = intoGroupRepository;
_doctorRepository = doctorInfoRepository; _doctorRepository = doctorInfoRepository;
@ -70,7 +72,7 @@ namespace IRaCIS.Application.Services
var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel); var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel);
//intoGroupItem.AttachmentId = attachment.Id; //intoGroupItem.AttachmentId = attachment.Id;
await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id,u=>new Enroll(){AttachmentId = attachment.Id}); await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id, u => new Enroll() { AttachmentId = attachment.Id });
var success = await _enrollRepository.SaveChangesAsync(); var success = await _enrollRepository.SaveChangesAsync();
@ -88,12 +90,12 @@ namespace IRaCIS.Application.Services
public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId) public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId)
{ {
var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId); var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId);
await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u => await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
new Enroll() new Enroll()
{ {
AttachmentId = Guid.Empty AttachmentId = Guid.Empty
},true); }, true);
return ResponseOutput.Ok(success1 ); return ResponseOutput.Ok(success1);
} }
/// <summary> /// <summary>
@ -105,15 +107,15 @@ namespace IRaCIS.Application.Services
public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto) public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto)
{ {
var enroll = await _enrollRepository.FirstAsync(t => t.Id == inDto.EnrollId); var enroll = await _enrollRepository.FirstAsync(t => t.Id == inDto.EnrollId);
if (_repository.Where<VisitTask>(t=>t.TrialId==enroll.TrialId && t.DoctorUserId==enroll.DoctorUserId && t.TaskAllocationState==TaskAllocationState.Allocated).Any()) if (_repository.Where<VisitTask>(t => t.TrialId == enroll.TrialId && t.DoctorUserId == enroll.DoctorUserId && t.TaskAllocationState == TaskAllocationState.Allocated).Any())
{ {
var readingCategoryList = await _enrollReadingCategoryRepository.Where(t => t.EnrollId == inDto.EnrollId).Select(t => t.ReadingCategory).ToListAsync(); var readingCategoryList = await _enrollReadingCategoryRepository.Where(t => t.EnrollId == inDto.EnrollId).Select(t => t.ReadingCategory).ToListAsync();
if(readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0) if (readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0)
{ {
return ResponseOutput.NotOk("已分配任务,不允许减少阅片类型"); return ResponseOutput.NotOk("已分配任务,不允许减少阅片类型");
@ -147,6 +149,19 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(result); return ResponseOutput.Ok(result);
} }
/// <summary>
/// 修改项目医生启用禁用状态
/// </summary>
/// <param name="inCommand"></param>
/// <returns></returns>
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> UpdateTrialReviewerState(SetEnrollEnableCommand inCommand)
{
await _taskAllocationRuleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == inCommand.TrialId && t.EnrollId == inCommand.EnrollId, u => new TaskAllocationRule() { IsEnable = inCommand.IsEnable },true);
return ResponseOutput.Ok();
}
/// <summary> /// <summary>
/// 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判 /// 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判
@ -178,6 +193,7 @@ namespace IRaCIS.Application.Services
var doctorIntoGroupQueryable = var doctorIntoGroupQueryable =
from intoGroup in _enrollRepository.Where(x => x.TrialId == trialId && x.EnrollStatus >= EnrollStatus.ConfirmIntoGroup) from intoGroup in _enrollRepository.Where(x => x.TrialId == trialId && x.EnrollStatus >= EnrollStatus.ConfirmIntoGroup)
join allocateRule in _taskAllocationRuleRepository.AsQueryable() on intoGroup.Id equals allocateRule.EnrollId
join doctor in _doctorRepository.AsQueryable() on intoGroup.DoctorId equals doctor.Id join doctor in _doctorRepository.AsQueryable() on intoGroup.DoctorId equals doctor.Id
join attachmentItem in _attachmentRepository.AsQueryable() on intoGroup.AttachmentId equals attachmentItem.Id into cc join attachmentItem in _attachmentRepository.AsQueryable() on intoGroup.AttachmentId equals attachmentItem.Id into cc
from attachment in cc.DefaultIfEmpty() from attachment in cc.DefaultIfEmpty()
@ -203,13 +219,15 @@ namespace IRaCIS.Application.Services
select new WorkLoadAndAgreementDTO() select new WorkLoadAndAgreementDTO()
{ {
EnrollId= intoGroup.Id, EnrollId = intoGroup.Id,
ReadingCategorys = intoGroup.EnrollReadingCategoryList.Select(x=>x.ReadingCategory).OrderBy(x=>x).ToList(), IsEnable = allocateRule.IsEnable,
ReadingCategorys = intoGroup.EnrollReadingCategoryList.Select(x => x.ReadingCategory).OrderBy(x => x).ToList(),
DoctorId = doctor.Id, DoctorId = doctor.Id,
Code = doctor.ReviewerCode, Code = doctor.ReviewerCode,
FirstName = doctor.FirstName, FirstName = doctor.FirstName,
LastName = doctor.LastName, LastName = doctor.LastName,
FullName=doctor.FullName, FullName = doctor.FullName,
ChineseName = doctor.ChineseName, ChineseName = doctor.ChineseName,

View File

@ -16,8 +16,6 @@ namespace IRaCIS.Core.Domain.Models
public class TrialSiteEquipmentSurvey : Entity, IAuditUpdate, IAuditAdd public class TrialSiteEquipmentSurvey : Entity, IAuditUpdate, IAuditAdd
{ {
[ForeignKey("TrialSiteSurveyId")] [ForeignKey("TrialSiteSurveyId")]
public TrialSiteSurvey TrialSiteSurvey { get; set; } public TrialSiteSurvey TrialSiteSurvey { get; set; }

View File

@ -15,10 +15,7 @@ namespace IRaCIS.Core.Domain.Models
///</summary> ///</summary>
[Table("TrialSiteSurvey")] [Table("TrialSiteSurvey")]
public class TrialSiteSurvey : Entity, IAuditUpdate, IAuditAdd,ISoftDelete public class TrialSiteSurvey : Entity, IAuditUpdate, IAuditAdd,ISoftDelete
{ {
//public bool IsLocked { get; set; }=false;
public TrialSiteSurveyEnum State { get; set; } = TrialSiteSurveyEnum.ToSubmit; public TrialSiteSurveyEnum State { get; set; } = TrialSiteSurveyEnum.ToSubmit;

View File

@ -21,9 +21,6 @@ namespace IRaCIS.Core.Domain.Models
public Guid TrialSiteSurveyId { get; set; } public Guid TrialSiteSurveyId { get; set; }
[ForeignKey("UserTypeId")] [ForeignKey("UserTypeId")]
public UserType UserTypeRole { get; set; } public UserType UserTypeRole { get; set; }