Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
292263a60c
|
|
@ -410,7 +410,33 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
|
||||||
//靶段
|
//靶段
|
||||||
var target = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault();
|
var target = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault();
|
||||||
|
|
||||||
ivus.TARGETV = translateDataList[target?.TranslateDicName].Where(t => t.Code.ToLower() == target?.QuestionValue?.ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
var itemValue = target?.QuestionValue??string.Empty;
|
||||||
|
//多选
|
||||||
|
int[] enumValues = new int[0];
|
||||||
|
// 1. 反序列化 JSON 数组 (字符串枚举)
|
||||||
|
if (!itemValue.StartsWith("[") || !itemValue.EndsWith("]"))
|
||||||
|
{
|
||||||
|
enumValues = new int[1] { int.Parse(itemValue) };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enumValues = JsonConvert.DeserializeObject<int[]>(itemValue) ?? new int[0];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. 翻译每一项并输出逗号拼接字符串
|
||||||
|
var translatedItemData = string.Join(",",
|
||||||
|
enumValues.OrderBy(t=>t).Select(code =>
|
||||||
|
translateDataList[target?.TranslateDicName]
|
||||||
|
.FirstOrDefault(t =>
|
||||||
|
string.Equals(code.ToString(), t.Code, StringComparison.OrdinalIgnoreCase)
|
||||||
|
) is var r && r != null
|
||||||
|
? (isEn_Us ? r.Value : r.ValueCN)
|
||||||
|
: string.Empty
|
||||||
|
));
|
||||||
|
|
||||||
|
ivus.TARGETV = translatedItemData;
|
||||||
|
|
||||||
|
|
||||||
var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty;
|
var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty;
|
||||||
|
|
@ -748,8 +774,33 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
|
||||||
|
|
||||||
var target = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault();
|
var target = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault();
|
||||||
|
|
||||||
oct.TARGETV = translateDataList[target?.TranslateDicName].Where(t => t.Code.ToLower() == target?.QuestionValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
var itemValue = target?.QuestionValue ?? string.Empty;
|
||||||
|
//多选
|
||||||
|
int[] enumValueArray = new int[0];
|
||||||
|
// 1. 反序列化 JSON 数组 (字符串枚举)
|
||||||
|
if (!itemValue.StartsWith("[") || !itemValue.EndsWith("]"))
|
||||||
|
{
|
||||||
|
enumValueArray = new int[1] { int.Parse(itemValue) };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enumValueArray = JsonConvert.DeserializeObject<int[]>(itemValue) ?? new int[0];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. 翻译每一项并输出逗号拼接字符串
|
||||||
|
var translatedItemData = string.Join(",",
|
||||||
|
enumValueArray.OrderBy(t => t).Select(code =>
|
||||||
|
translateDataList[target?.TranslateDicName]
|
||||||
|
.FirstOrDefault(t =>
|
||||||
|
string.Equals(code.ToString(), t.Code, StringComparison.OrdinalIgnoreCase)
|
||||||
|
) is var r && r != null
|
||||||
|
? (isEn_US ? r.Value : r.ValueCN)
|
||||||
|
: string.Empty
|
||||||
|
));
|
||||||
|
|
||||||
|
oct.TARGETV = translatedItemData;
|
||||||
|
|
||||||
var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty;
|
var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue