Uat_Study
he 2022-09-26 09:55:40 +08:00
parent 1b12855aac
commit 697018962d
1 changed files with 8 additions and 1 deletions

View File

@ -281,7 +281,14 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<IResponseOutput> DeleteReadingRowAnswer(DeleteReadingRowAnswerInDto inDto)
{
var deleteRowIndex = inDto.RowIndex;
var deleteRowInfo=await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId).FirstNotNullAsync();
if(await _readingTableAnswerRowInfoRepository.AnyAsync(x=>x.SplitRowId== deleteRowInfo.Id&&x.MergeRowId==deleteRowInfo.Id))
{
throw new BusinessValidationFailedException($"当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败");
}
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId);
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId);
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();