From 9b278656751814aae14a1424d26863097bd58a20 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Fri, 6 Jan 2023 10:20:06 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ReadingMedicalReviewService.cs | 7 ++++
.../ReadingGlobalTaskService.cs | 3 ++
.../ReadingImageTaskService.cs | 38 ++++++++++++++++---
.../ReadingJudgeTaskService.cs | 4 ++
.../ReadingNoDicomTaskService.cs | 2 +
.../ReadingOncologyTaskService.cs | 2 +
6 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs
index ae8935ded..e51227361 100644
--- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs
@@ -11,6 +11,7 @@ using IRaCIS.Core.Domain.Share;
using Panda.DynamicWebApi.Attributes;
using IRaCIS.Core.Application.Contracts;
using Newtonsoft.Json;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Core.Application.Service
{
@@ -354,6 +355,7 @@ namespace IRaCIS.Core.Application.Service
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SaveMedicineQuestion(SaveMedicineQuestionInDto inDto)
{
var medicalReviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
@@ -397,6 +399,7 @@ namespace IRaCIS.Core.Application.Service
///
///
///
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SaveMedicalReviewInfo(SaveMedicalReviewInfoInDto inDto)
{
var medicalReviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
@@ -448,6 +451,7 @@ namespace IRaCIS.Core.Application.Service
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ClosedMedicalReviewDialog(ClosedMedicalReviewDialogInDto inDto)
{
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
@@ -479,6 +483,7 @@ namespace IRaCIS.Core.Application.Service
///
///
///
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SendMedicalReviewDialog(SendMedicalReviewDialogInDto inDto)
{
var medicalReviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
@@ -513,6 +518,7 @@ namespace IRaCIS.Core.Application.Service
///
///
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task IRSendMedicalReviewDialog(IRSendMedicalReviewDialogInDto inDto)
{
var medicalReviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
@@ -642,6 +648,7 @@ namespace IRaCIS.Core.Application.Service
///
[HttpPost]
[UnitOfWork]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task IRConfirmMedicalReview(IRConfirmMedicalReviewInDto inDto)
{
var medicalReviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs
index 42e9b27d3..a69ff9d38 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs
@@ -10,6 +10,7 @@ using IRaCIS.Core.Infrastructure;
using Newtonsoft.Json;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@@ -41,6 +42,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
{
await VerifyTaskIsSign(inDto.GlobalTaskId);
@@ -80,6 +82,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
{
await VerifyTaskIsSign(inDto.GlobalTaskId);
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index 40c10ed1d..37a235873 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -13,6 +13,7 @@ using IRaCIS.Core.Application.Interfaces;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Caching.Memory;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@@ -129,6 +130,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ChangeCalculationAnswer(ChangeCalculationAnswerInDto inDto)
{
var visitTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
@@ -203,6 +205,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ReadClinicalData(ReadClinicalDataInDto inDto)
{
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask
@@ -921,6 +924,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SplitLesion(SplitLesionInDto inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
@@ -967,6 +971,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task MergeLesion(MergeLesionInDto inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
@@ -1032,6 +1037,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SaveImageQuality(ChangeDicomReadingQuestionAnswerInDto inDto)
{
return await ChangeDicomReadingQuestionAnswer(inDto);
@@ -1055,6 +1061,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task ChangeDicomReadingQuestionAnswer(ChangeDicomReadingQuestionAnswerInDto inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
@@ -1089,6 +1096,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task DeleteReadingRowAnswer(DeleteReadingRowAnswerInDto inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
@@ -1225,6 +1233,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SubmitTableQuestion(SubmitTableQuestionInDto inDto)
{
SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto();
@@ -1244,6 +1253,7 @@ namespace IRaCIS.Application.Services
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList();
+ var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.RowId == inDto.RowId).ToListAsync();
var tableQuestionIdGroup = tableQuestionIds.GroupBy(x => new { TableQuestionId = x }).Select(x => new TableQuestionData
{
@@ -1382,14 +1392,31 @@ namespace IRaCIS.Application.Services
});
- foreach(var item in inDto.AnswerList)
+ foreach (var item in inDto.AnswerList)
{
- await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.RowId == inDto.RowId && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer()
+ if (tableAnswerList.Any(x => x.TableQuestionId == item.TableQuestionId))
{
+ await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.RowId == inDto.RowId && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer()
+ {
- Answer = item.Answer
+ Answer = item.Answer
- });
+ });
+ }
+ else
+ {
+ await _readingTableQuestionAnswerRepository.AddAsync(new ReadingTableQuestionAnswer()
+ {
+ Answer = item.Answer,
+ QuestionId = inDto.QuestionId,
+ TableQuestionId = item.TableQuestionId,
+ RowId = inDto.RowId.Value,
+ TrialId = taskinfo.TrialId,
+ RowIndex = rowInfo.RowIndex,
+ VisitTaskId = inDto.VisitTaskId,
+ });
+ }
+
}
@@ -1420,7 +1447,7 @@ namespace IRaCIS.Application.Services
///
///
///
-
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SubmitDicomVisitTask(SubmitDicomVisitTaskInDto inDto)
{
@@ -1841,6 +1868,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddReadingTask(Guid visitTaskId)
{
// ****** 先生成阅片期 阅片期任务阅片完成之后生成肿瘤学的 如果没有阅片期 直接生成肿瘤学 *********////
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs
index 589c1e9aa..0227a40a0 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs
@@ -10,6 +10,7 @@ using IRaCIS.Core.Infrastructure;
using Newtonsoft.Json;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@@ -61,6 +62,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SetTrialCriterionJudgeQuestionAnswerGroup(SetTrialCriterionJudgeQuestionAnswerGroupInDto inDto)
{
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionTrialId, x => new ReadingQuestionTrial()
@@ -335,6 +337,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SaveJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
@@ -357,6 +360,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs
index b0bd04af9..4328fa62a 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs
@@ -5,6 +5,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
using Panda.DynamicWebApi.Attributes;
using IRaCIS.Core.Application.Contracts;
using MassTransit;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@@ -37,6 +38,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SaveVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
{
await VerifyTaskIsSign(inDto.VisitTaskId);
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs
index bef806ba3..798a34f66 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs
@@ -10,6 +10,7 @@ using IRaCIS.Core.Infrastructure;
using Newtonsoft.Json;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel;
+using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@@ -162,6 +163,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
+ [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task SetOncologyReadingInfo(SetOncologyReadingInfoInDto inDto)
{
await VerifyTaskIsSign(inDto.OncologyTaskId);