修改比例尺修改答案
This commit is contained in:
+65
-5
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改比例修改答案
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> 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();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改比例修改答案 现在弃用了
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="proportion"></param>
|
||||
/// <returns></returns>
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user