diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index ef47c1b5a..c7c2610b7 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -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(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig(); - // 定义固定数组 - var fixedFields = new List() { "IsRoutineMRIPDEE", "MRIPDFFScanTime", "MRIPDFFLeadTime", "MRIPDFFOther", "IsAuthorizeRadiologistsParticipate", "AssignFixedTechnologists", "ISStrictManualBurnFlag", "NotStrictManualBurnFlagReason" }; - - // 判断 NotShowFieldList 是否缺少固定数组中的任何字段 - if (!extralConfig.NotShowFieldList.Intersect(fixedFields).Any()) - { - // 如果没有交集(即没有任何一个字段存在),则添加固定数组的字段 - extralConfig.NotShowFieldList.AddRange(fixedFields); - } var trialConfig = _mapper.Map(extralConfig); diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index c13936e71..9544e7352 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -135,12 +135,16 @@ namespace IRaCIS.Core.Application.Service } }; + var fixedFields = new List() { "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(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);