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()); }