This commit is contained in:
he
2022-07-08 11:19:45 +08:00
parent fde57c12cb
commit ec5bf392af
7 changed files with 99 additions and 2 deletions
@@ -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<Guid> NeedCalculateReviewers { get; set; } = new List<Guid>();
}
public class SetEnrollReadingCategoryInDto
{
[NotDefault]
public Guid EnrollId { get; set; }
public List<ReadingCategory> 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<ReadingCategory> ReadingCategorys { get; set; }
}
@@ -17,6 +17,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<Enroll> _enrollRepository;
private readonly IRepository<Doctor> _doctorRepository;
private readonly IRepository<Workload> _doctorWorkloadRepository;
private readonly IRepository<EnrollReadingCategory> _enrollReadingCategoryRepository;
private readonly IRepository<Attachment> _attachmentRepository;
private readonly IRepository<Payment> _costStatisticsRepository;
private readonly IRepository<TrialRevenuesPrice> _trialRevenuesPriceRepository;
@@ -27,6 +28,7 @@ namespace IRaCIS.Application.Services
IRepository<Enroll> intoGroupRepository,
IRepository<Doctor> doctorInfoRepository,
IRepository<Workload> doctorWorkloadRepository,
IRepository<EnrollReadingCategory> enrollReadingCategoryRepository,
IRepository<Attachment> attachmentRepository,
IRepository<Payment> costStatisticsRepository,
IRepository<TrialRevenuesPrice> 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);
}
/// <summary>
/// 修改项目医生的阅片类型
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[TypeFilter(typeof(TrialResourceFilter))]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto)
{
await _enrollReadingCategoryRepository.BatchDeleteNoTrackingAsync(x => x.EnrollId == inDto.EnrollId);
List<EnrollReadingCategory> 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);
}
/// <summary>
/// 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判
/// </summary>
@@ -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,