匹配去掉空格
parent
581ee62a5b
commit
621fab16a0
|
|
@ -768,9 +768,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var targetSegmentValues = targetSegmentAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var targetSegmentValues = targetSegmentAnswer.Trim().Replace(",", ",").Split(",").ToList();
|
||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
||||
targetSegmentAnswer = JsonConvert.SerializeObject(targetSegmentdic.Where(x => targetSegmentValues.Contains(x.ValueCN)).Select(x => x.Code).ToList());
|
||||
targetSegmentAnswer = JsonConvert.SerializeObject(targetSegmentdic.Where(x => targetSegmentValues.Contains(x.ValueCN.Trim())).Select(x => x.Code).ToList());
|
||||
}
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
|
|
@ -820,10 +820,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var plaqueTypeAnswerValues = plaqueTypeAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var plaqueTypeAnswerValues = plaqueTypeAnswer.Trim().Replace(",", ",").Split(",").ToList();
|
||||
var plaqueTypeAnswerdic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
||||
plaqueTypeAnswer = JsonConvert.SerializeObject(plaqueTypeAnswerdic
|
||||
.Where(x => plaqueTypeAnswerValues.Any(val => x.ValueCN.Contains(val)))
|
||||
.Where(x => plaqueTypeAnswerValues.Any(val => x.ValueCN.Trim().Contains(val)))
|
||||
.Select(x => x.Code)
|
||||
.ToList());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -740,9 +740,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var targetSegmentValues = targetSegmentAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var targetSegmentValues = targetSegmentAnswer.Trim().Replace(",", ",").Split(",").ToList();
|
||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
||||
targetSegmentAnswer = JsonConvert.SerializeObject(targetSegmentdic.Where(x => targetSegmentValues.Contains(x.ValueCN)).Select(x => x.Code).ToList());
|
||||
targetSegmentAnswer = JsonConvert.SerializeObject(targetSegmentdic.Where(x => targetSegmentValues.Contains(x.ValueCN.Trim())).Select(x => x.Code).ToList());
|
||||
}
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
|
|
@ -781,10 +781,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var plaqueTypeAnswerValues = plaqueTypeAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var plaqueTypeAnswerValues = plaqueTypeAnswer.Trim().Replace(",", ",").Split(",").ToList();
|
||||
var plaqueTypeAnswerdic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
||||
plaqueTypeAnswer = JsonConvert.SerializeObject(plaqueTypeAnswerdic
|
||||
.Where(x => plaqueTypeAnswerValues.Any(val => x.ValueCN.Contains(val)))
|
||||
.Where(x => plaqueTypeAnswerValues.Any(val => x.ValueCN.Trim().Contains(val)))
|
||||
.Select(x => x.Code)
|
||||
.ToList());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue