diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index bdba84e25..65d6fc397 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -9438,9 +9438,14 @@ 融合的CTSeriesId - + - 比例 + 标记id + + + + + 是否移除比例关系 @@ -13680,10 +13685,17 @@ - + 修改比例修改答案 + + + + + + 修改比例修改答案 现在弃用了 + diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 590a4b017..9ef41eb6e 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -2446,6 +2446,39 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid VisitTaskId { get; set; } } + public class ChangePlottingScaleChangeAnswerInDto + { + /// + /// 标记id + /// + public Guid NoneDicomFileId { get; set; } + + /// + /// 是否移除比例关系 + /// + public bool IsRemovePlottingScale { get; set; } = false; + + + public Guid VisitTaskId { get; set; } + + public string Path { get; set; } + + public string PicturePath { get; set; } = string.Empty; + + public List AnswerList { get; set; } + } + + public class PlottingAnswerInfo + { + public Guid? QuestionId { get; set; } + public Guid? RowId { get; set; } + + public Guid? TableQuestionId { get; set; } + + public string Answer { get; set; } + } + + public class GetNoneDicomMarkAndBindingInDto { public Guid VisitTaskId { get; set; } @@ -2479,10 +2512,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string OrderMarkName { get; set; } - /// - /// 比例 - /// - public decimal? Proportion { get; set; } + ///// + ///// 比例 + ///// + //public decimal? Proportion { get; set; } public Guid? MarkId { get; set; } public Guid? NoneDicomFileId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs index f0baf61ac..8c038ec6b 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs @@ -7,6 +7,7 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; using MassTransit; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; using Panda.DynamicWebApi.Attributes; using System.Linq.Dynamic.Core; @@ -160,10 +161,72 @@ namespace IRaCIS.Core.Application.Service return ResponseOutput.Ok(); } - /// /// 修改比例修改答案 /// + /// + /// + [HttpPost] + public async Task ChangePlottingScaleChangeAnswer(ChangePlottingScaleChangeAnswerInDto inDto) + { + if (inDto.IsRemovePlottingScale) + { + await _readingNoneDicomMarkBindingRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingNoneDicomMark.NoneDicomFileId == inDto.NoneDicomFileId); + } + else + { + var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync(); + + + + var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync(); + + + foreach (var item in inDto.AnswerList) + { + if (item.RowId == null) + { + var answer= answerList.Where(x => x.ReadingQuestionTrialId == item.QuestionId).FirstOrDefault(); + if (answer!=null) + { + await _readingTaskQuestionAnswerRepository.UpdatePartialFromQueryAsync(answer.Id, x => new ReadingTaskQuestionAnswer() + { + Answer = item.Answer + }); + } + } + else + { + var answer = tableAnswerList.Where(x => x.QuestionId == item.QuestionId&&x.RowId==item.RowId&&x.TableQuestionId==item.TableQuestionId).FirstOrDefault(); + if (answer != null) + { + await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(answer.Id, x => new ReadingTableQuestionAnswer() + { + Answer = item.Answer + }); + } + } + } + + + await _readingNoneDicomMarkRepository.UpdatePartialFromQueryAsync(x=>x.VisitTaskId==inDto.VisitTaskId&&x.Path==inDto.Path, x => new ReadingNoneDicomMark() + { + PicturePath = inDto.PicturePath + }); + } + + await _visitTaskRepository.SaveChangesAsync(); + + return ResponseOutput.Ok(); + + + + + } + + /// + /// 修改比例修改答案 现在弃用了 + /// /// /// /// @@ -293,10 +356,7 @@ namespace IRaCIS.Core.Application.Service var entity = await _readingNoneDicomMarkRepository.InsertOrUpdateAsync(inDto,true); - if (inDto.Proportion != null) - { - await this.ChangePlottingScale(entity.Id, inDto.Proportion.Value); - } + await _visitTaskRepository.SaveChangesAsync(); return ResponseOutput.Ok(entity.Id);