修改默认配置
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
hang 2026-05-28 14:55:00 +08:00
parent 385c40c895
commit 89546b9874
2 changed files with 23 additions and 10 deletions

View File

@ -1569,15 +1569,6 @@ namespace IRaCIS.Core.Application
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr, t.TrialDataStoreType, t.IsExternalViewTrialChart, t.TrialObjectNameList, t.CollectImagesEnum, t.IsIQCAutoNextTask, t.IsImageQualityControl }).FirstOrDefault();
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
// 定义固定数组
var fixedFields = new List<string>() { "IsRoutineMRIPDEE", "MRIPDFFScanTime", "MRIPDFFLeadTime", "MRIPDFFOther", "IsAuthorizeRadiologistsParticipate", "AssignFixedTechnologists", "ISStrictManualBurnFlag", "NotStrictManualBurnFlagReason" };
// 判断 NotShowFieldList 是否缺少固定数组中的任何字段
if (!extralConfig.NotShowFieldList.Intersect(fixedFields).Any())
{
// 如果没有交集(即没有任何一个字段存在),则添加固定数组的字段
extralConfig.NotShowFieldList.AddRange(fixedFields);
}
var trialConfig = _mapper.Map<TrialConfigInfo>(extralConfig);

View File

@ -135,12 +135,16 @@ namespace IRaCIS.Core.Application.Service
}
};
var fixedFields = new List<string>() { "IsRoutineMRIPDEE", "MRIPDFFScanTime", "MRIPDFFLeadTime", "MRIPDFFOther", "IsAuthorizeRadiologistsParticipate", "AssignFixedTechnologists", "ISStrictManualBurnFlag", "NotStrictManualBurnFlagReason" };
//已有配置处理
var list = _trialRepository.Where(t => t.TrialExtraConfigJsonStr != "").Select(t => new { t.Id, t.TrialExtraConfigJsonStr }).ToList();
foreach (var item in list)
{
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(item.TrialExtraConfigJsonStr);
//额外配置的中心调研,
if (extralConfig.ModifyFiledList.Count > 0)
{
extralConfig.EquipmentControlFieldList = trialExtalConfig.EquipmentControlFieldList.Where(t => t.ShowOrder != 2).ToList();
@ -152,14 +156,32 @@ namespace IRaCIS.Core.Application.Service
}
if (extralConfig.NotShowFieldList.Count == 0)
{
extralConfig.NotShowFieldList.AddRange(fixedFields);
extralConfig.NotShowFieldList = extralConfig.NotShowFieldList.Distinct().ToList();
}
else
{
//判断固定数组中是否有任意一个元素存在于 NotShowFieldList 中
if (!fixedFields.Any(t => extralConfig.NotShowFieldList.Any(c => c == t)))
{
extralConfig.NotShowFieldList.AddRange(fixedFields);
}
}
var jsonInfo = extralConfig.ToJsonStr();
await _trialRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new Trial() { TrialExtraConfigJsonStr = jsonInfo });
}
//默认配置更新
var info = trialExtalConfig.ToJsonStr();
var idQuery = _trialRepository.Where(t => t.TrialExtraConfigJsonStr == "").Select(t => t.Id);