Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8

IRC_NewDev
he 2024-03-01 15:55:23 +08:00
commit 69ab56f878
5 changed files with 83 additions and 24 deletions

View File

@ -152,9 +152,20 @@ namespace IRaCIS.Application.Contracts
public List<ReadingCategory> ReadingCategorys { get; set; } public List<ReadingCategory> ReadingCategorys { get; set; }
public bool IsJoinAnalysis { get; set; } = true;
} }
public class SetCriterionJoinJoinAnalysisCommand
{
public Guid? Id { get; set; }
[NotDefault]
public Guid EnrollId { get; set; }
[NotDefault]
public Guid TrialReadingCriterionId { get; set; }
public bool IsJoinAnalysis { get; set; }
}
public class SetEnrollEnableCommand public class SetEnrollEnableCommand
{ {
@ -247,6 +258,10 @@ namespace IRaCIS.Application.Contracts
} }
public class DoctorCriterionStatus : SetCriterionJoinJoinAnalysisCommand
{
}
public class WorkLoadAndAgreementDTO : WorkLoadAndTrainingDTO public class WorkLoadAndAgreementDTO : WorkLoadAndTrainingDTO
{ {
@ -270,6 +285,8 @@ namespace IRaCIS.Application.Contracts
public List<TrialReadingCriterionDto> TrialReadingCriterionList { get; set; } public List<TrialReadingCriterionDto> TrialReadingCriterionList { get; set; }
public List<DoctorCriterionStatus> DoctorCriterionStatusList { get; set; }
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; } public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
//任务阅片状态 //任务阅片状态

View File

@ -23,6 +23,9 @@ 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<EnrollReadingCriterion> _enrollReadingCriterionRepository;
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository; private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
public DoctorWorkloadService(IRepository<Trial> clinicalTrialProjectRepository, public DoctorWorkloadService(IRepository<Trial> clinicalTrialProjectRepository,
IRepository<Enroll> intoGroupRepository, IRepository<Enroll> intoGroupRepository,
@ -34,7 +37,7 @@ namespace IRaCIS.Application.Services
IRepository<TrialRevenuesPrice> trialRevenuesPriceRepository, IRepository<TrialRevenuesPrice> trialRevenuesPriceRepository,
IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository,
IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository, IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository,
IMapper mapper) IRepository<EnrollReadingCriterion> enrollReadingCriterionRepository)
{ {
_taskAllocationRuleRepository = taskAllocationRuleRepository; _taskAllocationRuleRepository = taskAllocationRuleRepository;
_trialRepository = clinicalTrialProjectRepository; _trialRepository = clinicalTrialProjectRepository;
@ -46,6 +49,7 @@ namespace IRaCIS.Application.Services
_costStatisticsRepository = costStatisticsRepository; _costStatisticsRepository = costStatisticsRepository;
_trialRevenuesPriceRepository = trialRevenuesPriceRepository; _trialRevenuesPriceRepository = trialRevenuesPriceRepository;
_trialRevenuesPriceVerificationRepository = trialRevenuesPriceVerificationRepository; _trialRevenuesPriceVerificationRepository = trialRevenuesPriceVerificationRepository;
_enrollReadingCriterionRepository = enrollReadingCriterionRepository;
} }
@ -105,6 +109,27 @@ namespace IRaCIS.Application.Services
#endregion #endregion
public async Task<IResponseOutput> BatchSetCriterionJoinJoinAnalysis(List<SetCriterionJoinJoinAnalysisCommand> batchList)
{
foreach (var item in batchList)
{
if (item.Id == null)
{
await _enrollReadingCriterionRepository.InsertFromDTOAsync(item);
}
else
{
await _enrollReadingCriterionRepository.UpdateFromDTOAsync(item);
}
}
await _enrollReadingCriterionRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
@ -121,14 +146,14 @@ namespace IRaCIS.Application.Services
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 && t.TrialReadingCriterionId==inDto.TrialReadingCriterionId).Any()) if (_repository.Where<VisitTask>(t => t.TrialId == enroll.TrialId && t.DoctorUserId == enroll.DoctorUserId && t.TaskAllocationState == TaskAllocationState.Allocated && t.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Any())
{ {
var readingCategoryList = await _enrollReadingCategoryRepository.Where(t => t.EnrollId == inDto.EnrollId && t.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(t => t.ReadingCategory).ToListAsync(); var readingCategoryList = await _enrollReadingCategoryRepository.Where(t => t.EnrollId == inDto.EnrollId && t.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(t => t.ReadingCategory).ToListAsync();
if (readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0) if (readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0)
{ {
//---已分配任务,不允许减少阅片类型 //---已分配任务,不允许减少阅片类型
return ResponseOutput.NotOk(_localizer["DoctorWorkload_AssignType"]); return ResponseOutput.NotOk(_localizer["DoctorWorkload_AssignType"]);
} }
@ -150,7 +175,7 @@ namespace IRaCIS.Application.Services
List<EnrollReadingCategory> enrollReadings = inDto.ReadingCategorys.Select(x => new EnrollReadingCategory() List<EnrollReadingCategory> enrollReadings = inDto.ReadingCategorys.Select(x => new EnrollReadingCategory()
{ {
TrialReadingCriterionId= inDto.TrialReadingCriterionId, TrialReadingCriterionId = inDto.TrialReadingCriterionId,
EnrollId = inDto.EnrollId, EnrollId = inDto.EnrollId,
ReadingCategory = x ReadingCategory = x
}).ToList(); }).ToList();
@ -171,7 +196,7 @@ namespace IRaCIS.Application.Services
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UpdateTrialReviewerState(SetEnrollEnableCommand inCommand) 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); await _taskAllocationRuleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == inCommand.TrialId && t.EnrollId == inCommand.EnrollId, u => new TaskAllocationRule() { IsEnable = inCommand.IsEnable }, true);
return ResponseOutput.Ok(); return ResponseOutput.Ok();
} }
@ -182,7 +207,7 @@ namespace IRaCIS.Application.Services
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost("{trialId}/{doctorId}/{type}")] [HttpPost("{trialId}/{doctorId}/{type}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
//[Authorize(Policy = IRaCISPolicy.PM_APM)] //[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> UpdateReviewerReadingType(Guid trialId, Guid doctorId, int type) public async Task<IResponseOutput> UpdateReviewerReadingType(Guid trialId, Guid doctorId, int type)
{ {
@ -217,13 +242,21 @@ namespace IRaCIS.Application.Services
EnrollId = intoGroup.Id, EnrollId = intoGroup.Id,
IsEnable = allocateRule.IsEnable, IsEnable = allocateRule.IsEnable,
TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm).Select(t=>new TrialReadingCriterionDto() { TrialReadingCriterionId=t.Id,TrialReadingCriterionName=t.CriterionName,CriterionType=t.CriterionType,IsOncologyReading=t.IsOncologyReading,IsArbitrationReading=t.IsArbitrationReading,IsGlobalReading=t.IsGlobalReading,ReadingInfoSignTime=t.ReadingInfoSignTime,ReadingType=t.ReadingType}).ToList(), TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, IsOncologyReading = t.IsOncologyReading, IsArbitrationReading = t.IsArbitrationReading, IsGlobalReading = t.IsGlobalReading, ReadingInfoSignTime = t.ReadingInfoSignTime, ReadingType = t.ReadingType }).ToList(),
DoctorCriterionStatusList= intoGroup.EnrollReadingCriteriaList.Select(t=>new DoctorCriterionStatus()
{
EnrollId=t.Id,
Id=t.Id,
IsJoinAnalysis=t.IsJoinAnalysis,
TrialReadingCriterionId=t.TrialReadingCriterionId
}).ToList(),
CriterionReadingCategoryList =intoGroup.EnrollReadingCategoryList.Select(t=>new TrialCriterionReadingCategory() { EnrollId=t.EnrollId,ReadingCategory=t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(), CriterionReadingCategoryList = intoGroup.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(),
CriterionFileList = doctor.CriterionFileList.Where(x => x.IsEnable && (x.TrialId==null ||x.TrialId==trialId)).Select(x => new CriterionFile() CriterionFileList = doctor.CriterionFileList.Where(x => x.IsEnable && (x.TrialId == null || x.TrialId == trialId)).Select(x => new CriterionFile()
{ {
CriterionType = x.CriterionType, CriterionType = x.CriterionType,
DoctorId = x.DoctorId, DoctorId = x.DoctorId,
@ -231,14 +264,14 @@ namespace IRaCIS.Application.Services
FilePath = x.FilePath, FilePath = x.FilePath,
FileType = x.FileType, FileType = x.FileType,
Remark = x.Remark, Remark = x.Remark,
TrialReadingCriterionId=x.TrialReadingCriterionId, TrialReadingCriterionId = x.TrialReadingCriterionId,
Id = x.Id Id = x.Id
}).ToList(), }).ToList(),
ReadingTaskStateList = doctor.User.VisitTaskList.Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask() ReadingTaskStateList = doctor.User.VisitTaskList.Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask()
{ {
ReadingTaskState = x.ReadingTaskState, ReadingTaskState = x.ReadingTaskState,
TrialReadingCriterionId=x.TrialReadingCriterionId, TrialReadingCriterionId = x.TrialReadingCriterionId,
CriterionType = x.TrialReadingCriterion.CriterionType, CriterionType = x.TrialReadingCriterion.CriterionType,
}).ToList(), }).ToList(),
@ -249,7 +282,7 @@ namespace IRaCIS.Application.Services
LastName = doctor.LastName, LastName = doctor.LastName,
FullName = doctor.FullName, FullName = doctor.FullName,
ChineseName = doctor.ChineseName, ChineseName = doctor.ChineseName,
UserName= intoGroup.DoctorUser.UserName, UserName = intoGroup.DoctorUser.UserName,
OutEnrollTime = intoGroup.OutEnrollTime, OutEnrollTime = intoGroup.OutEnrollTime,
EnrollTime = intoGroup.EnrollTime, EnrollTime = intoGroup.EnrollTime,
@ -659,7 +692,7 @@ namespace IRaCIS.Application.Services
if (await _doctorWorkloadRepository.AnyAsync(workloadLambda)) if (await _doctorWorkloadRepository.AnyAsync(workloadLambda))
{ {
//---This type of data can only have one //---This type of data can only have one
return ResponseOutput.NotOk(_localizer["DoctorWorkload_Unique"]); return ResponseOutput.NotOk(_localizer["DoctorWorkload_Unique"]);
} }
@ -671,7 +704,7 @@ namespace IRaCIS.Application.Services
doctorworkloadLambda = doctorworkloadLambda.And(t => t.DataFrom == (int)WorkLoadFromStatus.Doctor); doctorworkloadLambda = doctorworkloadLambda.And(t => t.DataFrom == (int)WorkLoadFromStatus.Doctor);
if (await _doctorWorkloadRepository.AnyAsync(doctorworkloadLambda)) if (await _doctorWorkloadRepository.AnyAsync(doctorworkloadLambda))
{ {
//---This type of data can only have one //---This type of data can only have one
return ResponseOutput.NotOk(_localizer["DoctorWorkload_Unique"]); return ResponseOutput.NotOk(_localizer["DoctorWorkload_Unique"]);
} }
} }
@ -701,7 +734,7 @@ namespace IRaCIS.Application.Services
if (isLocked) if (isLocked)
{ {
//---Expenses have been settled and workload cannot be modified. //---Expenses have been settled and workload cannot be modified.
return ResponseOutput.NotOk(_localizer["DoctorWorkload_FeeSettled"]); return ResponseOutput.NotOk(_localizer["DoctorWorkload_FeeSettled"]);
} }

View File

@ -15,6 +15,10 @@ namespace IRaCIS.Core.Application.Service
CreateMap<EnrollCommand, Enroll>(); CreateMap<EnrollCommand, Enroll>();
CreateMap<SetCriterionJoinJoinAnalysisCommand, EnrollReadingCriterion>().ReverseMap();
} }
} }

View File

@ -16,12 +16,14 @@ namespace IRaCIS.Core.Domain.Models
public class EnrollReadingCriterion : Entity, IAuditAdd public class EnrollReadingCriterion : Entity, IAuditAdd
{ {
[JsonIgnore]
[ForeignKey("EnrollId")]
public Enroll Enroll { get; set; }
/// <summary>
/// <summary>
/// EnrollId /// EnrollId
/// </summary> /// </summary>
[Required] [Required]
public Guid EnrollId { get; set; } public Guid EnrollId { get; set; }
/// <summary> /// <summary>

View File

@ -69,5 +69,8 @@ namespace IRaCIS.Core.Domain.Models
[JsonIgnore] [JsonIgnore]
public List<EnrollReadingCategory> EnrollReadingCategoryList { get; set; } public List<EnrollReadingCategory> EnrollReadingCategoryList { get; set; }
[JsonIgnore]
public List<EnrollReadingCriterion> EnrollReadingCriteriaList { get; set; }
} }
} }