修改项目停止 不允许操作

Uat_Study
{872297557@qq.com} 2023-01-04 18:02:37 +08:00
parent e7ff7547a1
commit 2441a6ae3b
10 changed files with 87 additions and 64 deletions

View File

@ -406,6 +406,7 @@ namespace IRaCIS.Core.API.Controllers
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("Inspection/TrialDocument/userConfirm")] [HttpPost, Route("Inspection/TrialDocument/userConfirm")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork] [UnitOfWork]
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt) public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
{ {

View File

@ -384,7 +384,7 @@ namespace IRaCIS.Core.Application.Services
return ResponseOutput.Ok(result); return ResponseOutput.Ok(result);
} }
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM)] [Authorize(Policy = IRaCISPolicy.PM)]
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument) public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
{ {
@ -454,6 +454,7 @@ namespace IRaCIS.Core.Application.Services
/// <returns></returns> /// <returns></returns>
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")] [HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM)] [Authorize(Policy = IRaCISPolicy.PM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId) public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
{ {
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any())) if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
@ -600,6 +601,7 @@ namespace IRaCIS.Core.Application.Services
/// <param name="isSystemDoc"></param> /// <param name="isSystemDoc"></param>
/// <returns></returns> /// <returns></returns>
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")] [HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc) public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
{ {
if (isSystemDoc) if (isSystemDoc)

View File

@ -411,8 +411,11 @@ namespace IRaCIS.Core.Application.Image.QA
} }
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")] [HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM_APM)] [Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> RejectCheckBack(Guid subjectVisitId) public async Task<IResponseOutput> RejectCheckBack(Guid subjectVisitId)
{ {
//if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM) //if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM)
@ -851,6 +854,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <summary>替换当前领取人 </summary> /// <summary>替换当前领取人 </summary>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")] [HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[Authorize(Policy = IRaCISPolicy.IQC)] [Authorize(Policy = IRaCISPolicy.IQC)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId) public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId)
{ {
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
@ -1818,6 +1822,7 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPost("{trialId:guid}")] [HttpPost("{trialId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM_APM)] [Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList) public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList)
{ {

View File

@ -7,6 +7,7 @@ using System.Linq.Dynamic.Core;
using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services namespace IRaCIS.Application.Services
{ {
@ -251,6 +252,7 @@ namespace IRaCIS.Application.Services
/// <param name="dto"></param> /// <param name="dto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AddReadModule(ReadModuleAddDto dto) public async Task<IResponseOutput> AddReadModule(ReadModuleAddDto dto)
{ {
@ -404,6 +406,7 @@ namespace IRaCIS.Application.Services
/// <param name="readModuleId"></param> /// <param name="readModuleId"></param>
/// <returns></returns> /// <returns></returns>
[HttpDelete("{readModuleId:guid}")] [HttpDelete("{readModuleId:guid}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> DeleteReadModule(Guid readModuleId) public async Task<IResponseOutput> DeleteReadModule(Guid readModuleId)
{ {

View File

@ -5,6 +5,7 @@ using MassTransit;
using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services namespace IRaCIS.Application.Services
{ {
@ -65,6 +66,7 @@ namespace IRaCIS.Application.Services
/// <param name="addOrEditReadingPeriodSet"></param> /// <param name="addOrEditReadingPeriodSet"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AddOrUpdateReadingPeriodSet(ReadingPeriodSetAddOrEdit addOrEditReadingPeriodSet) public async Task<IResponseOutput> AddOrUpdateReadingPeriodSet(ReadingPeriodSetAddOrEdit addOrEditReadingPeriodSet)
{ {
if (await _readingPeriodSetRepository.AnyAsync(x => x.Id != addOrEditReadingPeriodSet.Id && x.IsTakeEffect != ReadingPeriodStatus.Revocation if (await _readingPeriodSetRepository.AnyAsync(x => x.Id != addOrEditReadingPeriodSet.Id && x.IsTakeEffect != ReadingPeriodStatus.Revocation
@ -126,6 +128,7 @@ namespace IRaCIS.Application.Services
/// <param name="readingPeriodSetId"></param> /// <param name="readingPeriodSetId"></param>
/// <returns></returns> /// <returns></returns>
[HttpDelete("{readingPeriodSetId:guid}")] [HttpDelete("{readingPeriodSetId:guid}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId) public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId)
{ {
await _readingPeriodSetRepository.UpdatePartialFromQueryAsync(t => t.Id == readingPeriodSetId, x => new ReadingPeriodSet() await _readingPeriodSetRepository.UpdatePartialFromQueryAsync(t => t.Id == readingPeriodSetId, x => new ReadingPeriodSet()
@ -149,6 +152,7 @@ namespace IRaCIS.Application.Services
/// <param name="indto"></param> /// <param name="indto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPut] [HttpPut]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SetReadingPeriodSetEffect(SetReadingPeriodSetEffect indto) public async Task<IResponseOutput> SetReadingPeriodSetEffect(SetReadingPeriodSetEffect indto)
{ {
var readingPeriodSet = await _readingPeriodSetRepository.Where(x => x.Id == indto.Id).FirstNotNullAsync(); var readingPeriodSet = await _readingPeriodSetRepository.Where(x => x.Id == indto.Id).FirstNotNullAsync();
@ -369,6 +373,7 @@ namespace IRaCIS.Application.Services
/// </summary> /// </summary>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> GenerateReadingTask(ReadingToGenerateInDto inDto) public async Task<IResponseOutput> GenerateReadingTask(ReadingToGenerateInDto inDto)
{ {
List<ReadingPeriodPlan> plans = new List<ReadingPeriodPlan>(); List<ReadingPeriodPlan> plans = new List<ReadingPeriodPlan>();

View File

@ -87,6 +87,7 @@ namespace IRaCIS.Core.Application.Contracts
/// <exception cref="BusinessValidationFailedException"></exception> /// <exception cref="BusinessValidationFailedException"></exception>
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService) public async Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService)
{ {
@ -643,7 +644,6 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary> /// </summary>
/// <param name="siteSurvyeSubmit"></param> /// <param name="siteSurvyeSubmit"></param>
/// <returns></returns> /// <returns></returns>
// [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpPost] [HttpPost]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork] [UnitOfWork]
@ -763,8 +763,10 @@ namespace IRaCIS.Core.Application.Contracts
await _trialSiteUserSurveyRepository.SaveChangesAsync(); await _trialSiteUserSurveyRepository.SaveChangesAsync();
} }
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand) public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand)
{ {
var trialSiteSurvey = await _trialSiteSurveyRepository.FirstAsync(t => t.Id == joinCommand.TrialSiteSurveyId); var trialSiteSurvey = await _trialSiteSurveyRepository.FirstAsync(t => t.Id == joinCommand.TrialSiteSurveyId);

View File

@ -74,6 +74,7 @@ namespace IRaCIS.Application.Services
[HttpPut] [HttpPut]
[UnitOfWork] [UnitOfWork]
[Authorize(Policy = IRaCISPolicy.PM_APM_CRC_QC)] [Authorize(Policy = IRaCISPolicy.PM_APM_CRC_QC)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand) public async Task<IResponseOutput> UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand)
{ {
await _subjectRepository.UpdateFromDTOAsync(subjectStatusChangeCommand, true); await _subjectRepository.UpdateFromDTOAsync(subjectStatusChangeCommand, true);

View File

@ -328,12 +328,14 @@ namespace IRaCIS.Core.Application.Services
item.InstanceList = thisRowinfo.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId.Value).Distinct().ToList(); item.InstanceList = thisRowinfo.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId.Value).Distinct().ToList();
var tempInstanceList = await _repository.Where<DicomInstance>(t => item.InstanceList.Contains(t.Id)).OrderBy(t => t.InstanceNumber) var tempInstanceList = await _repository.Where<DicomInstance>(t => item.InstanceList.Contains(t.Id)).OrderBy(t => t.InstanceNumber)
.Select(t => new TempInstance { .Select(t => new TempInstance
{
Id = t.Id, Id = t.Id,
Path = t.Path, Path = t.Path,
NumberOfFrames = t.NumberOfFrames, NumberOfFrames = t.NumberOfFrames,
InstanceNumber = t.InstanceNumber }).ToListAsync(); InstanceNumber = t.InstanceNumber
}).ToListAsync();
tempInstanceList.ForEach(x => tempInstanceList.ForEach(x =>

View File

@ -104,6 +104,7 @@ namespace IRaCIS.Application.Services
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
[Authorize(Policy = IRaCISPolicy.PM_APM)] [Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto) public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto)
{ {
@ -156,6 +157,7 @@ namespace IRaCIS.Application.Services
/// <param name="inCommand"></param> /// <param name="inCommand"></param>
/// <returns></returns> /// <returns></returns>
[Authorize(Policy = IRaCISPolicy.PM_APM)] [Authorize(Policy = IRaCISPolicy.PM_APM)]
[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);