diff --git a/IRaCIS.Core.API/Controllers/FinancialChangeController.cs b/IRaCIS.Core.API/Controllers/FinancialChangeController.cs
index 0b64cd206..379360d03 100644
--- a/IRaCIS.Core.API/Controllers/FinancialChangeController.cs
+++ b/IRaCIS.Core.API/Controllers/FinancialChangeController.cs
@@ -51,6 +51,7 @@ namespace IRaCIS.Core.API.Controllers.Special
/// 新记录Id
[HttpPost, Route("trial/addOrUpdateTrial")]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task> AddOrUpdateTrial(TrialCommand param)
{
var userId = Guid.Parse(User.FindFirst("id").Value);
diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs
index e9453cc74..44967bcc9 100644
--- a/IRaCIS.Core.API/Controllers/InspectionController.cs
+++ b/IRaCIS.Core.API/Controllers/InspectionController.cs
@@ -112,6 +112,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitOncologyReadingInfo")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task SetOncologyReadingInfo(DataInspectionDto opt)
{
@@ -127,6 +129,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitDicomVisitTask")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task SubmitDicomVisitTask(DataInspectionDto opt)
{
@@ -144,6 +148,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitGlobalReadingInfo")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task SubmitGlobalReadingInfo(DataInspectionDto opt)
{
@@ -161,6 +167,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialReadingInfoSign")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task TrialReadingInfoSign(DataInspectionDto opt)
{
@@ -178,6 +186,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingMedicalReview/FinishMedicalReview")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task FinishMedicalReview(DataInspectionDto opt)
{
@@ -193,6 +203,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingMedicineQuestion/ConfirmReadingMedicineQuestion")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task ConfirmReadingMedicineQuestion(DataInspectionDto opt)
{
@@ -209,6 +221,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitVisitTaskQuestions")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task SubmitVisitTaskQuestions(DataInspectionDto opt)
{
@@ -225,6 +239,8 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitJudgeVisitTaskResult")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
[UnitOfWork]
public async Task SubmitJudgeVisitTaskResult(DataInspectionDto opt)
{
@@ -318,6 +334,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/QCOperation/CRCRequestToQC")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task CRCRequestToQC(DataInspectionDto opt)
{
@@ -332,6 +349,7 @@ namespace IRaCIS.Core.API.Controllers
/// 设置QC 通过或者不通过 7:QC failed 8:QC passed
///
[HttpPost, Route("Inspection/QCOperation/QCPassedOrFailed")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task QCPassedOrFailed(DataInspectionDto opt)
{
@@ -345,6 +363,7 @@ namespace IRaCIS.Core.API.Controllers
/// 一致性核查 回退 对话记录不清除 只允许PM回退
///
[HttpPost, Route("Inspection/QCOperation/CheckBack")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task CheckBack(DataInspectionDto opt)
{
@@ -361,7 +380,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadClinicalData/ReadClinicalDataSign")]
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task ReadClinicalDataSign(DataInspectionDto opt)
{
@@ -376,6 +395,7 @@ namespace IRaCIS.Core.API.Controllers
/// CRC 设置已经重传完成
///
[HttpPost, Route("Inspection/QCOperation/SetReuploadFinished")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task SetReuploadFinished(DataInspectionDto opt)
{
@@ -391,6 +411,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/TrialConfig/updateTrialState")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task UpdateTrialState(DataInspectionDto opt)
{
@@ -424,6 +445,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/VisitTask/ConfirmReReading")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task ConfirmReReading(DataInspectionDto opt , [FromServices] IVisitTaskHelpeService _visitTaskCommonService,[FromServices] IVisitTaskService _visitTaskService)
diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
index d8324023e..447818174 100644
--- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
+++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
@@ -137,54 +137,54 @@ namespace IRaCIS.Core.API.Controllers
public virtual async Task DicomFileUploadAsync(Func filePathFunc, string boundary)
{
- var fileCount = 0;
+ var fileCount = 0;
- var reader = new MultipartReader(boundary, HttpContext.Request.Body);
+ var reader = new MultipartReader(boundary, HttpContext.Request.Body);
- var section = await reader.ReadNextSectionAsync();
+ var section = await reader.ReadNextSectionAsync();
- while (section != null)
+ while (section != null)
+ {
+ var hasContentDispositionHeader = ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var contentDisposition);
+
+ if (hasContentDispositionHeader)
{
- var hasContentDispositionHeader = ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var contentDisposition);
- if (hasContentDispositionHeader)
+ var fileName = contentDisposition.FileName.Value ?? String.Empty;
+
+ string mediaType = section.ContentType ?? String.Empty;
+
+
+ //处理压缩文件
+ if (fileName.Contains(".Zip", StringComparison.OrdinalIgnoreCase) || fileName.Contains(".rar", StringComparison.OrdinalIgnoreCase))
{
+ var archive = ArchiveFactory.Open(section.Body);
- var fileName = contentDisposition.FileName.Value ?? String.Empty;
-
- string mediaType = section.ContentType ?? String.Empty;
-
-
- //处理压缩文件
- if (fileName.Contains(".Zip", StringComparison.OrdinalIgnoreCase) || fileName.Contains(".rar", StringComparison.OrdinalIgnoreCase))
+ foreach (var entry in archive.Entries)
{
- var archive = ArchiveFactory.Open(section.Body);
-
- foreach (var entry in archive.Entries)
- {
- if (!entry.IsDirectory)
- {
- ++fileCount;
-
- await filePathFunc(entry.Key, entry.OpenEntryStream(), fileCount);
- }
- }
- }
- //普通单个文件
- else
- {
- if (mediaType.Contains("octet-stream") || mediaType.Contains("dicom"))
+ if (!entry.IsDirectory)
{
++fileCount;
- await filePathFunc(fileName, section.Body, fileCount);
+ await filePathFunc(entry.Key, entry.OpenEntryStream(), fileCount);
}
-
}
}
- section = await reader.ReadNextSectionAsync();
+ //普通单个文件
+ else
+ {
+ if (mediaType.Contains("octet-stream") || mediaType.Contains("dicom"))
+ {
+ ++fileCount;
+
+ await filePathFunc(fileName, section.Body, fileCount);
+ }
+
+ }
}
-
+ section = await reader.ReadNextSectionAsync();
+ }
+
}
@@ -228,7 +228,7 @@ namespace IRaCIS.Core.API.Controllers
[HttpPost, Route("Study/ArchiveStudy")]
[DisableFormValueModelBinding]
[DisableRequestSizeLimit]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ArchiveStudyNew(/*[FromForm] ArchiveStudyCommand archiveStudyCommand,*/ Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId,
[FromServices] ILogger _logger,
[FromServices] IEasyCachingProvider _provider,
@@ -240,7 +240,7 @@ namespace IRaCIS.Core.API.Controllers
{
- if (_provider.Get>(StaticData.Anonymize.Anonymize_AddFixedFiled).Value==null )
+ if (_provider.Get>(StaticData.Anonymize.Anonymize_AddFixedFiled).Value == null)
{
await _mediator.Send(new AnonymizeCacheRequest());
}
@@ -261,7 +261,7 @@ namespace IRaCIS.Core.API.Controllers
var startTime = DateTime.Now;
- if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}" ))
+ if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}"))
{
return ResponseOutput.NotOk("当前已有人正在上传和归档该检查!");
}
@@ -368,7 +368,7 @@ namespace IRaCIS.Core.API.Controllers
else
{
studyMonitor.IsSuccess = false;
- studyMonitor.Note = JsonConvert.SerializeObject(archiveResult);
+ studyMonitor.Note = JsonConvert.SerializeObject(archiveResult);
}
@@ -415,6 +415,8 @@ namespace IRaCIS.Core.API.Controllers
[HttpPost("ClinicalData/UploadVisitClinicalData/{trialId:guid}/{subjectVisitId:guid}")]
[DisableRequestSizeLimit]
[Authorize(Policy = IRaCISPolicy.CRC)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task UploadVisitClinicalData(Guid subjectVisitId)
{
await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
@@ -451,6 +453,8 @@ namespace IRaCIS.Core.API.Controllers
///
[HttpPost("ClinicalData/UploadClinicalTemplate")]
[DisableRequestSizeLimit]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task>> UploadClinicalTemplate(Guid? trialId)
{
@@ -489,6 +493,8 @@ namespace IRaCIS.Core.API.Controllers
///
[HttpPost("ClinicalData/UploadClinicalData/{trialId:guid}/{subjectId:guid}/{readingId:guid}")]
[DisableRequestSizeLimit]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task>> UploadReadClinicalData(Guid trialId, Guid subjectId, Guid readingId)
{
var filerelativePath = string.Empty;
@@ -523,7 +529,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost("VisitTask/UploadReadingAnswerImage/{trialId:guid}/{visitTaskId:guid}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task> UploadReadingAnswerImage(Guid trialId, Guid visitTaskId)
{
@@ -548,7 +554,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost("VisitTask/UploadJudgeTaskImage/{trialId:guid}/{visitTaskId:guid}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task> UploadJudgeTaskImage(Guid trialId, Guid visitTaskId)
{
@@ -576,7 +582,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost("TaskMedicalReview/UploadMedicalReviewImage/{trialId:guid}/{taskMedicalReviewId:guid}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task> UploadMedicalReviewImage(Guid trialId, Guid taskMedicalReviewId)
{
string path = string.Empty;
@@ -615,7 +621,7 @@ namespace IRaCIS.Core.API.Controllers
//[DisableRequestSizeLimit]
[RequestSizeLimit(1_073_741_824)]
[HttpPost("NoneDicomStudy/UploadNoneDicomFile/{trialId:guid}/{subjectVisitId:guid}/{noneDicomStudyId:guid}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId, [FromServices] IRepository _noneDicomStudyRepository)
{
@@ -676,7 +682,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task UploadVisitCheckExcel(Guid trialId)
{
@@ -953,7 +959,7 @@ namespace IRaCIS.Core.API.Controllers
public async Task> DownloadOfficialResume(int language, Guid[] doctorIds)
{
- var path = await _fileService.CreateDoctorsAllAttachmentZip(doctorIds);
+ var path = await _fileService.CreateDoctorsAllAttachmentZip(doctorIds);
return ResponseOutput.Ok(new UploadFileInfoDTO
{
FilePath = await _fileService.CreateOfficialResumeZip(language, doctorIds),
@@ -982,7 +988,7 @@ namespace IRaCIS.Core.API.Controllers
[HttpPost, Route("enroll/downloadResume/{trialId:guid}/{language}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[AllowAnonymous]
public async Task> DownloadResume(int language, Guid trialId, Guid[] doctorIdArray)
{
diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs
index d4de2eaef..980d36b28 100644
--- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs
@@ -10,6 +10,7 @@ using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Share;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Core.Application.Service
{
@@ -59,6 +60,7 @@ namespace IRaCIS.Core.Application.Service
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
{
@@ -87,6 +89,7 @@ namespace IRaCIS.Core.Application.Service
}
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpDelete("{taskAllocationRuleId:guid}")]
public async Task DeleteTaskAllocationRule(Guid taskAllocationRuleId)
diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs
index d9d2805fd..f70bd6780 100644
--- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs
@@ -125,6 +125,8 @@ namespace IRaCIS.Core.Application.Service
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task ConfirmGenerateSelfConsistentTask(ConsistentConfirmGenerateCommand inCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
{
@@ -269,6 +271,8 @@ namespace IRaCIS.Core.Application.Service
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task ConfirmGenerateGroupConsistentTask(GroupConsistentConfirmGenrateCommand inCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
{
var trialId = inCommand.TrialId;
@@ -709,6 +713,7 @@ namespace IRaCIS.Core.Application.Service
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddOrUpdateTaskConsistentRule(TaskConsistentRuleAddOrEdit addOrEditTaskConsistentRule)
{
@@ -730,6 +735,7 @@ namespace IRaCIS.Core.Application.Service
}
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpDelete("{taskConsistentRuleId:guid}")]
public async Task DeleteTaskConsistentRule(Guid taskConsistentRuleId)
diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs
index 7edcee9cb..55046cef5 100644
--- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs
@@ -40,6 +40,8 @@ namespace IRaCIS.Core.Application.Service
}
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task AddOrUpdateTaskMedicalReviewRule(TaskMedicalReviewRuleAddOrEdit addOrEditTaskTaskMedicalReviewRule)
{
var verifyExp1 = new EntityVerifyExp()
@@ -56,6 +58,8 @@ namespace IRaCIS.Core.Application.Service
[HttpDelete("{taskMedicalReviewRuleId:guid}")]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task DeleteTaskMedicalReviewRule(Guid taskMedicalReviewRuleId)
{
diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs
index 4843ec90c..4fb531c90 100644
--- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs
@@ -10,6 +10,7 @@ using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Domain.Share;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Core.Application.Service
{
@@ -111,6 +112,7 @@ namespace IRaCIS.Core.Application.Service
///
///
///
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ManuallyGeneratedAndAssignedMedicalReview(ManuallyGeneratedAndAssignedMedicalReviewCommand command)
{
@@ -223,6 +225,8 @@ namespace IRaCIS.Core.Application.Service
///
[UnitOfWork]
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task AssignMedicalReviewTask(AssignMedicalReviewTaskCommand command)
{
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
index 85035ef6a..539b06c0a 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
@@ -14,6 +14,7 @@ using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Infra.EFCore.Common;
using System.Linq.Expressions;
using IRaCIS.Application.Contracts;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Core.Application.Service.Allocation
{
@@ -112,6 +113,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
///
///
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task BatchAssignDoctorToSubject(BatchAssignDoctorToSubjectCommand command)
{
//var inOrder = _trialRepository.Where(t => t.Id == command.TrialId).Select(t => t.IsReadingTaskViewInOrder).FirstOrDefault();
@@ -213,6 +215,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task CancelSubjectAssignedDoctor(CancelSubjectDoctorCommand cancelCommand)
{
foreach (var command in cancelCommand.CancelList.Where(t => t.IsCancelAssign))
@@ -252,6 +255,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AssignSubjectTaskToDoctor(AssignSubjectTaskToDoctorCommand assignSubjectTaskToDoctorCommand)
{
var visitTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.Id == assignSubjectTaskToDoctorCommand.Id);
@@ -377,6 +381,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AssignSubjectDoctor(AssginSubjectDoctorCommand assginSubjectDoctorCommand)
{
var trialId = assginSubjectDoctorCommand.TrialId;
@@ -453,6 +458,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
/// 数量
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task CancelSubjectAssignDoctor(CancelSubjectAssignCommand cancelSubjectAssignCommand)
{
if (cancelSubjectAssignCommand.IsJudgeDoctor)
@@ -493,6 +499,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ManualAssignDoctorApplyTask(AssignConfirmCommand assignConfirmCommand)
{
var trialId = assignConfirmCommand.TrialId;
@@ -1045,6 +1052,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task ApplyReReading(ApplyReReadingCommand applyReReadingCommand)
{
@@ -1261,6 +1270,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
{
@@ -1839,6 +1850,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
///
[HttpPut("{trialId:guid}/{taskId:guid}")]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
+
public async Task PMSetTaskBack(Guid trialId, Guid taskId)
{
diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
index 44e240bcc..574b33bf8 100644
--- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
@@ -48,6 +48,8 @@ namespace IRaCIS.Core.Application.Contracts
public string RealName { get; set; } = string.Empty;
+
+ public Guid UserTypeId { get; set; }
public string UserTypeShortName { get; set; } = string.Empty;
}
diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs
index 9e0e520ce..ee28f4d4d 100644
--- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs
+++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs
@@ -157,6 +157,7 @@ namespace IRaCIS.Core.Application.Services
ConfirmTime = confirm.ConfirmTime,
RealName = user.LastName + " / " + user.FirstName,
UserName = user.UserName,
+ UserTypeId = user.UserTypeId,
UserTypeShortName = user.UserTypeRole.UserTypeShortName
};
diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
index eccb10de3..001a7060f 100644
--- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
+++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
@@ -160,6 +160,7 @@ namespace IRaCIS.Core.Application.Services
ConfirmTime = confirm.ConfirmTime,
RealName = trialUser.User.FullName,
UserName = trialUser.User.UserName,
+ UserTypeId = trialUser.User.UserTypeId,
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName
};
@@ -190,6 +191,7 @@ namespace IRaCIS.Core.Application.Services
ConfirmTime = confirm.ConfirmTime,
RealName = trialUser.User.FullName,
UserName = trialUser.User.UserName,
+ UserTypeId = trialUser.User.UserTypeId,
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName
};
@@ -296,6 +298,7 @@ namespace IRaCIS.Core.Application.Services
ConfirmTime = confirm.ConfirmTime,
RealName = trialUser.User.FullName,
UserName = trialUser.User.UserName,
+ UserTypeId = trialUser.User.UserTypeId,
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName,
FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
@@ -329,6 +332,7 @@ namespace IRaCIS.Core.Application.Services
ConfirmTime = confirm.ConfirmTime,
RealName = trialUser.User.FullName,
UserName = trialUser.User.UserName,
+ UserTypeId = trialUser.User.UserTypeId,
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName,
FullFilePath = needConfirmEdUserType.SystemDocument.Path
@@ -336,7 +340,8 @@ namespace IRaCIS.Core.Application.Services
var unionQuery = trialDocQuery.Union(systemDocQuery)
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
- .WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId);
+ .WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
+ .WhereIf(querySystemDocument.UserTypeId != null, t => t.UserTypeId == querySystemDocument.UserTypeId);
var result = await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
@@ -539,6 +544,7 @@ namespace IRaCIS.Core.Application.Services
/// 用户 签名某个文档 可能是系统的,也可能是项目的
///
///
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task UserConfirm(UserConfirmCommand userConfirmCommand)
{
diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs
index 90fd5400b..ce2b4e402 100644
--- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs
+++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs
@@ -14,6 +14,7 @@ using IRaCIS.Core.Application.Helper;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Infra.EFCore.Common;
using IRaCIS.Core.Application.Contracts;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Core.Application.Service
{
@@ -755,7 +756,7 @@ namespace IRaCIS.Core.Application.Service
return await trialEmailNoticeConfigQueryable.ToListAsync();
}
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig)
{
await TestEmailConfigAsync(addOrEditTrialEmailNoticeConfig);
@@ -822,7 +823,6 @@ namespace IRaCIS.Core.Application.Service
}
-
private async Task TestEmailConfigAsync(TrialEmailNoticeConfigAddOrEdit config)
{
var toUserList = await _repository.Where(t => t.TrialId == config.TrialId && config.ToUserTypeList.Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }).ToListAsync();
@@ -885,7 +885,7 @@ namespace IRaCIS.Core.Application.Service
}
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpDelete("{trialEmailNoticeConfigId:guid}")]
public async Task DeleteTrialEmailNoticeConfig(Guid trialEmailNoticeConfigId)
{
diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs
index 4edca22e3..76c55703a 100644
--- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs
@@ -135,6 +135,7 @@ namespace IRaCIS.Core.Application.Contracts
///
[HttpPost("{trialId:guid}")]
[Authorize(Policy = IRaCISPolicy.IQC)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task BatchAddTrialQCQuestionConfigure(List batchList, Guid trialId)
{
@@ -180,7 +181,7 @@ namespace IRaCIS.Core.Application.Contracts
//遍历父层级的问题
var batchConfigList = _mapper.Map>(batchList.Where(t => t.ParentId == null));
- foreach (var item in batchConfigList.Where(t=>t.ParentId==null).OrderBy(t => t.ShowOrder))
+ foreach (var item in batchConfigList.Where(t => t.ParentId == null).OrderBy(t => t.ShowOrder))
{
var oldParentId = item.Id;
item.Id = NewId.NextGuid();
@@ -241,6 +242,7 @@ namespace IRaCIS.Core.Application.Contracts
}
[Authorize(Policy = IRaCISPolicy.IQC)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddOrUpdateTrialQCQuestionConfigure(TrialQCQuestionAddOrEdit addOrEditTrialQCQuestionConfigure)
{
@@ -264,6 +266,7 @@ namespace IRaCIS.Core.Application.Contracts
[HttpDelete("{trialId:guid}/{trialQCQuestionConfigureId:guid}")]
[Authorize(Policy = IRaCISPolicy.IQC)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId, Guid trialId)
{
await VerifyIsQCConfirmedAsync(trialId);
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
index 2f05b1cd0..cd15dffcd 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
@@ -221,6 +221,7 @@ namespace IRaCIS.Core.Application
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SetGlobalReadingInfo(SetGlobalReadingInfoInDto inDto)
{
@@ -306,6 +307,7 @@ namespace IRaCIS.Core.Application
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SetOncologySet(SetOncologySetInDto inDto)
{
@@ -407,12 +409,13 @@ namespace IRaCIS.Core.Application
}
-
+
///
/// 设置项目阅片标准
///
///
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SetTrialReadingCriterion(SetTrialReadingCriterionInDto inDto)
{
if (inDto.IsSignSave)
@@ -448,6 +451,7 @@ namespace IRaCIS.Core.Application
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SetCriterionReadingInfo(SetCriterionReadingInfoInDto inDto)
{
ArbitrationRule arbitration = ArbitrationRule.NA;
@@ -653,7 +657,7 @@ namespace IRaCIS.Core.Application
///
[HttpPut]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ConfigTrialBasicInfo(BasicTrialConfig trialConfig)
{
await VerifyOnlyInOngoingOrInitialIzingOptAsync(trialConfig.TrialId);
@@ -677,7 +681,7 @@ namespace IRaCIS.Core.Application
///
[HttpPut]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ConfigTrialProcessInfo(TrialProcessConfig trialConfig)
{
if (!await _trialRepository.Where(t => t.Id == trialConfig.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialInitializing))
@@ -751,6 +755,7 @@ namespace IRaCIS.Core.Application
///
[HttpPut]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ConfigTrialUrgentInfo(TrialUrgentConfig trialConfig)
{
@@ -798,6 +803,7 @@ namespace IRaCIS.Core.Application
[HttpPut("{trialId:guid}/{trialStatusStr}/{reason?}")]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.PM)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task UpdateTrialState(Guid trialId, string trialStatusStr, string? reason)
{
@@ -870,6 +876,7 @@ namespace IRaCIS.Core.Application
///
[HttpPut("{trialId:guid}/{isAbandon:bool}")]
[Authorize(Policy = IRaCISPolicy.PM)]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AbandonTrial(Guid trialId, /*Guid? signId,*/ bool isAbandon)
{
@@ -905,6 +912,7 @@ namespace IRaCIS.Core.Application
///
[HttpPut]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ConfigTrialTaskInfo(TrialTaskConfig trialConfig)
{
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
@@ -922,6 +930,7 @@ namespace IRaCIS.Core.Application
///
[HttpPut]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "BeforeOngoingCantOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ConfigTrialReadingTaskViewRule(TrialReadingTaskViewConfig trialConfig)
{
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs
index 5aeb3d61c..80c6fe9f6 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs
@@ -90,7 +90,7 @@ namespace IRaCIS.Application.Services
// 最开始过滤site已经选择的用户 现在又改回去。。。
var query = _trialUseRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
- .Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator|| t.User.UserTypeEnum == UserTypeEnum.CRA)
+ .Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.User.UserTypeEnum == UserTypeEnum.CRA)
.WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName), t => (t.User.FullName).Contains(param.UserRealName))
.ProjectTo(_mapper.ConfigurationProvider, new { siteId = param.SiteId });
@@ -110,15 +110,15 @@ namespace IRaCIS.Application.Services
//之前已经选择的用户 不放在列表中,现在又要改回去 废弃
var query = _repository.Where(t => t.UserTypeEnum != UserTypeEnum.SuperAdmin)
- //正式或者培训的项目不能允许测试用户
- .WhereIf( trialType==TrialType.OfficialTrial||trialType==TrialType.Training, t => t.IsTestUser==false)
+ //正式或者培训的项目不能允许测试用户
+ .WhereIf(trialType == TrialType.OfficialTrial || trialType == TrialType.Training, t => t.IsTestUser == false)
.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.UserRealName), t => (t.FullName).Contains(trialUserQuery.UserRealName))
.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.UserName), t => t.UserName.Contains(trialUserQuery.UserName))
- //.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.OrganizationName), t => t.OrganizationName.Contains(trialUserQuery.OrganizationName))
+ //.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.OrganizationName), t => t.OrganizationName.Contains(trialUserQuery.OrganizationName))
.WhereIf(trialUserQuery.UserTypeEnum != null, t => t.UserTypeEnum == trialUserQuery.UserTypeEnum)
- //.WhereIf(_userInfo.IsAdmin, t => t.UserTypeRole.Type == UserTypeGroup.TrialUser)
- //.WhereIf(!_userInfo.IsAdmin, t => t.UserTypeRole.Type == UserTypeGroup.TrialUser || t.UserTypeEnum != UserTypeEnum.ProjectManager)
+ //.WhereIf(_userInfo.IsAdmin, t => t.UserTypeRole.Type == UserTypeGroup.TrialUser)
+ //.WhereIf(!_userInfo.IsAdmin, t => t.UserTypeRole.Type == UserTypeGroup.TrialUser || t.UserTypeEnum != UserTypeEnum.ProjectManager)
.ProjectTo(_mapper.ConfigurationProvider, new { trialId = trialUserQuery.TrialId });
return await query.ToPagedListAsync(trialUserQuery.PageIndex,
@@ -134,11 +134,11 @@ namespace IRaCIS.Application.Services
///
//[TrialAudit(AuditType.TrialAudit, AuditOptType.AddTrialStaff)]
[HttpPost]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task AddTrialUsers(TrialUserAddCommand[] userTrialCommands)
{
-
+
var addArray = _mapper.Map(userTrialCommands);
var trialUsers = await _trialUseRepository.AddRangeAsync(addArray);
@@ -156,7 +156,7 @@ namespace IRaCIS.Application.Services
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[HttpPut]
public async Task UpdateTrialUser(UpdateTrialUserCommand updateTrialUserCommand)
@@ -193,7 +193,7 @@ namespace IRaCIS.Application.Services
/// 项目参与人员退出 其中IQC退出 回去释放工作量
//[TrialAudit(AuditType.TrialAudit, AuditOptType.DeleteTrailStaff)]
[HttpDelete, Route("{id:guid}/{trialId:guid}/{isDelete:bool}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
[Obsolete]
public async Task DeleteMaintenanceUser(Guid id, bool isDelete)
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs
index fe2d59af2..075481164 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs
@@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Services
data.TrialSiteUserList = await query.ToListAsync();
-
+
var exportInfo = data;
@@ -115,12 +115,12 @@ namespace IRaCIS.Core.Application.Services
var no = 1;
exportInfo.TrialSiteUserList.ForEach(t => t.No = no++);
- return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);
+ return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);
}
-
+
#endregion
@@ -183,7 +183,7 @@ namespace IRaCIS.Core.Application.Services
{
var query = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.SiteId == siteId).IgnoreQueryFilters()
.ProjectTo(_mapper.ConfigurationProvider);
-
+
return await query.ToListAsync();
}
@@ -215,7 +215,7 @@ namespace IRaCIS.Core.Application.Services
[HttpPost]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddTrialSites(List trialSites)
{
var addArray = _mapper.Map>(trialSites);
@@ -286,7 +286,7 @@ namespace IRaCIS.Core.Application.Services
/// 批量添加Site下 CRC的负责人
[HttpPost]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task AssignSiteCRC(List trialSiteCRCList)
{
@@ -300,13 +300,13 @@ namespace IRaCIS.Core.Application.Services
/// 删除CRC人员
[HttpDelete, Route("{id:guid}/{trialId:guid}/{isDelete:bool}")]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task DeleteSiteCRC(Guid id, bool isDelete)
{
- await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t=>t.Id==id, u => new TrialSiteUser(){ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null },true,true);
+ await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.Id == id, u => new TrialSiteUser() { IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null }, true, true);
return ResponseOutput.Ok();
}
@@ -330,24 +330,24 @@ namespace IRaCIS.Core.Application.Services
}
- public async Task> GetTrialSiteCodeSelect(Guid trialId,bool isIncludeVirtualSite=true)
+ public async Task> GetTrialSiteCodeSelect(Guid trialId, bool isIncludeVirtualSite = true)
{
//CRC只看到他负责的
var list = await _trialSiteRepository.Where(t => t.TrialId == trialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.Id))
- .Select(t=> t.TrialSiteCode).ToListAsync();
+ .Select(t => t.TrialSiteCode).ToListAsync();
- var virtualList = await _repository.Where(t => t.IsSelfAnalysis==true && t.TrialId==trialId).Select(t => t.BlindTrialSiteCode).Distinct().ToListAsync();
+ var virtualList = await _repository.Where(t => t.IsSelfAnalysis == true && t.TrialId == trialId).Select(t => t.BlindTrialSiteCode).Distinct().ToListAsync();
- return isIncludeVirtualSite? list.Concat(virtualList): list;
+ return isIncludeVirtualSite ? list.Concat(virtualList) : list;
}
/// 删除 项目 下某一site
[HttpDelete("{id:guid}/{trialId:guid}")]
[TrialAudit(AuditType.TrialAudit, AuditOptType.DeleteTrialSite)]
- [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Obsolete]
public async Task DeleteTrialSite(Guid id)
{
diff --git a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs
index 1adc68486..d7b39afa1 100644
--- a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs
+++ b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs
@@ -74,7 +74,7 @@ namespace IRaCIS.Application.Services
};
}
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task UpdateVisitBlindName(VisitBlindNameCommand command)
{
@@ -105,6 +105,7 @@ namespace IRaCIS.Application.Services
[HttpPost]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddOrUpdateVisitStage(VisitPlanCommand visitPlan)
{
@@ -207,6 +208,7 @@ namespace IRaCIS.Application.Services
[HttpPost("{trialId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt" })]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ConfirmTrialVisitPlan(Guid trialId)
{
if (!await _trialRepository.AnyAsync(t => t.Id == trialId && (t.TrialStatusStr == StaticData.TrialState.TrialInitializing || t.TrialStatusStr == StaticData.TrialState.TrialOngoing)))