稽查翻译修改 OCT06
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-12-10 13:58:54 +08:00
parent 14ac852eee
commit 55a2301bb5
2 changed files with 39 additions and 8 deletions

View File

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

View File

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