修改稽查标识
parent
dae537a223
commit
b825d8f55a
|
@ -41,6 +41,7 @@ namespace IRaCIS.Core.API
|
|||
triggerOptions.AddTrigger<SubjectVisitFinalVisitTrigger>();
|
||||
triggerOptions.AddTrigger<SubjectVisitTrigger>();
|
||||
triggerOptions.AddTrigger<TrialCriterionSignTrigger>();
|
||||
triggerOptions.AddTrigger<TableQuestionRowTrigger>();
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -1183,7 +1183,6 @@ namespace IRaCIS.Application.Services
|
|||
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.RowId == inDto.RowId && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
|
||||
|
||||
Answer = item.Answer
|
||||
|
||||
});
|
||||
|
|
|
@ -3,6 +3,7 @@ using IRaCIS.Core.Domain.Share;
|
|||
|
||||
namespace IRaCIS.Core.Application.Triggers
|
||||
{
|
||||
|
||||
//访视 质疑状态 触发修改
|
||||
public class ChallengeStateTrigger : IAfterSaveTrigger<QCChallenge>
|
||||
{
|
||||
|
@ -40,4 +41,8 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
u => new SubjectVisit() { ChallengeState = subjectVisitChallengeState });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using EntityFrameworkCore.Triggered;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Triggers
|
||||
{
|
||||
//病灶编号维护
|
||||
public class TableQuestionRowTrigger : IBeforeSaveTrigger<ReadingTableAnswerRowInfo>
|
||||
{
|
||||
|
||||
|
||||
public Task BeforeSave(ITriggerContext<ReadingTableAnswerRowInfo> context, CancellationToken cancellationToken)
|
||||
{
|
||||
Dictionary<int, string> splitLesionDic = new Dictionary<int, string>()
|
||||
{
|
||||
{1, "a" },
|
||||
{2, "b" },
|
||||
{3, "c" },
|
||||
{4, "d" },
|
||||
{5, "e" },
|
||||
{6, "f" },
|
||||
{7, "g" },
|
||||
{8, "h" },
|
||||
{9, "i" },
|
||||
{10, "j" },
|
||||
{11, "k" },
|
||||
{12, "l" },
|
||||
{13, "m" },
|
||||
{14, "n" },
|
||||
{15, "o" },
|
||||
{16, "p" },
|
||||
{17, "q" },
|
||||
{18, "r" },
|
||||
{19, "s" },
|
||||
{20, "t" },
|
||||
{21, "u" },
|
||||
{22, "v" },
|
||||
{23, "w" },
|
||||
{24, "x" },
|
||||
{25, "y" },
|
||||
{26, "z" },
|
||||
|
||||
};
|
||||
if (context.Entity.RowIndex % 1 == 0)
|
||||
{
|
||||
context.Entity.RowMark = context.Entity.OrderMark + decimal.ToInt32(context.Entity.RowIndex).ToString().PadLeft(2, '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Entity.RowMark = context.Entity.OrderMark + Math.Floor(context.Entity.RowIndex).ToString().PadLeft(2, '0') + splitLesionDic[decimal.ToInt32((context.Entity.RowIndex % 1) * 100)];
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -142,54 +142,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
|
||||
|
||||
|
||||
public string RowMark
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
|
||||
Dictionary<int, string> splitLesionDic = new Dictionary<int, string>()
|
||||
{
|
||||
{1, "a" },
|
||||
{2, "b" },
|
||||
{3, "c" },
|
||||
{4, "d" },
|
||||
{5, "e" },
|
||||
{6, "f" },
|
||||
{7, "g" },
|
||||
{8, "h" },
|
||||
{9, "i" },
|
||||
{10, "j" },
|
||||
{11, "k" },
|
||||
{12, "l" },
|
||||
{13, "m" },
|
||||
{14, "n" },
|
||||
{15, "o" },
|
||||
{16, "p" },
|
||||
{17, "q" },
|
||||
{18, "r" },
|
||||
{19, "s" },
|
||||
{20, "t" },
|
||||
{21, "u" },
|
||||
{22, "v" },
|
||||
{23, "w" },
|
||||
{24, "x" },
|
||||
{25, "y" },
|
||||
{26, "z" },
|
||||
|
||||
};
|
||||
if (RowIndex % 1 == 0)
|
||||
{
|
||||
return this.OrderMark+ decimal.ToInt32(RowIndex).ToString().PadLeft(2, '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.OrderMark + Math.Floor(RowIndex).ToString().PadLeft(2, '0') + splitLesionDic[decimal.ToInt32((RowIndex % 1) * 100)];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public string RowMark { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -670,8 +670,23 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var trialReadingCriterionId = tableQuesionList.FirstOrDefault()?.TrialReadingCriterionId;
|
||||
|
||||
//获取表名称 类型名称(病灶类型)
|
||||
var tableName = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Select(t => t.QuestionName).FirstOrDefaultAsync();
|
||||
//获取表名称 类型名称(病灶类型) 不用查 从项目问题的稽查记录里面去取
|
||||
//var tableName = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Select(t => t.QuestionName).FirstOrDefaultAsync();
|
||||
|
||||
//分裂病灶 需要原病灶的标识
|
||||
|
||||
//if (_userInfo.RequestUrl == " ReadingImageTask/splitLesion")
|
||||
|
||||
var originalName = string.Empty;
|
||||
if (entity.SplitRowId != null)
|
||||
{
|
||||
|
||||
originalName= await _dbContext.ReadingTableAnswerRowInfo.Where(t => t.Id == entity.SplitRowId).Select(t => t.RowMark).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
|
@ -679,11 +694,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
ObjectRelationParentId = x.VisitTaskId,
|
||||
|
||||
TrialReadingCriterionId = trialReadingCriterionId
|
||||
TrialReadingCriterionId = trialReadingCriterionId,
|
||||
|
||||
ObjectRelationParentId2 = x.QuestionId
|
||||
|
||||
}, new
|
||||
{
|
||||
TableName= tableName,
|
||||
OriginalName= originalName,
|
||||
//TableName = tableName,
|
||||
QuestionAnswerList =
|
||||
|
||||
//需要手动添加病灶类型
|
||||
|
|
Loading…
Reference in New Issue