From d758d27abd1e0998a2cf5e5068df996e8ba9d077 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 7 Dec 2022 17:37:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inspection/FrontAuditConfigService.cs | 32 +++++++++++++++++++ .../Management/SystemNotice.cs | 9 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 2639e28f..07a60cff 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -15,6 +15,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share.Management; +using System.Text.Json.Nodes; namespace IRaCIS.Core.Application.Service { @@ -771,6 +772,37 @@ namespace IRaCIS.Core.Application.Service }).Select(x => x.value).ToListAsync() ); } + + else if (item.Type.ToLower() == FrontAudit.DictionaryType.GetDescription().ToLower()) + { + + List jsonList = new List(); + + foreach (JToken arraysItem in arrays) + { + var jsonObject = JObject.Parse(arraysItem.ToString()); + try + { + + jsonObject[item.Code]= await _dictionaryRepository.Where(x => x.Code == jsonObject["DictionaryCode"].ToString()).Join(_dictionaryRepository.Where(x => x.Code == jsonObject[item.Code].ToString()), a => a.Id, b => b.ParentId, (a, b) => new + { + value = b.ValueCN + }).Select(x => x.value).FirstOrDefaultAsync(); + + + jsonList.Add(jsonObject); + + } + catch (Exception) + { + jsonList.Add(jsonObject); + + } + } + + + jsonDataDic[item.Key] = JToken.FromObject(jsonList); + } else { List guids = new List(); diff --git a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs index 85a0b0ce..1e867206 100644 --- a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs +++ b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs @@ -66,10 +66,17 @@ namespace IRaCIS.Core.Domain.Share.Management ChildGroup = 2, /// - ///id + ///Code /// [DisplayAttribute(Name = "Code")] Code =3, + + + /// + ///DictionaryCode + /// + [DisplayAttribute(Name = "DictionaryType")] + DictionaryType = 4, }