From 55a2301bb5f586c810334adc4df931b4eac3bf1f Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 10 Dec 2025 13:58:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E7=BF=BB=E8=AF=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20OCT06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inspection/FrontAuditConfigService.cs | 43 ++++++++++++++++--- .../Common/AuditingData.cs | 4 +- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 47452ce84..99343427d 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -846,10 +846,26 @@ namespace IRaCIS.Core.Application.Service if (jsonObject["DictionaryCode"] != null && jsonObject["DictionaryCode"].ToString() != string.Empty) { - 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 + + if (jsonObject[item.Code].ToString().Contains(",")) { - value = _userInfo.IsEn_Us ? b.Value : b.ValueCN - }).Select(x => x.value).FirstOrDefaultAsync(); + var data = jsonObject[item.Code].ToString().Split(',').ToList(); + + var codeList = await _dictionaryRepository.Where(x => x.Code == jsonObject["DictionaryCode"].ToString()).Join(_dictionaryRepository.Where(x => data.Contains(x.Code)), a => a.Id, b => b.ParentId, (a, b) => new + { + value = _userInfo.IsEn_Us ? b.Value : b.ValueCN + }).Select(x => x.value).ToListAsync(); + jsonObject[item.Code] = string.Join(",", codeList); + } + else + { + 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 = _userInfo.IsEn_Us ? b.Value : b.ValueCN + }).Select(x => x.value).FirstOrDefaultAsync(); + } + + } jsonList.Add(jsonObject); @@ -917,10 +933,25 @@ namespace IRaCIS.Core.Application.Service //通过字典项的code 翻译 枚举或者 bool else { - jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.Code == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new + if (value.ToString().Contains(",")) { - value = _userInfo.IsEn_Us ? b.Value : b.ValueCN - }).Select(x => x.value).FirstOrDefaultAsync(); + var data = value.ToString().Split(',').ToList(); + + var codeList = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => data.Contains(x.Code)), a => a.Id, b => b.ParentId, (a, b) => new + { + value = _userInfo.IsEn_Us ? b.Value : b.ValueCN + }).Select(x => x.value).ToListAsync(); + jsonDataDic[item.Key] = string.Join(",", codeList); + } + else + { + jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.Code == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new + { + value = _userInfo.IsEn_Us ? b.Value : b.ValueCN + }).Select(x => x.value).FirstOrDefaultAsync(); + } + + } } } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 0655202a8..4abdb083d 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -137,11 +137,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common { if (unit == ValueUnit.Custom) { - transList.Add(answer + string.Empty + customUnit); + transList.Add(item + string.Empty + customUnit); } else { - transList.Add(answer + string.Empty + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()); + transList.Add(item + string.Empty + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()); }