问题修改
parent
0c92fcb011
commit
39968194b1
|
@ -284,7 +284,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
List<string> criterionTypes = (await _iReadingQuestionCriterionTrialRepository.Where(x => inDto.CriterionIds.Contains(x.Id)).Select(x => x.CriterionType).ToListAsync())
|
||||
.Select(x => ((int)x).ToString()).ToList();
|
||||
predicate = x => x.IsConfirm || x.SystemClinicalDataSetId == null;
|
||||
predicate = x =>x.SystemClinicalDataSetId == null;
|
||||
foreach (var item in criterionTypes)
|
||||
{
|
||||
Expression<Func<ClinicalDataTrialSet, bool>> typeExpression = x =>x.ClinicalDataSystemSet==null|| x.ClinicalDataSystemSet.CriterionEnumListStr.Contains(item);
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
using EntityFrameworkCore.Triggered;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Linq.Dynamic.Core;
|
||||
|
||||
namespace IRaCIS.Core.Application.Triggers
|
||||
{
|
||||
//病灶编号维护
|
||||
public class TableQuestionRowTrigger : IBeforeSaveTrigger<ReadingTableAnswerRowInfo>
|
||||
{
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
|
||||
public TableQuestionRowTrigger(IRepository<ReadingQuestionTrial> readingQuestionTrialRepository, IRepository repository)
|
||||
{
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
}
|
||||
|
||||
public Task BeforeSave(ITriggerContext<ReadingTableAnswerRowInfo> context, CancellationToken cancellationToken)
|
||||
public async Task BeforeSave(ITriggerContext<ReadingTableAnswerRowInfo> context, CancellationToken cancellationToken)
|
||||
{
|
||||
Dictionary<int, string> splitLesionDic = new Dictionary<int, string>()
|
||||
{
|
||||
|
@ -40,6 +46,11 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
{26, "z" },
|
||||
|
||||
};
|
||||
if (context.Entity.OrderMark == string.Empty)
|
||||
{
|
||||
context.Entity.OrderMark =await _readingQuestionTrialRepository.Where(x => x.Id == context.Entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync();
|
||||
|
||||
}
|
||||
if (context.Entity.RowIndex % 1 == 0)
|
||||
{
|
||||
context.Entity.RowMark = context.Entity.OrderMark + decimal.ToInt32(context.Entity.RowIndex).ToString().PadLeft(2, '0');
|
||||
|
@ -49,7 +60,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
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;
|
||||
//return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue