修改稽查

Test.EIImageViewer
{872297557@qq.com} 2022-12-06 18:08:05 +08:00
parent b15a7304b9
commit 4e21dc8432
3 changed files with 58 additions and 6 deletions

View File

@ -16,7 +16,7 @@ namespace IRaCIS.Core.Domain.Models
public class ReadingTableAnswerRowInfo : Entity, IAuditAdd
{
/// <summary>
/// QuestionId
/// 第一层的Question
/// </summary>
public Guid QuestionId { get; set; }
@ -101,15 +101,20 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public Guid CreateUserId { get; set; }
[JsonIgnore]
[ForeignKey("SplitRowId")]
public ReadingTableAnswerRowInfo SplitRow { get; set; }
[JsonIgnore]
[ForeignKey("MergeRowId")]
public ReadingTableAnswerRowInfo MergeRow { get; set; }
[JsonIgnore]
[ForeignKey("QuestionId")]
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
}

View File

@ -63,10 +63,13 @@ namespace IRaCIS.Core.Domain.Models
public Guid RowId { get; set; }
[JsonIgnore]
[ForeignKey("QuestionId")]
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
[JsonIgnore]
[ForeignKey("TableQuestionId")]
public ReadingTableQuestionTrial ReadingTableQuestionTrial { get; set; }

View File

@ -575,7 +575,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#endregion
await InsertInspection<VisitTask>(entity, type, x => new InspectionConvertDTO()
{
VisitTaskId = x.Id,
@ -637,13 +636,58 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
//病灶这里操作
if(entitys.Any(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)))
if(entitys.Any(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)))
{
//var type = GetEntityAuditOpt(item);
//删除病灶接口
if (_userInfo.RequestUrl == "ReadingImageTask/deleteReadingRowAnswer")
{
}
//添加/修改病灶接口
if (_userInfo.RequestUrl == "ReadingImageTask/submitTableQuestion")
{
//区分是添加还是删除操作
var type = GetEntityAuditOpt(entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).FirstOrDefault());
var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList();
//获取问题名称 组合成数组
var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => new { TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, Type = t.ReadingQuestionTrial.QuestionName, t.QuestionName, QuestionId = t.Id, t.ShowOrder }).OrderBy(t => t.ShowOrder).ToListAsync();
var trialReadingCriterionId = tableQuesionList.FirstOrDefault()?.TrialReadingCriterionId;
var firstEntity = tableQuestionAnswerList.First();
var cloneEntity = firstEntity.Clone();
//保证Id 唯一 用于区分病灶
cloneEntity.Id = firstEntity.RowId;
await InsertInspection<ReadingTableQuestionAnswer>(cloneEntity, type, x => new InspectionConvertDTO()
{
VisitTaskId = x.VisitTaskId,
ObjectRelationParentId = x.VisitTaskId,
TrialReadingCriterionId = trialReadingCriterionId
}, new { QuestionAnswerList =
//需要手动添加病灶类型
tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() });
}
}