diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index f0d69eb6f..fee870b58 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -5746,6 +5746,13 @@ 删除协议 + + + 修改项目医生的阅片类型 + + + + 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判 diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs b/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs index 40f4edc13..bdb04bf82 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Application.Contracts @@ -139,7 +140,13 @@ namespace IRaCIS.Application.Contracts [Required(ErrorMessage = "需要有效的医生列表")] public List NeedCalculateReviewers { get; set; } = new List(); } + public class SetEnrollReadingCategoryInDto + { + [NotDefault] + public Guid EnrollId { get; set; } + public List ReadingCategorys { get; set; } + } public class WorkLoadDoctorQueryDTO : PageInput { public Guid TrialId { get; set; } = Guid.Empty; @@ -218,6 +225,7 @@ namespace IRaCIS.Application.Contracts public class WorkLoadAndAgreementDTO : WorkLoadAndTrainingDTO { + public Guid EnrollId { get; set; } public DateTime? OutEnrollTime { get; set; } public Guid AgreementId { get; set; } @@ -226,6 +234,9 @@ namespace IRaCIS.Application.Contracts public string? AgreementFileName => AgreementPath?.Split('/').Last(); public string AgreementFullPath => AgreementPath; + + + public List ReadingCategorys { get; set; } } diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs index 0963b20e2..26b01c343 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs @@ -17,6 +17,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _enrollRepository; private readonly IRepository _doctorRepository; private readonly IRepository _doctorWorkloadRepository; + private readonly IRepository _enrollReadingCategoryRepository; private readonly IRepository _attachmentRepository; private readonly IRepository _costStatisticsRepository; private readonly IRepository _trialRevenuesPriceRepository; @@ -27,6 +28,7 @@ namespace IRaCIS.Application.Services IRepository intoGroupRepository, IRepository doctorInfoRepository, IRepository doctorWorkloadRepository, + IRepository enrollReadingCategoryRepository, IRepository attachmentRepository, IRepository costStatisticsRepository, IRepository trialRevenuesPriceRepository, @@ -37,6 +39,7 @@ namespace IRaCIS.Application.Services _enrollRepository = intoGroupRepository; _doctorRepository = doctorInfoRepository; _doctorWorkloadRepository = doctorWorkloadRepository; + this._enrollReadingCategoryRepository = enrollReadingCategoryRepository; _attachmentRepository = attachmentRepository; _costStatisticsRepository = costStatisticsRepository; _trialRevenuesPriceRepository = trialRevenuesPriceRepository; @@ -93,6 +96,31 @@ namespace IRaCIS.Application.Services return ResponseOutput.Result(success1 && success2); } + /// + /// 修改项目医生的阅片类型 + /// + /// + /// + [TypeFilter(typeof(TrialResourceFilter))] + [Authorize(Policy = IRaCISPolicy.PM_APM)] + public async Task SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto) + { + await _enrollReadingCategoryRepository.BatchDeleteNoTrackingAsync(x => x.EnrollId == inDto.EnrollId); + + List enrollReadings = inDto.ReadingCategorys.Select(x => new EnrollReadingCategory() + { + EnrollId = inDto.EnrollId, + ReadingCategory = x + }).ToList(); + + await _enrollReadingCategoryRepository.AddRangeAsync(enrollReadings); + var result = await _enrollReadingCategoryRepository.SaveChangesAsync(); + + + return ResponseOutput.Ok(result); + } + + /// /// 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判 /// @@ -148,7 +176,8 @@ namespace IRaCIS.Application.Services select new WorkLoadAndAgreementDTO() { - + EnrollId= intoGroup.Id, + ReadingCategorys = intoGroup.EnrollReadingCategoryList.Select(x=>x.ReadingCategory).ToList(), DoctorId = doctor.Id, Code = doctor.ReviewerCode, FirstName = doctor.FirstName, diff --git a/IRaCIS.Core.Domain/Trial/Enroll.cs b/IRaCIS.Core.Domain/Trial/Enroll.cs index 7e3df6e34..765e67e73 100644 --- a/IRaCIS.Core.Domain/Trial/Enroll.cs +++ b/IRaCIS.Core.Domain/Trial/Enroll.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Core.Domain.Models @@ -56,5 +57,8 @@ namespace IRaCIS.Core.Domain.Models public int DoctorTrialState { get; set; } + + public List EnrollReadingCategoryList { get; set; } + } } diff --git a/IRaCIS.Core.Domain/Trial/EnrollReadingCategory.cs b/IRaCIS.Core.Domain/Trial/EnrollReadingCategory.cs new file mode 100644 index 000000000..5b4d47fdf --- /dev/null +++ b/IRaCIS.Core.Domain/Trial/EnrollReadingCategory.cs @@ -0,0 +1,42 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-07-08 10:43:53 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///EnrollReadingCategory + /// + [Table("EnrollReadingCategory")] + public class EnrollReadingCategory : Entity, IAuditAdd + { + /// + /// EnrollId + /// + public Guid EnrollId { get; set; } + + /// + /// ReadingCategory + /// + public ReadingCategory ReadingCategory { get; set; } + + /// + /// CreateUserId + /// + public Guid CreateUserId { get; set; } + + /// + /// CreateTime + /// + public DateTime CreateTime { get; set; } + + [ForeignKey("EnrollId")] + public Enroll Enroll { get; set; } + } + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index e13bcd97c..8507fe51e 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -184,6 +184,10 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet DoctorWorkload { get; set; } public virtual DbSet IntoGroup { get; set; } + + public virtual DbSet EnrollReadingCategory { get; set; } + + public virtual DbSet EnrollDetails { get; set; } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 78f15acbc..960756260 100644 --- a/IRaCIS.Core.Test/DbHelper.ttinclude +++ b/IRaCIS.Core.Test/DbHelper.ttinclude @@ -4,7 +4,7 @@ public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"; public static readonly string DbDatabase = "IRaCIS_New_Tet"; //ַ,ƴ - public static readonly string TableName = "TaskConsistentRule"; + public static readonly string TableName = "EnrollReadingCategory"; //ļ service Ƿҳ } #>