Compare commits
2 Commits
7f55877688
...
4fde957519
| Author | SHA1 | Date |
|---|---|---|
|
|
4fde957519 | |
|
|
8faa078afc |
|
|
@ -846,10 +846,26 @@ namespace IRaCIS.Core.Application.Service
|
|||
if (jsonObject["DictionaryCode"] != null && jsonObject["DictionaryCode"].ToString() != string.Empty)
|
||||
{
|
||||
|
||||
|
||||
if (jsonObject[item.Code].ToString().Contains(","))
|
||||
{
|
||||
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);
|
||||
|
|
@ -916,12 +932,27 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
//通过字典项的code 翻译 枚举或者 bool
|
||||
else
|
||||
{
|
||||
if (value.ToString().Contains(","))
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
|
|
|||
|
|
@ -131,11 +131,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());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue