This commit is contained in:
he
2022-11-07 10:48:14 +08:00
parent 7c2d4ca29a
commit 6a11188f5c
7 changed files with 84 additions and 14 deletions
@@ -578,13 +578,14 @@ namespace IRaCIS.Application.Services
orders.ForEach(x =>
{
Dictionary<string, string> answers = new Dictionary<string, string>();
var rowAnswer = thisAnswer.Where(y => y.RowIndex == x).OrderBy(y => y.ShowOrder).ToList();
var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList();
rowAnswer.ForEach(z =>
{
answers.Add(z.TableQuestionId.ToString(), z.Answer);
});
var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
answers.Add("BlindName", rowInfo.BlindName);
answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString());
@@ -781,6 +782,7 @@ namespace IRaCIS.Application.Services
throw new BusinessValidationFailedException($"当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败");
}
var index = await _readingCalculateService.GetDeleteLesionStatrIndex(inDto);
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.RowId == inDto.RowId);
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.Id == inDto.RowId);
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
@@ -788,27 +790,18 @@ namespace IRaCIS.Application.Services
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId).OrderBy(x => x.RowIndex).ToListAsync();
var index = 1;
foreach (var item in rowInfoList.Where(x => x.RowIndex % 1 == 0))
{
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableQuestionAnswer()
{
RowIndex = index
});
await _readingTableAnswerRowInfoRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableAnswerRowInfo()
{
RowIndex = index
});
var spiltList = rowInfoList.Where(x => x.RowIndex % 1 != 0 && x.RowIndex > item.RowIndex && x.RowIndex < Math.Floor(item.RowIndex + 1)).OrderBy(x => x.RowIndex).ToList();
decimal spiltindex = 0.01M;
foreach (var spiltitem in spiltList)
{
@@ -816,8 +809,6 @@ namespace IRaCIS.Application.Services
{
RowIndex = index + spiltindex
});
await _readingTableAnswerRowInfoRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == spiltitem.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableAnswerRowInfo()
{
RowIndex = index + spiltindex