From 21b68e6bb991a373af8785a2791e73477c9fca09 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 May 2023 10:09:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskService.cs | 1 - .../Service/Inspection/DTO/InspectionModel.cs | 3 ++ .../Inspection/FrontAuditConfigService.cs | 31 ++++++++++++++++--- .../Service/Inspection/InspectionService.cs | 7 ++++- IRaCIS.Core.Domain/Common/FrontAuditConfig.cs | 2 ++ .../Common/AuditingData.cs | 7 +++-- 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index bc7c9e0f0..c79b2a661 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1269,7 +1269,6 @@ namespace IRaCIS.Core.Application.Service.Allocation var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == trialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsAutoCreate, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException(); - foreach (var task in taskList) { diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index 03049fff2..dfd96079c 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -375,8 +375,10 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public string CreateUserRealName { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; + public string DescriptionCN { get; set; } = string.Empty; public string ModuleTypeName { get; set; } = string.Empty; + public string ModuleTypeNameCN { get; set; } = string.Empty; public string SignText { get; set; } = string.Empty; @@ -386,6 +388,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public bool? InPlan { get; set; } public string OptType { get; set; } = string.Empty; + public string OptTypeCN { get; set; } = string.Empty; public Guid? FrontAuditConfigId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 8daf7cccd..f257b22dd 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -17,6 +17,7 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share.Management; using System.Text.Json.Nodes; using IRaCIS.Application.Contracts; +using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Core.Application.Service { @@ -767,7 +768,7 @@ namespace IRaCIS.Core.Application.Service //处理动态翻译 会在数组中提供 一个属性 “DictionaryCode” 这个是默认约束,做稽查的时候记得注意,免得配置麻烦 - var dynamicTranslateInfoList = tableConfigList.Where(t => t.IsDynamicTranslate && t.IsList).Select(t => new { t.ListName, t.ColumnValue }).Distinct().ToList(); + var dynamicTranslateInfoList = tableConfigList.Where(t => t.IsDynamicTranslate && t.IsList).Select(t => new { t.ListName, t.ColumnValue }).Distinct().ToList(); var dynamicDictionaryNameList = new List(); @@ -780,6 +781,19 @@ namespace IRaCIS.Core.Application.Service dynamicDictionaryNameList = dynamicDictionaryNameList.Distinct().ToList(); } + var specialDynamicColumnValueList = new List(); + if (tableConfigList.Any(t => t.IsDynamicTranslate && t.IsList == false)) + { + // 兼容之前数组的那种方式 实际配置只会配置一条 + specialDynamicColumnValueList = tableConfigList.Where(t => t.IsDynamicTranslate && t.IsList == false) + .Select(t => t.ColumnValue ).Distinct().ToList(); + + var dicNames= arrays.Where(t=>!string.IsNullOrEmpty( t["DictionaryCode"].ToString()) ).Select(t => t["DictionaryCode"].ToString()).Distinct().ToList(); + + dictionaryNameList.AddRange(dicNames); + } + + var allDictionaryNameList = dictionaryNameList.Union(dynamicDictionaryNameList).Distinct(); @@ -801,6 +815,12 @@ namespace IRaCIS.Core.Application.Service jsonObject[translateInfo.ColumnValue] = translateDataList[translateInfo.TranslateDictionaryName].Where(t => t.Code.ToLower() == jsonObject[translateInfo.ColumnValue]?.ToString().ToLower()).Select(t => t.ValueCN).FirstOrDefault(); } + foreach (var specialDynamicColumnValue in specialDynamicColumnValueList) + { + jsonObject[specialDynamicColumnValue] = + translateDataList[jsonObject["DictionaryCode"].ToString()].Where(t => t.Code.ToLower() == jsonObject[specialDynamicColumnValue]?.ToString().ToLower()).Select(t => t.ValueCN).FirstOrDefault(); + } + //处理动态翻译 foreach (var dynamicTranslateInfo in dynamicTranslateInfoList) @@ -818,7 +838,7 @@ namespace IRaCIS.Core.Application.Service var dicName = innerObject["DictionaryCode"]?.ToString(); - if(dicName!=null && !string.IsNullOrEmpty(dicName)) + if (dicName != null && !string.IsNullOrEmpty(dicName)) { innerObject[dynamicTranslateInfo.ColumnValue] = translateDataList[dicName].Where(t => t.Code.ToLower() == innerObject[dynamicTranslateInfo.ColumnValue].ToString().ToLower()).Select(t => t.ValueCN).FirstOrDefault(); @@ -827,7 +847,7 @@ namespace IRaCIS.Core.Application.Service } - jsonObject[dynamicTranslateInfo.ListName] = JToken.FromObject(innberJsonList) ; + jsonObject[dynamicTranslateInfo.ListName] = JToken.FromObject(innberJsonList); } @@ -1170,8 +1190,8 @@ namespace IRaCIS.Core.Application.Service [HttpGet] public async Task> GetModuleTypeDescriptionList(Guid moduleTypeId) { - var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.Sort }).OrderBy(t => t.Sort).ToListAsync(); - return result.Select(t => t.Description).Distinct().ToList(); + var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.DescriptionCN, x.Sort }).OrderBy(t => t.Sort).Select(t => _userInfo.IsEn_Us? t.Description:t.DescriptionCN).Distinct().ToListAsync(); + return result; } /// @@ -1200,6 +1220,7 @@ namespace IRaCIS.Core.Application.Service CreateTime = data.CreateTime, CreateUserId = data.CreateUserId, Description = data.Description, + DescriptionCN=data.DescriptionCN, IsConfig = data.IsConfig, IsEnable = data.IsEnable, ModuleTypeId = data.ModuleTypeId, diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 4ce983a98..7aed50550 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -138,7 +138,11 @@ namespace IRaCIS.Core.Application.Service.Inspection ResearchProgramNo = leftrial.ResearchProgramNo, ObjectTypeId = data.ObjectTypeId, Description = leftfrontAuditConfig.Description, - ModuleTypeName = leftmoduleTypec.ValueCN, + DescriptionCN=leftfrontAuditConfig.DescriptionCN, + + ModuleTypeName = leftmoduleTypec.Value, + ModuleTypeNameCN=leftmoduleTypec.ValueCN, + SignText = lefttrialSign.SignText, Identification = leftfrontAuditConfig.Identification, FrontAuditConfigId = leftfrontAuditConfig.Id, @@ -149,6 +153,7 @@ namespace IRaCIS.Core.Application.Service.Inspection //IsFrontAdd=data.IsFrontAdd, BatchId = data.BatchId, OptType = leftOptType.Value, + OptTypeCN = leftOptType.ValueCN, ObjectRelationParentId = data.ObjectRelationParentId, GeneralId = data.GeneralId, diff --git a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs index 535bee927..1604fa680 100644 --- a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs +++ b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs @@ -24,6 +24,8 @@ namespace IRaCIS.Core.Domain.Models public string Description { get; set; } = String.Empty; + public string DescriptionCN { get; set; } = String.Empty; + public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 84dadffff..bfed26f00 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -2375,11 +2375,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common //保存影像质量 多条记录,只记录一条稽查 if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer))) { - // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 + // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 、附加评估 if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer" || _userInfo.RequestUrl == "ReadingImageTask/saveImageQuality" || _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions" - || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer") + || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer" + || _userInfo.RequestUrl == "ReadingImageTask/submitTaskAdditionalQuestion") { var type = AuditOpt.Add; @@ -2389,7 +2390,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList(); //获取问题名称 组合成数组 - var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).Select(t => new + var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).IgnoreQueryFilters().Select(t => new { t.QuestionName, QuestionId = t.Id,